AbstractListChromosomes for crossover
-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 c2 = (0 1 1 0 1 0 | 0 1 1)
This policy works only on AbstractListChromosome, and therefore it
is parameterized by T. Moreover, the chromosomes must have same lengths.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ChromosomePair | Returns: pair of two children (c1,c2)first parent (p1) first, final Chromosome second parent (p2) second)Implements org. Performs one point crossover. |
| private ChromosomePair | Returns: the pair of new chromosomes that resulted from the crossover.the first chromosome. first, final AbstractListChromosome<T> the second chromosome. second)Helper for |
| OnePointCrossover | back to summary |
|---|---|
| public OnePointCrossover() | |
| crossover | back to summary |
|---|---|
| public ChromosomePair crossover(final Chromosome first, final Chromosome second) throws DimensionMismatchException, MathIllegalArgumentException Implements org. Performs one point crossover. A random crossover point is selected and the first part from each parent is copied to the corresponding child, and the second parts are copied crosswise. Example:
-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 c2 = (0 1 1 0 1 0 | 0 1 1)
| |
| crossover | back to summary |
|---|---|
| private ChromosomePair crossover(final AbstractListChromosome<T> first, final AbstractListChromosome<T> second) throws DimensionMismatchException Helper for
| |