public class SwapMutator<G extends Gene<?,G>,C extends Comparable<? super C>> extends Mutator<G,C>
SwapMutationchanges the order of genes in a chromosome, with the hope of bringing related genes closer together, thereby facilitating the production of building blocks. This mutation operator can also be used for combinatorial problems, where no duplicated genes within a chromosome are allowed, e.g. for the TSP.
This mutator is also known as Partial Shuffle Mutator (PSM).
|Constructor and Description|
Default constructor, with default mutation probability (
Constructs an alterer with a given recombination probability.
|Modifier and Type||Method and Description|
Swaps the genes in the given array, with the mutation probability of this mutation.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public SwapMutator(double probability)
probability- the crossover probability.
IllegalArgumentException- if the
probabilityis not in the valid range of
protected MutatorResult<Chromosome<G>> mutate(Chromosome<G> chromosome, double p, Random random)
Mutator<G extends Gene<?,G>,C extends Comparable<? super C>>
chromosome- the chromosome to mutate
p- the mutation probability for the underlying genetic objects
random- the random engine used for the genotype mutation
© 2007-2019 Franz Wilhelmstötter (2019-11-18 20:30)