Class RandomKeyMutation
- java.lang.Object
-
- org.apache.commons.math4.legacy.genetics.RandomKeyMutation
-
- All Implemented Interfaces:
MutationPolicy
public class RandomKeyMutation extends Object implements MutationPolicy
Mutation operator forRandomKey
s. Changes a randomly chosen element of the array representation to a random value uniformly distributed in [0,1].- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description RandomKeyMutation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Chromosome
mutate(Chromosome original)
Mutate the given chromosome.
-
-
-
Constructor Detail
-
RandomKeyMutation
public RandomKeyMutation()
-
-
Method Detail
-
mutate
public Chromosome mutate(Chromosome original) throws MathIllegalArgumentException
Mutate the given chromosome.- Specified by:
mutate
in interfaceMutationPolicy
- Parameters:
original
- the original chromosome.- Returns:
- the mutated chromosome.
- Throws:
MathIllegalArgumentException
- iforiginal
is not aRandomKey
instance
-
-