Package org.opt4j.operator.mutate
Class MutatePermutationInsert
java.lang.Object
org.opt4j.operator.mutate.MutatePermutationInsert
- All Implemented Interfaces:
Operator<PermutationGenotype<?>>
,Mutate<PermutationGenotype<?>>
,MutatePermutation
Mutate for the PermutationGenotype
. With a given mutation rate each
element is inserted on a different position.
Given a permutation 1 2 3 4 5 6 7 8
, this might result in 1 2
6 3 4 5 7 8
.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMutatePermutationInsert
(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
-
-
Constructor Details
-
MutatePermutationInsert
Constructs a newMutatePermutation
with the given mutation rate.- Parameters:
random
- 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
-