public class SimulatedAnnealing
extends java.lang.Object
implements org.opt4j.core.optimizer.IterativeOptimizer
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).Modifier and Type | Field and 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 and 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 new
SimulatedAnnealing . |
Modifier and Type | Method and Description |
---|---|
protected double |
f(org.opt4j.core.Individual individual)
Calculates the sum of the
Objectives of one Individual . |
void |
initialize() |
void |
next() |
protected final java.util.Random random
protected final org.opt4j.operators.neighbor.Neighbor<org.opt4j.core.Genotype> neighbor
protected final org.opt4j.operators.copy.Copy<org.opt4j.core.Genotype> copy
protected final CoolingSchedule coolingSchedule
@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)
SimulatedAnnealing
.population
- the populationindividualFactory
- the individual factorycompleter
- the completerrandom
- the random number generatorneighbor
- the neighbor operatorcopy
- the copy operatoriteration
- the iteration countercoolingSchedule
- the cooling schedulepublic void initialize() throws org.opt4j.core.optimizer.TerminationException
initialize
in interface org.opt4j.core.optimizer.IterativeOptimizer
org.opt4j.core.optimizer.TerminationException
public void next() throws org.opt4j.core.optimizer.TerminationException
next
in interface org.opt4j.core.optimizer.IterativeOptimizer
org.opt4j.core.optimizer.TerminationException
protected double f(org.opt4j.core.Individual individual)
Objectives
of one Individual
.individual
- the individual