Package org.opt4j.operators.mutate
Class MutatePermutationMixed
- java.lang.Object
-
- org.opt4j.operators.mutate.MutatePermutationMixed
-
- All Implemented Interfaces:
org.opt4j.core.optimizer.Operator<org.opt4j.core.genotype.PermutationGenotype<?>>
,Mutate<org.opt4j.core.genotype.PermutationGenotype<?>>
,MutatePermutation
public class MutatePermutationMixed extends java.lang.Object implements MutatePermutation
Mutate for the
PermutationGenotype
. Randomly selects betweenMutatePermutationSwap
,MutatePermutationInsert
, andMutatePermutationRevert
.
-
-
Field Summary
Fields Modifier and Type Field Description protected MutatePermutationInsert
insert
protected java.util.Random
random
protected MutatePermutationRevert
revert
protected MutatePermutationSwap
swap
-
Constructor Summary
Constructors Constructor Description MutatePermutationMixed(MutatePermutationSwap swap, MutatePermutationInsert insert, MutatePermutationRevert revert, org.opt4j.core.common.random.Rand random)
Constructs a newMutatePermutation
with the given mutation rate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
mutate(org.opt4j.core.genotype.PermutationGenotype<?> genotype, double p)
Performs a mutation for aGenotype
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opt4j.operators.mutate.Mutate
getOperatorType
-
-
-
-
Field Detail
-
random
protected final java.util.Random random
-
swap
protected final MutatePermutationSwap swap
-
insert
protected final MutatePermutationInsert insert
-
revert
protected final MutatePermutationRevert revert
-
-
Constructor Detail
-
MutatePermutationMixed
@Inject public MutatePermutationMixed(MutatePermutationSwap swap, MutatePermutationInsert insert, MutatePermutationRevert revert, org.opt4j.core.common.random.Rand random)
Constructs a newMutatePermutation
with the given mutation rate.- Parameters:
swap
- the swap mutateinsert
- the insert mutaterevert
- the revert mutaterandom
- the random number generator
-
-
Method Detail
-
mutate
public void mutate(org.opt4j.core.genotype.PermutationGenotype<?> genotype, double p)
Description copied from interface:Mutate
Performs a mutation for aGenotype
.
-
-