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
public class EvolutionaryAlgorithmModule extends OptimizerModule
TheEvolutionaryAlgorithmModule
configures theEvolutionaryAlgorithm
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EvolutionaryAlgorithmModule.CrossoverRateType
TheEvolutionaryAlgorithmModule.CrossoverRateType
allows to choose between different types of crossover rates.
-
Field Summary
Fields Modifier and Type Field Description protected int
alpha
protected double
crossoverRate
protected EvolutionaryAlgorithmModule.CrossoverRateType
crossoverRateType
protected int
generations
protected int
lambda
protected int
mu
-
Fields inherited from class org.opt4j.start.Opt4JModule
SINGLETON
-
-
Constructor Summary
Constructors Constructor Description EvolutionaryAlgorithmModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
config()
Configure the module.int
getAlpha()
Returns the population sizealpha
.double
getCrossoverRate()
Returns the used crossover rate.EvolutionaryAlgorithmModule.CrossoverRateType
getCrossoverRateType()
Returns the type of crossover rate that is used.int
getGenerations()
Returns the number of generations.int
getLambda()
Returns the number of childrenlambda
.int
getMu()
Returns the number of parentsmu
.void
setAlpha(int alpha)
Sets the population sizealpha
.void
setCrossoverRate(double crossoverRate)
Sets the crossover rate.void
setCrossoverRateType(EvolutionaryAlgorithmModule.CrossoverRateType crossoverRateType)
Sets the type of crossover rate to use.void
setGenerations(int generations)
Sets the number of generations.void
setLambda(int lambda)
Sets the number of childrenlambda
.void
setMu(int mu)
Sets the number of parentsmu
.-
Methods inherited from class org.opt4j.core.optimizer.OptimizerModule
bindOptimizer
-
Methods inherited from class org.opt4j.start.Opt4JModule
addControlListener, addIndividualStateListener, addOptimizerIterationListener, addOptimizerStateListener, bindConstant, bindConstant, bindConstant, bindConstant, configure, constant, multi
-
Methods 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 Detail
-
generations
protected int generations
-
alpha
protected int alpha
-
mu
protected int mu
-
lambda
protected int lambda
-
crossoverRate
protected double crossoverRate
-
crossoverRateType
protected EvolutionaryAlgorithmModule.CrossoverRateType crossoverRateType
-
-
Method Detail
-
getAlpha
public int getAlpha()
Returns the population sizealpha
.- Returns:
- the population size
- See Also:
setAlpha(int)
-
setAlpha
public void setAlpha(int alpha)
Sets the population sizealpha
.- Parameters:
alpha
- the population size to set- See Also:
getAlpha()
-
getGenerations
public int getGenerations()
Returns the number of generations.- Returns:
- the number of generations
- See Also:
setGenerations(int)
-
setGenerations
public void setGenerations(int generations)
Sets the number of generations.- Parameters:
generations
- the number of generations- See Also:
getGenerations()
-
getLambda
public int getLambda()
Returns the number of childrenlambda
.- Returns:
- the number of children
- See Also:
setLambda(int)
-
setLambda
public void setLambda(int lambda)
Sets the number of childrenlambda
.- Parameters:
lambda
- the number of children- See Also:
getLambda()
-
getMu
public int getMu()
Returns the number of parentsmu
.- Returns:
- the number of parents
- See Also:
setMu(int)
-
setMu
public void setMu(int mu)
Sets the number of parentsmu
.- Parameters:
mu
- the number of parents- See Also:
getMu()
-
getCrossoverRateType
public EvolutionaryAlgorithmModule.CrossoverRateType getCrossoverRateType()
Returns the type of crossover rate that is used.- Returns:
- the crossoverRateType
- See Also:
setCrossoverRateType(org.opt4j.optimizer.ea.EvolutionaryAlgorithmModule.CrossoverRateType)
-
setCrossoverRateType
public void setCrossoverRateType(EvolutionaryAlgorithmModule.CrossoverRateType crossoverRateType)
Sets the type of crossover rate to use.- Parameters:
crossoverRateType
- the crossoverRateType to set- See Also:
getCrossoverRateType()
-
getCrossoverRate
public double getCrossoverRate()
Returns the used crossover rate.- Returns:
- the crossoverRate
- See Also:
setCrossoverRate(double)
-
setCrossoverRate
public void setCrossoverRate(double crossoverRate)
Sets the crossover rate.- Parameters:
crossoverRate
- the crossoverRate to set- See Also:
getCrossoverRate()
-
config
public void config()
Description copied from class:Opt4JModule
Configure the module. Bind constants, listeners, and bind arbitrary classes.- Specified by:
config
in classOpt4JModule
- See Also:
Binder
-
-