Package io.jenetics

Class UniformOderBasedCrossover<T,C extends Comparable<? super C>>

All Implemented Interfaces:
Alterer<EnumGene<T>,C>

public class UniformOderBasedCrossover<T,C extends Comparable<? super C>> extends Crossover<EnumGene<T>,C>
The UniformOderBasedCrossover guarantees that all Genes are found exactly once in each chromosome. No gene is duplicated by this crossover. This crossover can be applied usefully in the TSP or other permutation problem encodings. Permutation encoding is useful for all problems where 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:
  • order crossover
  • cycle crossover
  • edge recombination crossover
  • edge assembly crossover
  • partially matched crossover

Within the uniform order-based crossover, a set of positions are chosen randomly. The genes at the positions are reordered in the order they occur in the other parent.

    C1 = 0123456789
    C2 = 9876543210
    Positions = 2, 4, 5, 7, 8
 
The values at the positions are removed
    C1 = 01_3__6__9
    C2 = 9__6__3_10
    Order of removed values in C1 = 2, 4, 5, 7, 8
    Order of removed values in C2 = 8, 7, 5, 4, 2
 
The removed values are added in the order they occur in the other chromosome
    C1 = 0183756429
    C2 = 9246573810
 
Since:
8.0
Version:
8.0
See Also:
  • Constructor Details

    • UniformOderBasedCrossover

      public UniformOderBasedCrossover(double probability)
      Create a new UniformOrderBasedCrossover instance
      Parameters:
      probability - the recombination probability as defined in Crossover(double). This is the probability that a given individual is selected for crossover.
      Throws:
      IllegalArgumentException - if the probability is not in the valid range of [0, 1]
  • Method Details

    • crossover

      protected int crossover(MSeq<EnumGene<T>> that, MSeq<EnumGene<T>> other)
      Applies uniform order-based crossover to two sequences. A set of positions is chosen, the genes at those positions are reordered as they occur in the other sequence.
      Specified by:
      crossover in class Crossover<EnumGene<T>,C extends Comparable<? super C>>
      Parameters:
      that - first sequence
      other - second sequence
      Returns:
      the number of altered genes
      Throws:
      IllegalArgumentException - if the two input sequences have a different length