public class EvolutionaryAlgorithmModule
extends org.opt4j.core.optimizer.OptimizerModule
EvolutionaryAlgorithmModule
configures the
EvolutionaryAlgorithm
.Modifier and Type | Class and Description |
---|---|
static class |
EvolutionaryAlgorithmModule.CrossoverRateType
The
EvolutionaryAlgorithmModule.CrossoverRateType allows to choose between different types of
crossover rates. |
Modifier and Type | Field and Description |
---|---|
protected double |
crossoverRate |
protected EvolutionaryAlgorithmModule.CrossoverRateType |
crossoverRateType |
protected int |
generations |
protected int |
offspringsPerGeneration |
protected int |
parentsPerGeneration |
protected int |
populationSize |
Constructor and Description |
---|
EvolutionaryAlgorithmModule() |
Modifier and Type | Method and Description |
---|---|
void |
config() |
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 |
getOffspringsPerGeneration()
Returns the number of children
lambda . |
int |
getParentsPerGeneration()
Returns the number of parents
mu . |
int |
getPopulationSize()
Returns the population size
alpha . |
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 |
setOffspringsPerGeneration(int lambda)
Sets the number of children
lambda . |
void |
setParentsPerGeneration(int mu)
Sets the number of parents
mu . |
void |
setPopulationSize(int alpha)
Sets the population size
alpha . |
bindIterativeOptimizer, bindOptimizer
addControlListener, addIndividualStateListener, addOptimizerIterationListener, addOptimizerStateListener, bindConstant, bindConstant, bindConstant, bindConstant, configure, constant, multi
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
protected int generations
protected int populationSize
protected int parentsPerGeneration
protected int offspringsPerGeneration
protected double crossoverRate
protected EvolutionaryAlgorithmModule.CrossoverRateType crossoverRateType
public int getPopulationSize()
alpha
.public void setPopulationSize(int alpha)
alpha
.alpha
- the population size to setpublic int getGenerations()
public void setGenerations(int generations)
generations
- the number of generationsgetGenerations()
public int getOffspringsPerGeneration()
lambda
.public void setOffspringsPerGeneration(int lambda)
lambda
.lambda
- the number of childrenpublic int getParentsPerGeneration()
mu
.public void setParentsPerGeneration(int mu)
mu
.mu
- the number of parentspublic EvolutionaryAlgorithmModule.CrossoverRateType getCrossoverRateType()
public void setCrossoverRateType(EvolutionaryAlgorithmModule.CrossoverRateType crossoverRateType)
crossoverRateType
- the crossoverRateType to setpublic double getCrossoverRate()
public void setCrossoverRate(double crossoverRate)
crossoverRate
- the crossoverRate to setpublic void config()
config
in class org.opt4j.core.start.Opt4JModule