Class AdaptiveMutationRate

java.lang.Object
org.opt4j.operator.mutate.AdaptiveMutationRate
All Implemented Interfaces:
IndividualStateListener, MutationRate

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

    • isInit

      protected boolean isInit
    • rate

      protected double rate
    • individualFactory

      protected final IndividualFactory individualFactory
  • Constructor Details

    • AdaptiveMutationRate

      @Inject public AdaptiveMutationRate(IndividualFactory individualFactory)
      Constructs an AdaptiveMutationRate.
      Parameters:
      individualFactory - the individual creator
  • Method Details

    • 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(Individual individual)
      Description copied from interface: IndividualStateListener
      Invoked if the Individual changes its state.
      Specified by:
      inidividualStateChanged in interface IndividualStateListener
      Parameters:
      individual - the individual that changes the state