public class EvolutionaryAlgorithm
extends java.lang.Object
implements org.opt4j.core.optimizer.IterativeOptimizer
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.Modifier and Type | Field and Description |
---|---|
protected int |
alpha |
protected int |
lambda |
protected Mating |
mating |
protected int |
mu |
protected Selector |
selector |
Constructor and Description |
---|
EvolutionaryAlgorithm(org.opt4j.core.optimizer.Population population,
org.opt4j.core.IndividualFactory individualFactory,
org.opt4j.core.optimizer.IndividualCompleter completer,
Selector selector,
Mating mating,
int alpha,
int mu,
int lambda)
Constructs an
EvolutionaryAlgorithm with a Population , an
IndividualFactory , a IndividualCompleter , a
Selector , a Mating , the number of generations, the
population size, the number of parents, the number of offspring, and a
random number generator. |
Modifier and Type | Method and Description |
---|---|
void |
initialize() |
void |
next() |
protected final int alpha
protected final int lambda
protected final int mu
protected final Selector selector
protected final Mating mating
@Inject public EvolutionaryAlgorithm(org.opt4j.core.optimizer.Population population, org.opt4j.core.IndividualFactory individualFactory, org.opt4j.core.optimizer.IndividualCompleter completer, Selector selector, Mating mating, int alpha, int mu, int lambda)
EvolutionaryAlgorithm
with a Population
, an
IndividualFactory
, a IndividualCompleter
, a
Selector
, a Mating
, the number of generations, the
population size, the number of parents, the number of offspring, and a
random number generator.population
- the populationindividualFactory
- the individual factorycompleter
- the completerselector
- the selectormating
- the matingalpha
- the population sizemu
- the number of parentslambda
- the number of offspringpublic void initialize()
initialize
in interface org.opt4j.core.optimizer.IterativeOptimizer
public void next() throws org.opt4j.core.optimizer.TerminationException
next
in interface org.opt4j.core.optimizer.IterativeOptimizer
org.opt4j.core.optimizer.TerminationException