Class 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
    The MutateIntegerRandom mutates each element of the IntegerGenotype 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  
    • 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 a Genotype.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • random

        protected final java.util.Random random
    • Constructor Detail

      • MutateIntegerRandom

        @Inject
        public MutateIntegerRandom​(org.opt4j.core.common.random.Rand random)
        Constructs a MutateIntegerRandom.
        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 a Genotype.
        Specified by:
        mutate in interface Mutate<org.opt4j.core.genotype.IntegerGenotype>
        Parameters:
        genotype - the genotype to be mutated
        p - the mutation rate