Package org.opt4j.optimizer.ea
Class EvolutionaryAlgorithmModule
java.lang.Object
com.google.inject.AbstractModule
org.opt4j.start.Opt4JModule
org.opt4j.core.optimizer.OptimizerModule
org.opt4j.optimizer.ea.EvolutionaryAlgorithmModule
- All Implemented Interfaces:
com.google.inject.Module
The
EvolutionaryAlgorithmModule configures the
EvolutionaryAlgorithm.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumTheEvolutionaryAlgorithmModule.CrossoverRateTypeallows to choose between different types of crossover rates. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected doubleprotected intprotected intprotected intFields inherited from class org.opt4j.start.Opt4JModule
SINGLETON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfig()Configure the module.intgetAlpha()Returns the population sizealpha.doubleReturns the used crossover rate.Returns the type of crossover rate that is used.intReturns the number of generations.intReturns the number of childrenlambda.intgetMu()Returns the number of parentsmu.voidsetAlpha(int alpha) Sets the population sizealpha.voidsetCrossoverRate(double crossoverRate) Sets the crossover rate.voidsetCrossoverRateType(EvolutionaryAlgorithmModule.CrossoverRateType crossoverRateType) Sets the type of crossover rate to use.voidsetGenerations(int generations) Sets the number of generations.voidsetLambda(int lambda) Sets the number of childrenlambda.voidsetMu(int mu) Sets the number of parentsmu.Methods inherited from class org.opt4j.core.optimizer.OptimizerModule
bindOptimizerMethods inherited from class org.opt4j.start.Opt4JModule
addControlListener, addIndividualStateListener, addOptimizerIterationListener, addOptimizerStateListener, bindConstant, bindConstant, bindConstant, bindConstant, configure, constant, multiMethods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
Field Details
-
generations
protected int generations -
alpha
protected int alpha -
mu
protected int mu -
lambda
protected int lambda -
crossoverRate
protected double crossoverRate -
crossoverRateType
-
-
Constructor Details
-
EvolutionaryAlgorithmModule
public EvolutionaryAlgorithmModule()
-
-
Method Details
-
getAlpha
public int getAlpha()Returns the population sizealpha.- Returns:
- the population size
- See Also:
-
setAlpha
public void setAlpha(int alpha) Sets the population sizealpha.- Parameters:
alpha- the population size to set- See Also:
-
getGenerations
public int getGenerations()Returns the number of generations.- Returns:
- the number of generations
- See Also:
-
setGenerations
public void setGenerations(int generations) Sets the number of generations.- Parameters:
generations- the number of generations- See Also:
-
getLambda
public int getLambda()Returns the number of childrenlambda.- Returns:
- the number of children
- See Also:
-
setLambda
public void setLambda(int lambda) Sets the number of childrenlambda.- Parameters:
lambda- the number of children- See Also:
-
getMu
public int getMu()Returns the number of parentsmu.- Returns:
- the number of parents
- See Also:
-
setMu
public void setMu(int mu) Sets the number of parentsmu.- Parameters:
mu- the number of parents- See Also:
-
getCrossoverRateType
Returns the type of crossover rate that is used.- Returns:
- the crossoverRateType
- See Also:
-
setCrossoverRateType
Sets the type of crossover rate to use.- Parameters:
crossoverRateType- the crossoverRateType to set- See Also:
-
getCrossoverRate
public double getCrossoverRate()Returns the used crossover rate.- Returns:
- the crossoverRate
- See Also:
-
setCrossoverRate
public void setCrossoverRate(double crossoverRate) Sets the crossover rate.- Parameters:
crossoverRate- the crossoverRate to set- See Also:
-
config
public void config()Description copied from class:Opt4JModuleConfigure the module. Bind constants, listeners, and bind arbitrary classes.- Specified by:
configin classOpt4JModule- See Also:
-
Binder
-