public abstract class CrossoverDouble extends java.lang.Object implements Crossover<org.opt4j.core.genotype.DoubleGenotype>
DoubleGenotype
.Modifier and Type | Field and Description |
---|---|
protected NormalizeDouble |
normalize |
protected java.util.Random |
random |
Constructor and Description |
---|
CrossoverDouble(NormalizeDouble normalize,
org.opt4j.core.common.random.Rand random)
Constructs a new crossover for the
DoubleGenotype . |
Modifier and Type | Method and Description |
---|---|
Pair<org.opt4j.core.genotype.DoubleGenotype> |
crossover(org.opt4j.core.genotype.DoubleGenotype p1,
org.opt4j.core.genotype.DoubleGenotype p2)
Performs a crossover for two
Genotype parents. |
protected abstract 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 parent
Genotype s that
consist of double vectors. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOperatorType
protected final java.util.Random random
protected final NormalizeDouble normalize
@Inject public CrossoverDouble(NormalizeDouble normalize, org.opt4j.core.common.random.Rand random)
DoubleGenotype
.normalize
- a normalize operatorrandom
- the random number generatorpublic Pair<org.opt4j.core.genotype.DoubleGenotype> crossover(org.opt4j.core.genotype.DoubleGenotype p1, org.opt4j.core.genotype.DoubleGenotype p2)
Crossover
Genotype
parents. The resulting pair
of Genotype
offspring is returned.protected abstract 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)
Genotype
s that
consist of double vectors.p1
- the first parentp2
- the second parento1
- the first offspringo2
- the second offspring