Package org.opt4j.optimizers.sa
Class SimulatedAnnealing
- java.lang.Object
-
- org.opt4j.optimizers.sa.SimulatedAnnealing
-
- All Implemented Interfaces:
org.opt4j.core.optimizer.IterativeOptimizer
public class SimulatedAnnealing extends java.lang.Object implements org.opt4j.core.optimizer.IterativeOptimizer
TheSimulatedAnnealing
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 Modifier and Type Field Description protected CoolingSchedule
coolingSchedule
protected org.opt4j.operators.copy.Copy<org.opt4j.core.Genotype>
copy
protected org.opt4j.operators.neighbor.Neighbor<org.opt4j.core.Genotype>
neighbor
protected java.util.Random
random
-
Constructor Summary
Constructors Constructor Description SimulatedAnnealing(org.opt4j.core.optimizer.Population population, org.opt4j.core.optimizer.Archive archive, org.opt4j.core.IndividualFactory individualFactory, org.opt4j.core.optimizer.IndividualCompleter completer, org.opt4j.core.common.random.Rand random, org.opt4j.operators.neighbor.Neighbor<org.opt4j.core.Genotype> neighbor, org.opt4j.operators.copy.Copy<org.opt4j.core.Genotype> copy, CoolingSchedule coolingSchedule, org.opt4j.core.optimizer.Iteration iteration)
Constructs a newSimulatedAnnealing
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
f(org.opt4j.core.Individual individual)
Calculates the sum of theObjectives
of oneIndividual
.void
initialize()
void
next()
-
-
-
Field Detail
-
random
protected final java.util.Random random
-
neighbor
protected final org.opt4j.operators.neighbor.Neighbor<org.opt4j.core.Genotype> neighbor
-
copy
protected final org.opt4j.operators.copy.Copy<org.opt4j.core.Genotype> copy
-
coolingSchedule
protected final CoolingSchedule coolingSchedule
-
-
Constructor Detail
-
SimulatedAnnealing
@Inject public SimulatedAnnealing(org.opt4j.core.optimizer.Population population, org.opt4j.core.optimizer.Archive archive, org.opt4j.core.IndividualFactory individualFactory, org.opt4j.core.optimizer.IndividualCompleter completer, org.opt4j.core.common.random.Rand random, org.opt4j.operators.neighbor.Neighbor<org.opt4j.core.Genotype> neighbor, org.opt4j.operators.copy.Copy<org.opt4j.core.Genotype> copy, CoolingSchedule coolingSchedule, org.opt4j.core.optimizer.Iteration iteration)
Constructs a newSimulatedAnnealing
.- Parameters:
population
- the populationindividualFactory
- the individual factorycompleter
- the completerrandom
- the random number generatorneighbor
- the neighbor operatorcopy
- the copy operatoriteration
- the iteration countercoolingSchedule
- the cooling schedule
-
-
Method Detail
-
initialize
public void initialize() throws org.opt4j.core.optimizer.TerminationException
- Specified by:
initialize
in interfaceorg.opt4j.core.optimizer.IterativeOptimizer
- Throws:
org.opt4j.core.optimizer.TerminationException
-
next
public void next() throws org.opt4j.core.optimizer.TerminationException
- Specified by:
next
in interfaceorg.opt4j.core.optimizer.IterativeOptimizer
- Throws:
org.opt4j.core.optimizer.TerminationException
-
f
protected double f(org.opt4j.core.Individual individual)
Calculates the sum of theObjectives
of oneIndividual
.- Parameters:
individual
- the individual- Returns:
- the sum of the objective values
-
-