Package org.opt4j.operators.mutate
Class MutateIntegerRandom
- java.lang.Object
-
- org.opt4j.operators.mutate.MutateIntegerRandom
-
- All Implemented Interfaces:
org.opt4j.core.optimizer.Operator<org.opt4j.core.genotype.IntegerGenotype>
,Mutate<org.opt4j.core.genotype.IntegerGenotype>
,MutateInteger
public class MutateIntegerRandom extends java.lang.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.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Random
random
-
Constructor Summary
Constructors Constructor Description MutateIntegerRandom(org.opt4j.core.common.random.Rand random)
Constructs aMutateIntegerRandom
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
mutate(org.opt4j.core.genotype.IntegerGenotype genotype, double p)
Performs a mutation for aGenotype
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opt4j.operators.mutate.Mutate
getOperatorType
-
-
-
-
Constructor Detail
-
MutateIntegerRandom
@Inject public MutateIntegerRandom(org.opt4j.core.common.random.Rand random)
Constructs aMutateIntegerRandom
.- Parameters:
random
- the random number generator
-
-
Method Detail
-
mutate
public void mutate(org.opt4j.core.genotype.IntegerGenotype genotype, double p)
Description copied from interface:Mutate
Performs a mutation for aGenotype
.
-
-