S
- the class of solutions the heuristic will deal with, starting with a random solution
and execute the solution search in order to achieve a satisfying solution (defined by a stop criteria)public abstract class SimulatedAnnealing<S extends HeuristicSolution<?>> extends HeuristicAbstract<S>
The algorithm basically works as follows:
getAcceptanceProbability()
method):
if neighbor.getFitness() > current.getFitness()
then move to the new solution;if neighbor.getFitness() < current.getFitness()
then randomly decide if move to the new solution;Modifier and Type | Method and Description |
---|---|
double |
getAcceptanceProbability()
Computes the acceptance probability to define if a neighbor solution
has to be accepted or not, compared to the
Heuristic.getBestSolutionSoFar() . |
double |
getColdTemperature() |
double |
getCoolingRate() |
double |
getCurrentTemperature()
Gets the current system temperature that
represents the system state at the time
of the method call.
|
boolean |
isToStopSearch()
Checks if the solution search can be stopped.
|
void |
setColdTemperature(double coldTemperature)
Sets the temperature that defines the system is cold enough
and solution search may be stopped.
|
void |
setCoolingRate(double coolingRate)
Sets the percentage rate in which the system will be cooled, in scale from [0 to 1[.
|
protected void |
setCurrentTemperature(double currentTemperature)
Sets the current system temperature.
|
void |
updateSystemState()
Updates the state of the system in order to keep looking
for a suboptimal solution.
|
getBestSolutionSoFar, getNeighborhoodSearchesByIteration, getNeighborSolution, getRandom, getRandomValue, getSolveTime, setBestSolutionSoFar, setNeighborhoodSearchesByIteration, setNeighborSolution, setSolveTime, solve
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createNeighbor, getInitialSolution
public double getAcceptanceProbability()
Heuristic.getBestSolutionSoFar()
.
It is used the Boltzmann distribution to define the probability of a worse solution (considering its cost) to be accepted or not in order to avoid local minima. The computed Boltzmann factor also ensures that better solutions are always accepted. The Boltzmann Constant has different values depending of the used unit. In this case, it was used the natural unit of information.
current solution
,
1 is to accept the neighbor solution, while intermediate
values defines the probability that the neighbor solution
will be randomly accepted.public boolean isToStopSearch()
public void updateSystemState()
cooling rate
.updateSystemState
in class HeuristicAbstract<S extends HeuristicSolution<?>>
()
public double getCurrentTemperature()
protected void setCurrentTemperature(double currentTemperature)
currentTemperature
- the temperature to setpublic double getCoolingRate()
public void setCoolingRate(double coolingRate)
coolingRate
- the rate to setpublic double getColdTemperature()
public void setColdTemperature(double coldTemperature)
coldTemperature
- the cold temperature to setCopyright © 2015–2019 Systems, Security and Image Communication Lab - Instituto de Telecomunica����es (IT) - Universidade da Beira Interior (UBI) - Instituto Federal de Educa����o Ci��ncia e Tecnologia do Tocantins (IFTO). All rights reserved.