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 classDifferentialEvolution.TripleTheDifferentialEvolution.Tripleis a container for three individuals.
-
Field Summary
Fields Modifier and Type Field Description protected Algebra<Genotype>algebraprotected intalphaprotected Crossover<Genotype>crossoverprotected Randomrandomprotected doublescalingFactorprotected Selectorselector-
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 IndividualcreateOffspring(Individual parent, List<Individual> individuals, Term term)protected DifferentialEvolution.TriplegetTriple(Individual parent, List<Individual> individuals)Returns three differentIndividuals from theindividualslist.voidoptimize()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, TerminationExceptionDescription copied from interface:OptimizerStarts 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 differentIndividuals from theindividualslist. EachIndividualis not equal to the parent.- Parameters:
parent- the parent Individualindividuals- the population- Returns:
- the three individuals as a Triple
-
-