Class BinaryMutation
- java.lang.Object
-
- org.apache.commons.math4.legacy.genetics.BinaryMutation
-
- All Implemented Interfaces:
MutationPolicy
public class BinaryMutation extends Object implements MutationPolicy
Mutation forBinaryChromosomes. Randomly changes one gene.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description BinaryMutation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Chromosomemutate(Chromosome original)Mutate the given chromosome.
-
-
-
Constructor Detail
-
BinaryMutation
public BinaryMutation()
-
-
Method Detail
-
mutate
public Chromosome mutate(Chromosome original) throws MathIllegalArgumentException
Mutate the given chromosome. Randomly changes one gene.- Specified by:
mutatein interfaceMutationPolicy- Parameters:
original- the original chromosome.- Returns:
- the mutated chromosome.
- Throws:
MathIllegalArgumentException- iforiginalis not an instance ofBinaryChromosome.
-
-