Overview | Group | Tree | Graph | Index | Concepts |
This factory provides a set of parameters as well as functions that build operators based on these parameters.
Assuming that you have already created:
prototype
).vars
).Then the following code creates two operators which
operate on vars
.
IloEAOperatorFactory factory(env, vars); factory.setPrototype(prototype); factory.setSearchLimit(IloFailLimit(env, 100)); IloPoolProc mut = factory.mutate(1.0 / vars.getSize(), "mutate"); IloPoolProc xo = factory.uniformXover(0.5, "uXover");
Constructor Summary | |
---|---|
public | IloEAOperatorFactory(IloEAOperatorFactoryI * impl=0) Initializes the handle. |
public | IloEAOperatorFactory(IloEnv env, IloIntVarArray scope) Creates an operator factory. |
public | IloEAOperatorFactory(IloEnv env, IloBoolVarArray scope) Creates an operator factory. |
Method Summary | |
---|---|
public IloEAOperatorFactoryI * | getImpl() const Returns the pointer to the implementation class. |
public IloNum | getLeaveFactor() const Returns the probability, for each variable, of being left unbound by created operators. |
public IloPoolOperator | mutate(IloNum mutationProb, const char * name=0) const Creates a mutation operator. |
public IloPoolOperator | onePointXover(const char * name=0) const Creates a one-point crossover operator. |
public IloPoolOperator | randomize(const char * name=0) const Creates a randomization operator. |
public IloPoolOperator | relax(const char * name=0) const Creates a uniform relaxation operator. |
public IloPoolOperator | relaxSequence(IloNum breakProbability, const char * name=0) const Relaxes random parts of the array. |
public void | setLeaveFactor(IloNum leaveFactor) const Specifies the probability, for each variable, of being left unbound by created operators. |
public IloPoolOperator | swap(const char * name=0) const Creates a swap operator. |
public IloPoolOperator | translocate(const char * name=0) const Creates a translocation operator. |
public IloPoolOperator | transpose(const char * name=0) const Creates a transposition operator. |
public IloPoolOperator | twoPointXover(const char * name=0) const Creates a two-point crossover operator. |
public IloPoolOperator | uniformXover(const char * name=0) const Creates a uniform crossover operator with crossover rate 0.5. |
public IloPoolOperator | uniformXover(IloNum xoverRate, const char * name=0) const Creates a uniform crossover operator. |
Constructor Detail |
---|
This constructor creates a handle object (an instance of
the class IloEAOperatorFactory
) from a pointer
to an implementation object (an instance of the class
IloEAOperatorFactoryI
).
This constructor creates an operator factory
associated with the environment env
which
will produce operators on the array of integer variables
scope
.
This constructor creates an array operator factory
associated with the environment env
which
will produce operators on the array of Boolean variables
scope
.
Method Detail |
---|
This member function returns the implementation object of the invoking handle.
This member function returns the probability, for each array cell,
of being left unbound by created operators. It returns the probability
set at the previous call to
IloEAOperatorFactory::setLeaveFactor
or to 0.0 if no probability was set.
This operator selects one parent and produces a solution by
inheriting its values. Each inherited value is mutated with a
given mutation probability mutationProb
.
name
, if provided becomes the name of the newly created operator.
This recombination operator selects two parents and produces a
new solution by inheriting values from the second parent for
array indices greater than a randomly chosen cut point. Other
values are inherited from the first parent.
name
, if provided becomes the name of the newly created operator.
This operator instantiates variables by choosing random
values in their domain. name
, if provided becomes the name
of the newly created operator.
This operator selects one parent and produces a new solution
by leaving some variables unbound. The probability of leaving a
variable unbound is given by the leaveFactor
parameter of this
factory.
name
, if provided becomes the name of the newly created operator.
See Also:
IloEAOperatorFactory::setLeaveFactor, IloEAOperatorFactory::getLeaveFactor
This operator selects one parent and produces a new solution by copying the
parent values with the exception of randomly chosen value
sequences. The given probability breakProbability
specifies, for each array site,
the likelihood of starting (or ending) a relaxed sequence.
name
, if provided becomes the name of the newly created operator.
This member function specifies the probability leaveFactor
,
for each cell, of being left unbound by created operators.
IloPoolOperatorFactory::setAfterOperate
or
IloPoolOperatorFactory::addAfterOperate
methods) if the leaveFactor
parameter is non-zero. This goal
should bind the variables that remain unbound.This swap operator selects a parent solution, chooses two random
locations of the accessed array, and attempts to exchange their
values. Upon failure, it backtracks to choose different exchange
locations and fails when all exchange points have been tried.
name
, if provided becomes the name of the newly created
operator.
This translocation operator selects a parent solution and then chooses a random interval
of the accessed array and a random insertion point. It then attempts
to create a solution in which the sequence delimited by the chosen
interval will be moved to the insertion point. Upon failure, it
backtracks to choose a different insertion point. When this fails,
it backtracks to change the interval to try to move. It fails when all
intervals and insertion points have been tried.
name
, if provided becomes the name of the newly created operator.
This transposition operator selects a parent solution and chooses a random
interval of the accessed array. It then attempts to create a
solution in which the sequence delimited by the chosen interval
will be reversed. Upon failure, it backtracks to choose a different
interval and fails when all intervals have been tried.
name
, if provided becomes the name of the newly created operator.
This recombination operator selects two parents and produces a
solution by inheriting values from the second parent for array
indices contained between two randomly chosen cut points. Other
values are inherited from the first parent. Upon failure, this
goal backtracks by trying other cut points.
name
, if provided becomes the name of the newly created operator.
This recombination operator selects two parents and
produces a new solution by inheriting values from the first or
second parent based on a crossover rate of 0.5. This goal does
not backtrack.
name
, if provided becomes the name of the newly created operator.
This recombination operator selects two parents and
produces a new solution by inheriting values from the first or
second parent based on the given crossover rate. This goal does
not backtrack. The parameter xoverRate
sets the
probability of each feature being exchanged.
name
, if provided becomes the name of the newly created operator.