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
Modifier and TypeFieldDescriptionprotected final int
protected final IndividualFactory
protected final int
protected final Mating
protected final int
protected final Selector
Fields inherited from class org.opt4j.core.optimizer.AbstractOptimizer
archive, completer, control, iteration, iterationListeners, optimizing, population, stateListeners
-
Constructor Summary
ConstructorDescriptionEvolutionaryAlgorithm
(Population population, Archive archive, IndividualFactory individualFactory, IndividualCompleter completer, Control control, Selector selector, Mating mating, Iteration iteration, int alpha, int mu, int lambda) Constructs anEvolutionaryAlgorithm
with 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 anEvolutionaryAlgorithm
with 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:Optimizer
Starts the optimization process.- Throws:
TerminationException
- if the optimization is terminatedStopException
- if the optimization is stopped
-