java.lang.Object
org.moeaframework.core.operator.TypeSafeCrossover<Permutation>
org.moeaframework.core.operator.permutation.PMX
All Implemented Interfaces:
Configurable, Variation

public class PMX extends TypeSafeCrossover<Permutation>
Partially mapped crossover (PMX) operator. PMX is similar to two-point crossover, but includes a repair operator to ensure the offspring are valid permutations.

This variation operator is type-safe.

References:

  1. Goldberg, D. and Lingle, R. Jr. "Alleles, Loci, and the Traveling Salesman Problem." Proceedings of the 1st International Conference on Genetic Algorithms and Their Applications. 1985.
  • Constructor Details

    • PMX

      public PMX()
      Constructs a PMX operator that is applied with 100% probability to every solution.
    • PMX

      public PMX(double probability)
      Constructs a PMX operator with the specified probability.
      Parameters:
      probability - the probability of applying this operator
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Variation
      Returns the name of this variation operator. This name should also be used as the prefix for any parameters. As such, the name should only contain alphanumeric characters, avoid using whitespace and other symbols.
      Returns:
      the name of this variation operator
    • evolve

      public void evolve(Permutation p1, Permutation p2)
      Evolves the specified permutations using the PMX operator.
      Specified by:
      evolve in class TypeSafeCrossover<Permutation>
      Parameters:
      p1 - the first permutation
      p2 - the second permutation
      Throws:
      FrameworkException - if the permutations are not the same size