Package org.opt4j.operator.mutate
Class MutatePermutationMixed
java.lang.Object
org.opt4j.operator.mutate.MutatePermutationMixed
- All Implemented Interfaces:
Operator<PermutationGenotype<?>>
,Mutate<PermutationGenotype<?>>
,MutatePermutation
Mutate for the PermutationGenotype
. Randomly selects between
MutatePermutationSwap
, MutatePermutationInsert
, and
MutatePermutationRevert
.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final MutatePermutationInsert
protected final Random
protected final MutatePermutationRevert
protected final MutatePermutationSwap
-
Constructor Summary
ConstructorDescriptionMutatePermutationMixed
(MutatePermutationSwap swap, MutatePermutationInsert insert, MutatePermutationRevert revert, Rand random) Constructs a newMutatePermutation
with the given mutation rate. -
Method Summary
Modifier and TypeMethodDescriptionvoid
mutate
(PermutationGenotype<?> genotype, double p) Performs a mutation for aGenotype
.
-
Field Details
-
random
-
swap
-
insert
-
revert
-
-
Constructor Details
-
MutatePermutationMixed
@Inject public MutatePermutationMixed(MutatePermutationSwap swap, MutatePermutationInsert insert, MutatePermutationRevert revert, 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 Details
-
mutate
Description copied from interface:Mutate
Performs a mutation for aGenotype
.- Specified by:
mutate
in interfaceMutate<PermutationGenotype<?>>
- Parameters:
genotype
- the genotype to be mutatedp
- the mutation rate
-