MOEA Framework 2.3
API Specification

org.moeaframework.core.operator
Class TwoPointCrossover

java.lang.Object
  extended by org.moeaframework.core.operator.TwoPointCrossover
All Implemented Interfaces:
Variation

public class TwoPointCrossover
extends Object
implements Variation

Two-point crossover. Two crossover points are selected and all decision variables between the two points are swapped between the two parents. The two children resulting from this swapping are returned.


Constructor Summary
TwoPointCrossover(double probability)
          Constructs a two-point crossover operator with the specified probability of applying this operator to solutions.
 
Method Summary
 Solution[] evolve(Solution[] parents)
          Evolves one or more parent solutions (specified by getArity) and produces one or more child solutions.
 int getArity()
          Returns the number of solutions that must be supplied to the evolve method.
 double getProbability()
          Returns the probability of applying this operator to solutions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwoPointCrossover

public TwoPointCrossover(double probability)
Constructs a two-point crossover operator with the specified probability of applying this operator to solutions.

Parameters:
probability - the probability of applying this operator to solutions
Method Detail

getProbability

public double getProbability()
Returns the probability of applying this operator to solutions.

Returns:
the probability of applying this operator to solutions

evolve

public Solution[] evolve(Solution[] parents)
Description copied from interface: Variation
Evolves one or more parent solutions (specified by getArity) 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 interface 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 the evolve method.

Specified by:
getArity in interface Variation
Returns:
the number of solutions that must be supplied to the evolve method

MOEA Framework 2.3
API Specification

Copyright 2009-2014 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Hosted by Get MOEA Framework at SourceForge.net. Fast, secure and Free Open Source software downloads