Anneal
-
class Anneal : public minim::NewMinimiser<Anneal>
Simulated annealing minimisation.
Randomly perturbs the state each iteration, accepting or rejecting moves by the Metropolis criterion at the current temperature. The temperature decreases over the minimisation, by a cooling rate or a custom schedule, so that increasingly only downhill moves are taken.
Useful for finding global minma unlike other minimiser which typically look for local minima.
Public Functions
-
inline Anneal(double tempInit, double displacement)
Construct with an initial temperature and displacement.
-
Anneal &setCoolingRate(double coolingRate)
Set the factor by which the temperature decreases each iteration.
-
Anneal &setCoolingSchedule(std::function<double(int)> coolingSchedule)
Set a custom cooling schedule as a function of the iteration number.
Public Members
-
double displacement
The displacement used for random moves.
-
double tempInit
The initial temperature.
-
double coolingRate = 1
The factor by which the temperature decreases each iteration.
-
std::function<double(int)> coolingSchedule = nullptr
A custom cooling schedule, as a function of the iteration number.
-
int maxRejections = 0
Maximum number of consecutive rejected moves before terminating (0: disabled).
-
inline Anneal(double tempInit, double displacement)