Package org.opt4j.optimizer.sa
Class SimulatedAnnealing
- java.lang.Object
-
- org.opt4j.core.optimizer.AbstractOptimizer
-
- org.opt4j.optimizer.sa.SimulatedAnnealing
-
- All Implemented Interfaces:
Optimizer
public class SimulatedAnnealing extends AbstractOptimizer
TheSimulatedAnnealingis 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 Modifier and Type Field Description protected CoolingSchedulecoolingScheduleprotected Copy<Genotype>copyprotected Neighbor<Genotype>neighborprotected Randomrandom-
Fields inherited from class org.opt4j.core.optimizer.AbstractOptimizer
archive, completer, control, iteration, iterationListeners, optimizing, population, stateListeners
-
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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
-
-
-
-
Constructor Detail
-
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 Detail
-
optimize
public void optimize() throws TerminationException, StopExceptionDescription copied from interface:OptimizerStarts the optimization process.- Throws:
TerminationException- if the optimization is terminatedStopException- if the optimization is stopped
-
f
protected double f(Individual individual)
Calculates the sum of theObjectivesof oneIndividual.- Parameters:
individual- the individual- Returns:
- the sum of the objective values
-
-