jmetal.operators.crossover
Class TwoPointsCrossover

java.lang.Object
  extended by jmetal.core.Operator
      extended by jmetal.operators.crossover.Crossover
          extended by 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

Field Summary
 
Fields inherited from class jmetal.core.Operator
parameters_
 
Constructor Summary
TwoPointsCrossover(java.util.HashMap<java.lang.String,java.lang.Object> parameters)
          Constructor Creates a new intance of the two point crossover operator
 
Method Summary
 Solution[] doCrossover(double probability, Solution parent1, Solution parent2)
          Perform the crossover operation
 java.lang.Object execute(java.lang.Object object)
          Executes the operation
 
Methods inherited from class jmetal.core.Operator
getParameter, setParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwoPointsCrossover

public TwoPointsCrossover(java.util.HashMap<java.lang.String,java.lang.Object> parameters)
Constructor Creates a new intance of the two point crossover operator

Method Detail

doCrossover

public Solution[] doCrossover(double probability,
                              Solution parent1,
                              Solution parent2)
                       throws JMException
Perform the crossover operation

Parameters:
probability - Crossover probability
parent1 - The first parent
parent2 - 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