Package org.opt4j.operator.crossover
Class CrossoverDoubleElementwise
- java.lang.Object
-
- org.opt4j.operator.crossover.CrossoverDouble
-
- org.opt4j.operator.crossover.CrossoverDoubleElementwise
-
- All Implemented Interfaces:
Operator<DoubleGenotype>
,Crossover<DoubleGenotype>
- Direct Known Subclasses:
CrossoverDoubleBLX
,CrossoverDoubleSBX
public abstract class CrossoverDoubleElementwise extends CrossoverDouble
TheCrossoverDoubleElementwise
can be used to deriveCrossoverDouble
classOperators that can work element-wise on the double vectors.
-
-
Field Summary
-
Fields inherited from class org.opt4j.operator.crossover.CrossoverDouble
normalize, random
-
-
Constructor Summary
Constructors Constructor Description CrossoverDoubleElementwise(NormalizeDouble normalize, Rand random)
Constructs a newCrossoverDoubleElementwise
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Pair<Double>
crossover(double x, double y)
Performs a crossover with two double values.protected 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.-
Methods inherited from class org.opt4j.operator.crossover.CrossoverDouble
crossover
-
-
-
-
Constructor Detail
-
CrossoverDoubleElementwise
public CrossoverDoubleElementwise(NormalizeDouble normalize, Rand random)
Constructs a newCrossoverDoubleElementwise
.- Parameters:
normalize
- the normalize operatorrandom
- the random number generator
-
-
Method Detail
-
crossover
protected void crossover(List<Double> p1, List<Double> p2, List<Double> o1, List<Double> o2)
Description copied from class:CrossoverDouble
Performs a crossover of two parentGenotype
s that consist of double vectors.- Specified by:
crossover
in classCrossoverDouble
- Parameters:
p1
- the first parentp2
- the second parento1
- the first offspringo2
- the second offspring
-
-