Package org.opt4j.optimizer.de
Class DifferentialEvolution
- java.lang.Object
-
- org.opt4j.core.optimizer.AbstractOptimizer
-
- org.opt4j.optimizer.de.DifferentialEvolution
-
- All Implemented Interfaces:
Optimizer
public class DifferentialEvolution extends AbstractOptimizer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
DifferentialEvolution.Triple
TheDifferentialEvolution.Triple
is a container for three individuals.
-
Field Summary
Fields Modifier and Type Field Description protected Algebra<Genotype>
algebra
protected int
alpha
protected Crossover<Genotype>
crossover
protected Random
random
protected double
scalingFactor
protected Selector
selector
-
Fields inherited from class org.opt4j.core.optimizer.AbstractOptimizer
archive, completer, control, iteration, iterationListeners, optimizing, population, stateListeners
-
-
Constructor Summary
Constructors Constructor Description 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
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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
-
-
-
-
Constructor Detail
-
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 Detail
-
optimize
public void optimize() throws StopException, TerminationException
Description copied from interface:Optimizer
Starts the optimization process.- Throws:
StopException
- if the optimization is stoppedTerminationException
- if the optimization is terminated
-
createOffspring
protected Individual createOffspring(Individual parent, List<Individual> individuals, Term term)
-
getTriple
protected DifferentialEvolution.Triple getTriple(Individual parent, List<Individual> individuals)
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
-
-