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
TheMutateIntegerRandom
mutates each element of theIntegerGenotype
with 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 void
mutate(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:Mutate
Performs a mutation for aGenotype
.- Specified by:
mutate
in interfaceMutate<IntegerGenotype>
- Parameters:
genotype
- the genotype to be mutatedp
- the mutation rate
-
-