Package org.opt4j.operator.crossover
Class CrossoverListXPoint<G extends ListGenotype<?>>
- java.lang.Object
-
- org.opt4j.operator.crossover.CrossoverListXPoint<G>
-
- Direct Known Subclasses:
CrossoverBooleanXPoint,CrossoverIntegerXPoint
public abstract class CrossoverListXPoint<G extends ListGenotype<?>> extends Object implements Crossover<G>
The
CrossoverListXPointperforms a crossover onGenotypeobjects that are lists of values.The crossover is performed on
xpoints of theGenotype.
-
-
Constructor Summary
Constructors Constructor Description CrossoverListXPoint(int x, Rand random)Constructs aCrossoverListXPoint.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Pair<G>crossover(G p1, G p2)Performs a crossover for twoGenotypeparents.
-
-
-
Field Detail
-
x
protected final int x
-
random
protected final Random random
-
-
Constructor Detail
-
CrossoverListXPoint
@Inject public CrossoverListXPoint(int x, Rand random)Constructs aCrossoverListXPoint.- Parameters:
x- the number of crossover pointsrandom- the random number generator
-
-
Method Detail
-
crossover
public Pair<G> crossover(G p1, G p2)
Description copied from interface:CrossoverPerforms a crossover for twoGenotypeparents. The resulting pair ofGenotypeoffspring is returned.- Specified by:
crossoverin interfaceCrossover<G extends ListGenotype<?>>- Parameters:
p1- The first parent genotype for the crossoverp2- The second parents genotype for the crossover- Returns:
- The resulting pair of offspring genotypes
-
-