Package org.opt4j.operator.mutate
Class MutateIntegerRandom
- java.lang.Object
-
- org.opt4j.operator.mutate.MutateIntegerRandom
-
- All Implemented Interfaces:
Operator<IntegerGenotype>,Mutate<IntegerGenotype>,MutateInteger
public class MutateIntegerRandom extends Object implements MutateInteger
TheMutateIntegerRandommutates each element of theIntegerGenotypewith the mutation rate. Here, a new value is created randomly between the lower and upper bounds.
-
-
Constructor Summary
Constructors Constructor Description MutateIntegerRandom(Rand random)Constructs aMutateIntegerRandom.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmutate(IntegerGenotype genotype, double p)Performs a mutation for aGenotype.
-
-
-
Field Detail
-
random
protected final Random random
-
-
Constructor Detail
-
MutateIntegerRandom
@Inject public MutateIntegerRandom(Rand random)
Constructs aMutateIntegerRandom.- Parameters:
random- the random number generator
-
-
Method Detail
-
mutate
public void mutate(IntegerGenotype genotype, double p)
Description copied from interface:MutatePerforms a mutation for aGenotype.- Specified by:
mutatein interfaceMutate<IntegerGenotype>- Parameters:
genotype- the genotype to be mutatedp- the mutation rate
-
-