QuantLib: a free/open-source library for quantitative finance
Reference manual - version 1.40
Loading...
Searching...
No Matches
SimulatedAnnealing< RNG > Class Template Reference

Simulated Annealing. More...

#include <ql/math/optimization/simulatedannealing.hpp>

Inheritance diagram for SimulatedAnnealing< RNG >:

Public Types

enum  Scheme { ConstantFactor , ConstantBudget }

Public Member Functions

 SimulatedAnnealing (const Real lambda, const Real T0, const Real epsilon, const Size m, const RNG &rng=RNG())
 SimulatedAnnealing (const Real lambda, const Real T0, const Size K, const Real alpha, const RNG &rng=RNG())
EndCriteria::Type minimize (Problem &P, const EndCriteria &ec) override
 minimize the optimization problem P

Detailed Description

template<class RNG = MersenneTwisterUniformRng>
class QuantLib::SimulatedAnnealing< RNG >

Simulated Annealing.

Class RNG must implement the following interface:

RNG::sample_type RNG::next() const;
Examples
GlobalOptimizer.cpp.

Constructor & Destructor Documentation

◆ SimulatedAnnealing() [1/2]

template<class RNG = MersenneTwisterUniformRng>
SimulatedAnnealing ( const Real lambda,
const Real T0,
const Real epsilon,
const Size m,
const RNG & rng = RNG() )

reduce temperature T by a factor of \( (1-\epsilon) \) after m moves

◆ SimulatedAnnealing() [2/2]

template<class RNG = MersenneTwisterUniformRng>
SimulatedAnnealing ( const Real lambda,
const Real T0,
const Size K,
const Real alpha,
const RNG & rng = RNG() )

budget a total of K moves, set temperature T to the initial temperature times \( ( 1 - k/K )^\alpha \) with k being the total number of moves so far. After K moves the temperature is guaranteed to be zero, after that the optimization runs like a deterministic simplex algorithm.

Member Function Documentation

◆ minimize()

template<class RNG>
EndCriteria::Type minimize ( Problem & P,
const EndCriteria & endCriteria )
overridevirtual

minimize the optimization problem P

Implements OptimizationMethod.