Class AdaptiveMutationRate

  • All Implemented Interfaces:
    org.opt4j.core.IndividualStateListener, MutationRate

    public class AdaptiveMutationRate
    extends java.lang.Object
    implements MutationRate, org.opt4j.core.IndividualStateListener
    Self adaptive MutationRate that uses the size of the genotype ( size) to estimate a rate. The calculated rate is 1/size.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.opt4j.core.IndividualFactory individualFactory  
      protected boolean isInit  
      protected double rate  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double get()
      Returns the mutation rate as a double value.
      void inidividualStateChanged​(org.opt4j.core.Individual individual)  
      void init()
      Initializes the listeners.
      void set​(double value)
      Sets the mutation to a double value.
      • Methods inherited from class java.lang.Object

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

      • isInit

        protected boolean isInit
      • rate

        protected double rate
      • individualFactory

        protected final org.opt4j.core.IndividualFactory individualFactory
    • Constructor Detail

      • AdaptiveMutationRate

        @Inject
        public AdaptiveMutationRate​(org.opt4j.core.IndividualFactory individualFactory)
        Constructs an AdaptiveMutationRate.
        Parameters:
        individualFactory - the individual creator
    • Method Detail

      • init

        @Inject
        public void init()
        Initializes the listeners.
      • get

        public double get()
        Description copied from interface: MutationRate
        Returns the mutation rate as a double value.
        Specified by:
        get in interface MutationRate
        Returns:
        the mutation rate
      • set

        public void set​(double value)
        Description copied from interface: MutationRate
        Sets the mutation to a double value.
        Specified by:
        set in interface MutationRate
        Parameters:
        value - the new muation rate
      • inidividualStateChanged

        public void inidividualStateChanged​(org.opt4j.core.Individual individual)
        Specified by:
        inidividualStateChanged in interface org.opt4j.core.IndividualStateListener