Package org.opt4j.operator.crossover
Class CrossoverDouble
java.lang.Object
org.opt4j.operator.crossover.CrossoverDouble
- All Implemented Interfaces:
Operator<DoubleGenotype>,Crossover<DoubleGenotype>
- Direct Known Subclasses:
CrossoverDoubleElementwise,CrossoverDoubleUnfairAverage
Crossover for the
DoubleGenotype.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCrossoverDouble(NormalizeDouble normalize, Rand random) Constructs a new crossover for theDoubleGenotype. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidPerforms a crossover of two parentGenotypes that consist of double vectors.crossover(DoubleGenotype p1, DoubleGenotype p2) Performs a crossover for twoGenotypeparents.
-
Field Details
-
random
-
normalize
-
-
Constructor Details
-
CrossoverDouble
Constructs a new crossover for theDoubleGenotype.- Parameters:
normalize- a normalize operatorrandom- the random number generator
-
-
Method Details
-
crossover
Description copied from interface:CrossoverPerforms a crossover for twoGenotypeparents. The resulting pair ofGenotypeoffspring is returned.- Specified by:
crossoverin interfaceCrossover<DoubleGenotype>- Parameters:
p1- The first parent genotype for the crossoverp2- The second parents genotype for the crossover- Returns:
- The resulting pair of offspring genotypes
-
crossover
protected abstract void crossover(List<Double> p1, List<Double> p2, List<Double> o1, List<Double> o2) Performs a crossover of two parentGenotypes that consist of double vectors.- Parameters:
p1- the first parentp2- the second parento1- the first offspringo2- the second offspring
-