Package org.opt4j.operator.mutate
Class AdaptiveMutationRate
java.lang.Object
org.opt4j.operator.mutate.AdaptiveMutationRate
- All Implemented Interfaces:
IndividualStateListener,MutationRate
Self adaptive
MutationRate that uses the size of the genotype (
size) to estimate a rate. The calculated rate is 1/size.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final IndividualFactoryprotected booleanprotected double -
Constructor Summary
ConstructorsConstructorDescriptionAdaptiveMutationRate(IndividualFactory individualFactory) Constructs anAdaptiveMutationRate. -
Method Summary
Modifier and TypeMethodDescriptiondoubleget()Returns the mutation rate as a double value.voidinidividualStateChanged(Individual individual) Invoked if theIndividualchanges its state.voidinit()Initializes the listeners.voidset(double value) Sets the mutation to a double value.
-
Field Details
-
isInit
protected boolean isInit -
rate
protected double rate -
individualFactory
-
-
Constructor Details
-
AdaptiveMutationRate
Constructs anAdaptiveMutationRate.- Parameters:
individualFactory- the individual creator
-
-
Method Details
-
init
@Inject public void init()Initializes the listeners. -
get
public double get()Description copied from interface:MutationRateReturns the mutation rate as a double value.- Specified by:
getin interfaceMutationRate- Returns:
- the mutation rate
-
set
public void set(double value) Description copied from interface:MutationRateSets the mutation to a double value.- Specified by:
setin interfaceMutationRate- Parameters:
value- the new muation rate
-
inidividualStateChanged
Description copied from interface:IndividualStateListenerInvoked if theIndividualchanges its state.- Specified by:
inidividualStateChangedin interfaceIndividualStateListener- Parameters:
individual- the individual that changes the state
-