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
FieldsModifier and TypeFieldDescriptionprotected final MutatePermutationInsertprotected final Randomprotected final MutatePermutationRevertprotected final MutatePermutationSwap -
Constructor Summary
ConstructorsConstructorDescriptionMutatePermutationMixed(MutatePermutationSwap swap, MutatePermutationInsert insert, MutatePermutationRevert revert, Rand random) Constructs a newMutatePermutationwith the given mutation rate. -
Method Summary
Modifier and TypeMethodDescriptionvoidmutate(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 newMutatePermutationwith 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:MutatePerforms a mutation for aGenotype.- Specified by:
mutatein interfaceMutate<PermutationGenotype<?>>- Parameters:
genotype- the genotype to be mutatedp- the mutation rate
-