Package org.opt4j.operators.crossover
Class CrossoverDoubleElementwise
- java.lang.Object
-
- org.opt4j.operators.crossover.CrossoverDouble
-
- org.opt4j.operators.crossover.CrossoverDoubleElementwise
-
- All Implemented Interfaces:
org.opt4j.core.optimizer.Operator<org.opt4j.core.genotype.DoubleGenotype>
,Crossover<org.opt4j.core.genotype.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.operators.crossover.CrossoverDouble
normalize, random
-
-
Constructor Summary
Constructors Constructor Description CrossoverDoubleElementwise(NormalizeDouble normalize, org.opt4j.core.common.random.Rand random)
Constructs a newCrossoverDoubleElementwise
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Pair<java.lang.Double>
crossover(double x, double y)
Performs a crossover with two double values.protected void
crossover(java.util.List<java.lang.Double> p1, java.util.List<java.lang.Double> p2, java.util.List<java.lang.Double> o1, java.util.List<java.lang.Double> o2)
Performs a crossover of two parentGenotype
s that consist of double vectors.-
Methods inherited from class org.opt4j.operators.crossover.CrossoverDouble
crossover
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opt4j.operators.crossover.Crossover
getOperatorType
-
-
-
-
Constructor Detail
-
CrossoverDoubleElementwise
public CrossoverDoubleElementwise(NormalizeDouble normalize, org.opt4j.core.common.random.Rand random)
Constructs a newCrossoverDoubleElementwise
.- Parameters:
normalize
- the normalize operatorrandom
- the random number generator
-
-
Method Detail
-
crossover
protected void crossover(java.util.List<java.lang.Double> p1, java.util.List<java.lang.Double> p2, java.util.List<java.lang.Double> o1, java.util.List<java.lang.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
-
crossover
public abstract Pair<java.lang.Double> crossover(double x, double y)
Performs a crossover with two double values.- Parameters:
x
- the first valuey
- the second value- Returns:
- the resulting values
-
-