QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Simulated Annealing. More...
#include <simulatedannealing.hpp>
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 More... | |
Public Member Functions inherited from OptimizationMethod | |
virtual | ~OptimizationMethod ()=default |
virtual EndCriteria::Type | minimize (Problem &P, const EndCriteria &endCriteria)=0 |
minimize the optimization problem P More... | |
Private Member Functions | |
Real | simplexSize () |
void | amotsa (Problem &, Real) |
Private Attributes | |
const Scheme | scheme_ |
const Real | lambda_ |
const Real | T0_ |
const Real | epsilon_ |
const Real | alpha_ |
const Size | K_ |
const RNG | rng_ |
Real | T_ |
std::vector< Array > | vertices_ |
Array | values_ |
Array | sum_ |
Integer | i_ |
Integer | ihi_ |
Integer | ilo_ |
Integer | j_ |
Integer | m_ |
Integer | n_ |
Real | fac1_ |
Real | fac2_ |
Real | yflu_ |
Real | rtol_ |
Real | swap_ |
Real | yhi_ |
Real | ylo_ |
Real | ynhi_ |
Real | ysave_ |
Real | yt_ |
Real | ytry_ |
Real | yb_ |
Real | tt_ |
Array | pb_ |
Array | ptry_ |
Size | iteration_ |
Size | iterationT_ |
Simulated Annealing.
Class RNG must implement the following interface:
Definition at line 46 of file simulatedannealing.hpp.
enum Scheme |
Enumerator | |
---|---|
ConstantFactor | |
ConstantBudget |
Definition at line 50 of file simulatedannealing.hpp.
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
Definition at line 56 of file simulatedannealing.hpp.
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.
Definition at line 68 of file simulatedannealing.hpp.
|
overridevirtual |
minimize the optimization problem P
Implements OptimizationMethod.
Definition at line 141 of file simulatedannealing.hpp.
|
private |
|
private |
Definition at line 77 of file simulatedannealing.hpp.
|
private |
Definition at line 78 of file simulatedannealing.hpp.
|
private |
Definition at line 78 of file simulatedannealing.hpp.
|
private |
Definition at line 78 of file simulatedannealing.hpp.
|
private |
Definition at line 78 of file simulatedannealing.hpp.
|
private |
Definition at line 79 of file simulatedannealing.hpp.
|
private |
Definition at line 80 of file simulatedannealing.hpp.
|
private |
Definition at line 85 of file simulatedannealing.hpp.
|
private |
Definition at line 86 of file simulatedannealing.hpp.
|
private |
Definition at line 87 of file simulatedannealing.hpp.
|
private |
Definition at line 87 of file simulatedannealing.hpp.
|
private |
Definition at line 88 of file simulatedannealing.hpp.
|
private |
Definition at line 88 of file simulatedannealing.hpp.
|
private |
Definition at line 88 of file simulatedannealing.hpp.
|
private |
Definition at line 88 of file simulatedannealing.hpp.
|
private |
Definition at line 88 of file simulatedannealing.hpp.
|
private |
Definition at line 88 of file simulatedannealing.hpp.
|
private |
Definition at line 89 of file simulatedannealing.hpp.
|
private |
Definition at line 89 of file simulatedannealing.hpp.
|
private |
Definition at line 89 of file simulatedannealing.hpp.
|
private |
Definition at line 90 of file simulatedannealing.hpp.
|
private |
Definition at line 90 of file simulatedannealing.hpp.
|
private |
Definition at line 90 of file simulatedannealing.hpp.
|
private |
Definition at line 90 of file simulatedannealing.hpp.
|
private |
Definition at line 90 of file simulatedannealing.hpp.
|
private |
Definition at line 90 of file simulatedannealing.hpp.
|
private |
Definition at line 90 of file simulatedannealing.hpp.
|
private |
Definition at line 90 of file simulatedannealing.hpp.
|
private |
Definition at line 90 of file simulatedannealing.hpp.
|
private |
Definition at line 90 of file simulatedannealing.hpp.
|
private |
Definition at line 91 of file simulatedannealing.hpp.
|
private |
Definition at line 91 of file simulatedannealing.hpp.
|
private |
Definition at line 92 of file simulatedannealing.hpp.
|
private |
Definition at line 92 of file simulatedannealing.hpp.