jmetal.operators.crossover
Class PMXCrossover
java.lang.Object
jmetal.core.Operator
jmetal.operators.crossover.Crossover
jmetal.operators.crossover.PMXCrossover
- All Implemented Interfaces:
- java.io.Serializable
public class PMXCrossover
- extends Crossover
This class allows to apply a PMX crossover operator using two parent
solutions.
NOTE: the operator is applied to the first encodings.variable of the solutions, and
the type of those variables must be VariableType_.Permutation.
- See Also:
- Serialized Form
Constructor Summary |
PMXCrossover(java.util.HashMap<java.lang.String,java.lang.Object> parameters)
Constructor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PMXCrossover
public PMXCrossover(java.util.HashMap<java.lang.String,java.lang.Object> parameters)
- Constructor
doCrossover
public Solution[] doCrossover(double probability,
Solution parent1,
Solution parent2)
- Perform the crossover operation
- Parameters:
probability
- Crossover probabilityparent1
- The first parentparent2
- The second parent
- Returns:
- An array containig the two offsprings
- Throws:
JMException
execute
public java.lang.Object execute(java.lang.Object object)
throws JMException
- Executes the operation
- Specified by:
execute
in class Operator
- Parameters:
object
- An object containing an array of two solutions
- Returns:
- An object reference. The returned value depends on the operator.
- Throws:
JMException