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
public abstract class CrossoverDouble extends Object implements Crossover<DoubleGenotype>
Crossover for theDoubleGenotype.
-
-
Field Summary
Fields Modifier and Type Field Description protected NormalizeDoublenormalizeprotected Randomrandom
-
Constructor Summary
Constructors Constructor Description CrossoverDouble(NormalizeDouble normalize, Rand random)Constructs a new crossover for theDoubleGenotype.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidcrossover(List<Double> p1, List<Double> p2, List<Double> o1, List<Double> o2)Performs a crossover of two parentGenotypes that consist of double vectors.Pair<DoubleGenotype>crossover(DoubleGenotype p1, DoubleGenotype p2)Performs a crossover for twoGenotypeparents.
-
-
-
Field Detail
-
random
protected final Random random
-
normalize
protected final NormalizeDouble normalize
-
-
Constructor Detail
-
CrossoverDouble
@Inject public CrossoverDouble(NormalizeDouble normalize, Rand random)
Constructs a new crossover for theDoubleGenotype.- Parameters:
normalize- a normalize operatorrandom- the random number generator
-
-
Method Detail
-
crossover
public Pair<DoubleGenotype> crossover(DoubleGenotype p1, DoubleGenotype p2)
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
-
-