Package org.opt4j.optimizer.ea
Class EvolutionaryAlgorithm
- java.lang.Object
-
- org.opt4j.core.optimizer.AbstractOptimizer
-
- org.opt4j.optimizer.ea.EvolutionaryAlgorithm
-
- All Implemented Interfaces:
Optimizer
public class EvolutionaryAlgorithm extends AbstractOptimizer
TheEvolutionaryAlgorithmis an implementation of an Evolutionary Algorithm based on the operatorsCrossoverandMutate. It uses aSelectorfor the mating and environmental selection.
-
-
Field Summary
Fields Modifier and Type Field Description protected intalphaprotected IndividualFactoryindividualFactoryprotected intlambdaprotected Matingmatingprotected intmuprotected Selectorselector-
Fields inherited from class org.opt4j.core.optimizer.AbstractOptimizer
archive, completer, control, iteration, iterationListeners, optimizing, population, stateListeners
-
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidoptimize()Starts the optimization process.-
Methods inherited from class org.opt4j.core.optimizer.AbstractOptimizer
addOptimizerIterationListener, addOptimizerStateListener, getIteration, injectListeners, isRunning, nextIteration, removeOptimizerIterationListener, removeOptimizerStateListener, startOptimization, stopOptimization
-
-
-
-
Field Detail
-
alpha
protected final int alpha
-
lambda
protected final int lambda
-
mu
protected final int mu
-
selector
protected final Selector selector
-
mating
protected final Mating mating
-
individualFactory
protected final IndividualFactory individualFactory
-
-
Constructor Detail
-
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 Detail
-
optimize
public void optimize() throws TerminationException, StopExceptionDescription copied from interface:OptimizerStarts the optimization process.- Throws:
TerminationException- if the optimization is terminatedStopException- if the optimization is stopped
-
-