Package org.opt4j.optimizer.sa
Class SimulatedAnnealing
java.lang.Object
org.opt4j.core.optimizer.AbstractOptimizer
org.opt4j.optimizer.sa.SimulatedAnnealing
- All Implemented Interfaces:
Optimizer
The
SimulatedAnnealing is a standard implementation of the
optimization heuristic. This heuristic optimizes a single objective
(multi-objective problems are optimized by the sum of all objectives).-
Field Summary
FieldsFields inherited from class org.opt4j.core.optimizer.AbstractOptimizer
archive, completer, control, iteration, iterationListeners, optimizing, population, stateListeners -
Constructor Summary
ConstructorsConstructorDescriptionSimulatedAnnealing(Population population, Archive archive, IndividualFactory individualFactory, IndividualCompleter completer, Control control, Rand random, Neighbor<Genotype> neighbor, Copy<Genotype> copy, Iteration iteration, CoolingSchedule coolingSchedule) Constructs a newSimulatedAnnealing. -
Method Summary
Modifier and TypeMethodDescriptionprotected doublef(Individual individual) Calculates the sum of theObjectivesof oneIndividual.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 Details
-
random
-
neighbor
-
copy
-
coolingSchedule
-
-
Constructor Details
-
SimulatedAnnealing
@Inject public SimulatedAnnealing(Population population, Archive archive, IndividualFactory individualFactory, IndividualCompleter completer, Control control, Rand random, Neighbor<Genotype> neighbor, Copy<Genotype> copy, Iteration iteration, CoolingSchedule coolingSchedule) Constructs a newSimulatedAnnealing.- Parameters:
population- the populationarchive- the archiveindividualFactory- the individual factorycompleter- the completercontrol- the controlrandom- the random number generatorneighbor- the neighbor operatorcopy- the copy operatoriteration- the iteration countercoolingSchedule- the cooling schedule
-
-
Method Details
-
optimize
Description copied from interface:OptimizerStarts the optimization process.- Throws:
TerminationException- if the optimization is terminatedStopException- if the optimization is stopped
-
f
Calculates the sum of theObjectivesof oneIndividual.- Parameters:
individual- the individual- Returns:
- the sum of the objective values
-