Class PMX
java.lang.Object
org.moeaframework.core.operator.TypeSafeCrossover<Permutation>
org.moeaframework.core.operator.permutation.PMX
- All Implemented Interfaces:
Configurable
,Variation
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:
- 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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
evolve
(Permutation p1, Permutation p2) Evolves the specified permutations using the PMX operator.getName()
Returns the name of this variation operator.Methods inherited from class org.moeaframework.core.operator.TypeSafeCrossover
evolve, getArity, getProbability, setProbability
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.moeaframework.core.configuration.Configurable
applyConfiguration, getConfiguration
-
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
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
Evolves the specified permutations using the PMX operator.- Specified by:
evolve
in classTypeSafeCrossover<Permutation>
- Parameters:
p1
- the first permutationp2
- the second permutation- Throws:
FrameworkException
- if the permutations are not the same size
-