public class MutatePermutationRevert extends java.lang.Object implements MutatePermutation
Mutate for the PermutationGenotype
. With a given mutation rate two
elements are selected and the list between is inverted.
Given a permutation 1 2 3 4 5 6 7 8
, this might result in 1 2
7 6 5 3 4
.
Modifier and Type | Field and Description |
---|---|
protected java.util.Random |
random |
Constructor and Description |
---|
MutatePermutationRevert(org.opt4j.core.common.random.Rand random)
Constructs a new
MutatePermutation with the given mutation rate. |
Modifier and Type | Method and Description |
---|---|
void |
mutate(org.opt4j.core.genotype.PermutationGenotype<?> genotype,
double p)
Performs a mutation for a
Genotype . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOperatorType
@Inject public MutatePermutationRevert(org.opt4j.core.common.random.Rand random)
MutatePermutation
with the given mutation rate.random
- the random number generatorpublic void mutate(org.opt4j.core.genotype.PermutationGenotype<?> genotype, double p)
Mutate
Genotype
.