Package org.opt4j.optimizer.ea
Class EvolutionaryAlgorithm
java.lang.Object
org.opt4j.core.optimizer.AbstractOptimizer
org.opt4j.optimizer.ea.EvolutionaryAlgorithm
- All Implemented Interfaces:
Optimizer
The
EvolutionaryAlgorithm is an implementation of an Evolutionary
Algorithm based on the operators Crossover and Mutate. It
uses a Selector for the mating and environmental selection.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected final IndividualFactoryprotected final intprotected final Matingprotected final intprotected final SelectorFields inherited from class org.opt4j.core.optimizer.AbstractOptimizer
archive, completer, control, iteration, iterationListeners, optimizing, population, stateListeners -
Constructor Summary
ConstructorsConstructorDescriptionEvolutionaryAlgorithm(Population population, Archive archive, IndividualFactory individualFactory, IndividualCompleter completer, Control control, Selector selector, Mating mating, Iteration iteration, int alpha, int mu, int lambda) Constructs anEvolutionaryAlgorithmwith aPopulation, anArchive, anIndividualFactory, aIndividualCompleter, aControl, aSelector, aMating, the number of generations, the population size, the number of parents, the number of offspring, and a random number generator. -
Method Summary
Methods inherited from class org.opt4j.core.optimizer.AbstractOptimizer
addOptimizerIterationListener, addOptimizerStateListener, getIteration, injectListeners, isRunning, nextIteration, removeOptimizerIterationListener, removeOptimizerStateListener, startOptimization, stopOptimization
-
Field Details
-
alpha
protected final int alpha -
lambda
protected final int lambda -
mu
protected final int mu -
selector
-
mating
-
individualFactory
-
-
Constructor Details
-
EvolutionaryAlgorithm
@Inject public EvolutionaryAlgorithm(Population population, Archive archive, IndividualFactory individualFactory, IndividualCompleter completer, Control control, Selector selector, Mating mating, Iteration iteration, int alpha, int mu, int lambda) Constructs anEvolutionaryAlgorithmwith aPopulation, anArchive, anIndividualFactory, aIndividualCompleter, aControl, aSelector, aMating, the number of generations, the population size, the number of parents, the number of offspring, and a random number generator.- Parameters:
population- the populationarchive- the archiveindividualFactory- the individual factorycompleter- the completercontrol- the controlselector- the selectormating- the matingiteration- the iteration counteralpha- the population sizemu- the number of parentslambda- the number of offspring
-
-
Method Details
-
optimize
Description copied from interface:OptimizerStarts the optimization process.- Throws:
TerminationException- if the optimization is terminatedStopException- if the optimization is stopped
-