Package org.opt4j.operator.mutate
Class MutateBoolean
- java.lang.Object
-
- org.opt4j.operator.mutate.MutateBoolean
-
- All Implemented Interfaces:
Operator<BooleanGenotype>,Mutate<BooleanGenotype>
public class MutateBoolean extends Object implements Mutate<BooleanGenotype>
Mutate for theBooleanGenotype.
-
-
Constructor Summary
Constructors Constructor Description MutateBoolean(Rand random)Constructs a newMutateBooleanwith the given mutation rate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmutate(BooleanGenotype genotype, double p)Performs a mutation for aGenotype.
-
-
-
Field Detail
-
random
protected final Random random
-
-
Constructor Detail
-
MutateBoolean
@Inject public MutateBoolean(Rand random)
Constructs a newMutateBooleanwith the given mutation rate.- Parameters:
random- the random number generator
-
-
Method Detail
-
mutate
public void mutate(BooleanGenotype genotype, double p)
Description copied from interface:MutatePerforms a mutation for aGenotype.- Specified by:
mutatein interfaceMutate<BooleanGenotype>- Parameters:
genotype- the genotype to be mutatedp- the mutation rate
-
-