Package org.moeaframework.core.operator
Class AdaptiveMultimethodVariation
java.lang.Object
org.moeaframework.core.operator.AbstractCompoundVariation<Variation>
org.moeaframework.core.operator.AdaptiveMultimethodVariation
- All Implemented Interfaces:
Configurable
,Variation
Auto-adaptive multi-method recombination operator. Applies operators with probabilities proportional to the number
of offspring produced by each operator in the archive.
-
Field Summary
Fields inherited from class org.moeaframework.core.operator.AbstractCompoundVariation
operators
-
Constructor Summary
ConstructorDescriptionAdaptiveMultimethodVariation
(Population archive) Constructs an auto-adaptive multi-method recombination operator with the specified archive for updating probabilities. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addOperator
(Variation operator) Adds an operator to be used in the auto-adaptive multi-method recombination.Solution[]
Evolves one or more parent solutions (specified bygetArity
) and produces one or more child solutions.int
getArity()
Returns the number of solutions that must be supplied to theevolve
method.getName()
Returns the name of this variation operator.int
Returns the number of available operators.getOperator
(int index) Returns the operator at the specified index.protected double[]
Returns the array of probabilities of applying each operator.double
getOperatorProbability
(int index) Returns the probability that the operator at the specified index is applied.int
Returns the number of invocations of theevolve
method between updating the operator selection probabilities.protected int
Returns the index of one of the available operators randomly selected using the probabilities.Methods inherited from class org.moeaframework.core.operator.AbstractCompoundVariation
applyConfiguration, contains, getConfiguration, getOperators, setName
-
Constructor Details
-
AdaptiveMultimethodVariation
Constructs an auto-adaptive multi-method recombination operator with the specified archive for updating probabilities.- Parameters:
archive
- the archive used to update the probabilities
-
-
Method Details
-
getName
Description copied from class:AbstractCompoundVariation
Returns the name of this variation operator. If no name has been assigned throughAbstractCompoundVariation.setName(String)
, a name is generated which identifies the underlying operators.- Specified by:
getName
in interfaceVariation
- Overrides:
getName
in classAbstractCompoundVariation<Variation>
- Returns:
- the name of this variation operator
-
getUpdateWindow
public int getUpdateWindow()Returns the number of invocations of theevolve
method between updating the operator selection probabilities.- Returns:
- the number of invocations of the
evolve
method between updating the operator selection probabilities
-
addOperator
Adds an operator to be used in the auto-adaptive multi-method recombination.- Parameters:
operator
- the operator
-
getNumberOfOperators
public int getNumberOfOperators()Returns the number of available operators.- Returns:
- the number of available operators
-
getOperator
Returns the operator at the specified index.- Parameters:
index
- the index of the operator to be returned- Returns:
- the operator at the specified index
-
getOperatorProbability
public double getOperatorProbability(int index) Returns the probability that the operator at the specified index is applied.- Parameters:
index
- the index of the operator whose probability is returned- Returns:
- the probability that the operator at the specified index is applied
-
getOperatorProbabilities
protected double[] getOperatorProbabilities()Returns the array of probabilities of applying each operator.- Returns:
- the array of probabilities of applying each operator
-
selectOperator
protected int selectOperator()Returns the index of one of the available operators randomly selected using the probabilities.- Returns:
- the index of one of the available operators randomly selected using the probabilities
-
evolve
Description copied from interface:Variation
Evolves one or more parent solutions (specified bygetArity
) and produces one or more child solutions. By contract, the parents must not be modified. The copy constructor should be used to create copies of the parents with these copies subsequently modified.- Specified by:
evolve
in interfaceVariation
- Overrides:
evolve
in classAbstractCompoundVariation<Variation>
- Parameters:
parents
- the array of parent solutions- Returns:
- an array of child solutions
-
getArity
public int getArity()Description copied from interface:Variation
Returns the number of solutions that must be supplied to theevolve
method.- Specified by:
getArity
in interfaceVariation
- Overrides:
getArity
in classAbstractCompoundVariation<Variation>
- Returns:
- the number of solutions that must be supplied to the
evolve
method
-