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
-
Constructor Summary
ConstructorDescriptionCrossoverDouble
(NormalizeDouble normalize, Rand random) Constructs a new crossover for theDoubleGenotype
. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
Performs a crossover of two parentGenotype
s that consist of double vectors.crossover
(DoubleGenotype p1, DoubleGenotype p2) Performs a crossover for twoGenotype
parents.
-
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:Crossover
Performs a crossover for twoGenotype
parents. The resulting pair ofGenotype
offspring is returned.- Specified by:
crossover
in 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 parentGenotype
s that consist of double vectors.- Parameters:
p1
- the first parentp2
- the second parento1
- the first offspringo2
- the second offspring
-