T
- generic type of the AbstractListChromosome
s for crossoverpublic class OnePointCrossover<T> extends java.lang.Object implements CrossoverPolicy
-C- denotes a crossover point -C- -C- p1 = (1 0 1 0 0 1 | 0 1 1) X p2 = (0 1 1 0 1 0 | 1 1 1) \------------/ \-----/ \------------/ \-----/ || (*) || (**) VV (**) VV (*) /------------\ /-----\ /------------\ /-----\ c1 = (1 0 1 0 0 1 | 1 1 1) X p2 = (0 1 1 0 1 0 | 0 1 1)This policy works only on
AbstractListChromosome
, and therefore it
is parametrized by T. Moreover, the chromosomes must have same lengths.Constructor and Description |
---|
OnePointCrossover() |
Modifier and Type | Method and Description |
---|---|
ChromosomePair |
crossover(Chromosome first,
Chromosome second)
Performs one point crossover.
|
public ChromosomePair crossover(Chromosome first, Chromosome second)
crossover
in interface CrossoverPolicy
first
- first parent (p1)second
- second parent (p2)"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"