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 CrossoverListXPoint
performs a crossover on
Genotype
objects that are lists of values.
The crossover is performed on x
points of the
Genotype
.
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
x
protected final int x -
random
-
-
Constructor Details
-
CrossoverListXPoint
Constructs aCrossoverListXPoint
.- Parameters:
x
- the number of crossover pointsrandom
- the random number generator
-
-
Method Details
-
crossover
Description copied from interface:Crossover
Performs a crossover for twoGenotype
parents. The resulting pair ofGenotype
offspring is returned.- Specified by:
crossover
in 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
-