public class MutatePermutationMixed extends java.lang.Object implements MutatePermutation
Mutate for the PermutationGenotype
. Randomly selects between
MutatePermutationSwap
, MutatePermutationInsert
, and
MutatePermutationRevert
.
Modifier and Type | Field and Description |
---|---|
protected MutatePermutationInsert |
insert |
protected java.util.Random |
random |
protected MutatePermutationRevert |
revert |
protected MutatePermutationSwap |
swap |
Constructor and Description |
---|
MutatePermutationMixed(MutatePermutationSwap swap,
MutatePermutationInsert insert,
MutatePermutationRevert revert,
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
protected final java.util.Random random
protected final MutatePermutationSwap swap
protected final MutatePermutationInsert insert
protected final MutatePermutationRevert revert
@Inject public MutatePermutationMixed(MutatePermutationSwap swap, MutatePermutationInsert insert, MutatePermutationRevert revert, org.opt4j.core.common.random.Rand random)
MutatePermutation
with the given mutation rate.swap
- the swap mutateinsert
- the insert mutaterevert
- the revert mutaterandom
- the random number generatorpublic void mutate(org.opt4j.core.genotype.PermutationGenotype<?> genotype, double p)
Mutate
Genotype
.