- All Implemented Interfaces:
Consider as an example parent permutation p1 = [7, 6, 5, 4, 3, 2, 1, 0] and parent permutation p2 = [1, 2, 0, 5, 6, 4, 7, 3]. Now consider that the random cross sites are indexes 3, 1, and 6. Child c1 is initialized as a copy of p1, i.e., c1 = [7, 6, 5, 4, 3, 2, 1, 0]. At index 3 in p1 is element 4, and at index 3 in p2 is element 5, so UPMX swaps the 4 and the 5 within c1 to get c1 = [7, 6, 4, 5, 3, 2, 1, 0]. At index 1, we find elements 6 and 2 in p1 and p2, respectively, so UMPX swaps the 6 and the 2 within c1 to get c1 = [7, 2, 4, 5, 3, 6, 1, 0]. Finally, at index 6, we find 1 and 7 in p1 and p2, respectively. Thus, UPMX swaps the 1 and 7 within c1 to get the final child c1 = [1, 2, 4, 5, 3, 6, 7, 0]. In a similar way, we can derive child c2, such that c2 = [7, 6, 0, 4, 2, 5, 1, 3].
UPMX was introduced in the following paper:
Vincent A. Cicirello and Stephen F. Smith. Modeling GA Performance for Control Parameter Optimization. Proceedings of the Genetic and Evolutionary Computation Conference (GECCO-2000), pages 235-242. Morgan Kaufmann Publishers, July 2000. [PDF] [BIB] [From ACM Digital Library]
The worst case runtime of a call to
cross is O(N), where N is the length of the
Method SummaryModifier and TypeMethodDescription
PermutationFullBinaryOperatorfor details of this method.
voidPerforms a crossover for an evolutionary algorithm, such that crossover forms two children from two parents.
split()Generates a functionally identical copy of this object, for use in multithreaded implementations of search algorithms.
UniformPartiallyMatchedCrossoverpublic UniformPartiallyMatchedCrossover()Constructs a uniform partially matched crossover (UPMX) operator, with a default u = 1.0 / 3.0. The rationale for this default u is that it leads UPMX to the same expected number of swaps as PMX, only scattered throughout the permutation.
(double u)Constructs a uniform partially matched crossover (UPMX) operator.
u- The probability of an index being among the cross points.
IllegalArgumentException- if u is less than or equal to 0.0, or if u is greater than or equal to 1.0.
crossDescription copied from interface:
CrossoverOperatorPerforms a crossover for an evolutionary algorithm, such that crossover forms two children from two parents. Implementations of this method modify the parameters, transforming the parents into the children.
splitpublic UniformPartiallyMatchedCrossover split()Description copied from interface:
SplittableGenerates a functionally identical copy of this object, for use in multithreaded implementations of search algorithms. The state of the object that is returned may or may not be identical to that of the original. Thus, this is a distinct concept from the functionality of the
Copyableinterface. Classes that implement this interface must ensure that the object returned performs the same functionality, and that it does not share any state data that would be either unsafe or inefficient for concurrent access by multiple threads. The split method is allowed to simply return the this reference, provided that it is both safe and efficient for multiple threads to share a single copy of the Splittable object. The intention is to provide a multithreaded search with the capability to provide spawned threads with their own distinct search operators. Such multithreaded algorithms can call the split method for each thread it spawns to generate a functionally identical copy of the operator, but with independent state.
PermutationFullBinaryOperatorfor details of this method. This method is not intended for direct usage. Use the
cross(org.cicirello.permutations.Permutation, org.cicirello.permutations.Permutation)method instead.