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
Fields inherited from class org.opt4j.core.optimizer.AbstractOptimizer
archive, completer, control, iteration, iterationListeners, optimizing, population, stateListeners
-
Constructor Summary
ConstructorDescriptionSimulatedAnnealing
(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 double
f
(Individual individual) Calculates the sum of theObjectives
of oneIndividual
.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
-
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:Optimizer
Starts the optimization process.- Throws:
TerminationException
- if the optimization is terminatedStopException
- if the optimization is stopped
-
f
Calculates the sum of theObjectives
of oneIndividual
.- Parameters:
individual
- the individual- Returns:
- the sum of the objective values
-