public class PartiallyMatchedCrossover<T,C extends Comparable<? super C>> extends Crossover<EnumGene<T>,C>
PartiallyMatchedCrossover(PMX) guarantees that all
Genes are found exactly once in each chromosome. No gene is duplicated by this crossover. The PMX can be applied usefully in the TSP or other permutation problem encodings. Permutation encoding is useful for all problems where the fitness only depends on the ordering of the genes within the chromosome. This is the case in many combinatorial optimization problems. Other crossover operators for combinatorial optimization are:
The PMX is similar to the two-point crossover. A crossing region is chosen by selecting two crossing points.
C1 = 012|345|6789 C2 = 987|654|3210After performing the crossover we normally got two invalid chromosomes.
C1 = 012|654|6789 C2 = 987|345|3210Chromosome
C1contains the value 6 twice and misses the value 3. On the other side chromosome
C2contains the value 3 twice and misses the value 6. We can observe that this crossover is equivalent to the exchange of the values
3 -> 6,
4 -> 5and
5 -> 4. To repair the two chromosomes we have to apply this exchange outside the crossing region.
C1 = 012|654|3789 C2 = 987|345|6210The
PartiallyMatchedCrossoverclass requires chromosomes with the same length. An
IllegalArgumentExceptionis thrown at runtime if this requirement is not fulfilled.
|Constructor and Description|
|Modifier and Type||Method and Description|
Template method which performs the crossover.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public PartiallyMatchedCrossover(double probability)
© 2007-2019 Franz Wilhelmstötter (2019-11-18 20:30)