public class SimulatedAnnealing<V extends Variable<V,T>,T extends Value<V,T>> extends NeighbourSearch<V,T>
SimulatedAnnealing.SimulatedAnnealingContext.prob(double). The search is guided by the temperature, which starts at SimulatedAnnealing.InitialTemperature. After each SimulatedAnnealing.TemperatureLength iterations, the temperature is reduced by SimulatedAnnealing.CoolingRate. If there was no improvement in the past SimulatedAnnealing.ReheatLengthCoef * SimulatedAnnealing.TemperatureLength iterations, the temperature is increased by SimulatedAnnealing.ReheatRate. If there was no improvement in the past SimulatedAnnealing.RestoreBestLengthCoef * SimulatedAnnealing.TemperatureLength iterations, the best ever found solution is restored.
1.0 / (1.0 + Math.exp(value/temperature)), otherwise it is cumputed using simlated annealing criterion, i.e.,
(value<=0.0?1.0:Math.exp(-value/temperature)). If SimulatedAnnealing.RelativeAcceptance neighbour value
Neighbour.value(Assignment)is taken as the value of the selected neighbour (difference between the new and the current solution, if the neighbour is accepted), otherwise the value is computed as the difference between the value of the current solution if the neighbour is accepted and the best ever found solution.
NeighbourSelection. By default, each neighbour selection is selected with the same probability (each has 1 point in a roulette wheel selection). It can be changed by adding @n at the end of the name of the class, for example:
Selector RandomSwapMove is 10× less probable to be selected than other selectors. When SimulatedAnnealing.Random is true, all selectors are selected with the same probability, ignoring these weights.
NeighbourSelector.update(Assignment, Neighbour, long)is called after each iteration (on the selector that was used) and roulette wheel selection that is using
NeighbourSelector.getPoints()is used to pick a selector in each iteration. See
NeighbourSelectorfor more details.
|Modifier and Type||Class and Description|
|Constructor and Description|
|Modifier and Type||Method and Description|
Create a new assignment context for the given assignment.
Parameter base name.
accept, accept, addNeighbourSelection, bestCleared, bestRestored, bestSaved, generateMove, getInfo, getInfo, getNeighbours, info, init, isMaster, logNeibourStatus, nextNeighbourSelection, selectNeighbour, setHCMode, setProgress, setProgressPhase, solutionUpdated
getAssignmentContextReference, getContext, getContext, hasContextOverride, isSingleContextSolver, setAssignmentContextReference
public SimulatedAnnealing(DataProperties properties)
NeighbourSelector.getPoints()weights (roulette wheel selection)
properties- problem properties
public String getParameterBaseName()
public NeighbourSearch.NeighbourSearchContext createAssignmentContext(Assignment<V,T> assignment)
assignment- an assignment for which there needs to be an assignment context