Package org.opt4j.optimizer.de
Class DifferentialEvolution
java.lang.Object
org.opt4j.core.optimizer.AbstractOptimizer
org.opt4j.optimizer.de.DifferentialEvolution
- All Implemented Interfaces:
Optimizer
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
TheDifferentialEvolution.Triple
is a container for three individuals. -
Field Summary
Modifier and TypeFieldDescriptionprotected final int
protected final Random
protected final double
protected final Selector
Fields inherited from class org.opt4j.core.optimizer.AbstractOptimizer
archive, completer, control, iteration, iterationListeners, optimizing, population, stateListeners
-
Constructor Summary
ConstructorDescriptionDifferentialEvolution
(Population population, Archive archive, IndividualFactory individualFactory, IndividualCompleter completer, Control control, Algebra<Genotype> algebra, Selector selector, Rand random, Crossover<Genotype> crossover, Iteration iteration, int alpha, double scalingFactor) Constructs aDifferentialEvolution
. -
Method Summary
Modifier and TypeMethodDescriptionprotected Individual
createOffspring
(Individual parent, List<Individual> individuals, Term term) protected DifferentialEvolution.Triple
getTriple
(Individual parent, List<Individual> individuals) Returns three differentIndividual
s from theindividuals
list.void
optimize()
Starts the optimization process.Methods inherited from class org.opt4j.core.optimizer.AbstractOptimizer
addOptimizerIterationListener, addOptimizerStateListener, getIteration, injectListeners, isRunning, nextIteration, removeOptimizerIterationListener, removeOptimizerStateListener, startOptimization, stopOptimization
-
Field Details
-
scalingFactor
protected final double scalingFactor -
alpha
protected final int alpha -
algebra
-
crossover
-
selector
-
random
-
-
Constructor Details
-
DifferentialEvolution
@Inject public DifferentialEvolution(Population population, Archive archive, IndividualFactory individualFactory, IndividualCompleter completer, Control control, Algebra<Genotype> algebra, Selector selector, Rand random, Crossover<Genotype> crossover, Iteration iteration, int alpha, double scalingFactor) Constructs aDifferentialEvolution
.- Parameters:
population
- the populationarchive
- the archiveindividualFactory
- the individual factorycompleter
- the completercontrol
- the controlalgebra
- the algebra operatorselector
- the selectorrandom
- the random number generatorcrossover
- the crossover operatoriteration
- the iteration counteralpha
- the population sizescalingFactor
- the scaling factor F
-
-
Method Details
-
optimize
Description copied from interface:Optimizer
Starts the optimization process.- Throws:
StopException
- if the optimization is stoppedTerminationException
- if the optimization is terminated
-
createOffspring
-
getTriple
Returns three differentIndividual
s from theindividuals
list. EachIndividual
is not equal to the parent.- Parameters:
parent
- the parent Individualindividuals
- the population- Returns:
- the three individuals as a Triple
-