jmetal.operators.crossover
Class TwoPointsCrossover
java.lang.Object
jmetal.core.Operator
jmetal.operators.crossover.Crossover
jmetal.operators.crossover.TwoPointsCrossover
- All Implemented Interfaces:
- java.io.Serializable
public class TwoPointsCrossover
- extends Crossover
This class allows to apply a two points crossover operator using two parent
solutions.
NOTE: the type of the solutions must be Permutation..
- See Also:
- Serialized Form
Constructor Summary |
TwoPointsCrossover(java.util.HashMap<java.lang.String,java.lang.Object> parameters)
Constructor
Creates a new intance of the two point crossover operator |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TwoPointsCrossover
public TwoPointsCrossover(java.util.HashMap<java.lang.String,java.lang.Object> parameters)
- Constructor
Creates a new intance of the two point crossover operator
doCrossover
public Solution[] doCrossover(double probability,
Solution parent1,
Solution parent2)
throws JMException
- Perform the crossover operation
- Parameters:
probability
- Crossover probabilityparent1
- The first parentparent2
- The second parent
- Returns:
- Two offspring solutions
- 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 containing an array with the offSprings
- Throws:
JMException