QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Differential Evolution configuration object. More...
#include <differentialevolution.hpp>
Classes | |
struct | Candidate |
class | Configuration |
Public Types | |
enum | Strategy { Rand1Standard , BestMemberWithJitter , CurrentToBest2Diffs , Rand1DiffWithPerVectorDither , Rand1DiffWithDither , EitherOrWithOptimalRecombination , Rand1SelfadaptiveWithRotation } |
enum | CrossoverType { Normal , Binomial , Exponential } |
Public Member Functions | |
DifferentialEvolution (const Configuration &configuration=Configuration()) | |
EndCriteria::Type | minimize (Problem &p, const EndCriteria &endCriteria) override |
minimize the optimization problem P More... | |
const Configuration & | configuration () const |
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 | |
void | fillInitialPopulation (std::vector< Candidate > &population, const Problem &p) const |
void | getCrossoverMask (std::vector< Array > &crossoverMask, std::vector< Array > &invCrossoverMask, const Array &mutationProbabilities) const |
Array | getMutationProbabilities (const std::vector< Candidate > &population) const |
void | adaptSizeWeights () const |
void | adaptCrossover () const |
void | calculateNextGeneration (std::vector< Candidate > &population, Problem &costFunction) const |
Array | rotateArray (Array inputArray) const |
void | crossover (const std::vector< Candidate > &oldPopulation, std::vector< Candidate > &population, const std::vector< Candidate > &mutantPopulation, const std::vector< Candidate > &mirrorPopulation, Problem &costFunction) const |
Private Attributes | |
Configuration | configuration_ |
Array | upperBound_ |
Array | lowerBound_ |
Array | currGenSizeWeights_ |
Array | currGenCrossover_ |
Candidate | bestMemberEver_ |
MersenneTwisterUniformRng | rng_ |
Differential Evolution configuration object.
The algorithm and strategy names are taken from here:
Price, K., Storn, R., 1997. Differential Evolution - A Simple and Efficient Heuristic for Global Optimization over Continuous Spaces. Journal of Global Optimization, Kluwer Academic Publishers, 1997, Vol. 11, pp. 341 - 359.
There are seven basic strategies for creating mutant population currently implemented. Three basic crossover types are also available.
Future development: 1) base element type to be extracted 2) L differences to be used instead of fixed number 3) various weights distributions for the differences (dither etc.) 4) printFullInfo parameter usage to track the algorithm
OptimizationMethod using Differential Evolution algorithm
Definition at line 59 of file differentialevolution.hpp.
enum Strategy |
Enumerator | |
---|---|
Rand1Standard | |
BestMemberWithJitter | |
CurrentToBest2Diffs | |
Rand1DiffWithPerVectorDither | |
Rand1DiffWithDither | |
EitherOrWithOptimalRecombination | |
Rand1SelfadaptiveWithRotation |
Definition at line 61 of file differentialevolution.hpp.
enum CrossoverType |
Enumerator | |
---|---|
Normal | |
Binomial | |
Exponential |
Definition at line 70 of file differentialevolution.hpp.
DifferentialEvolution | ( | const Configuration & | configuration = Configuration() | ) |
Definition at line 163 of file differentialevolution.hpp.
|
overridevirtual |
minimize the optimization problem P
Implements OptimizationMethod.
Definition at line 47 of file differentialevolution.cpp.
const Configuration & configuration | ( | ) | const |
Definition at line 168 of file differentialevolution.hpp.
|
private |
Definition at line 378 of file differentialevolution.cpp.
|
private |
Definition at line 308 of file differentialevolution.cpp.
Definition at line 323 of file differentialevolution.cpp.
|
private |
Definition at line 356 of file differentialevolution.cpp.
|
private |
Definition at line 370 of file differentialevolution.cpp.
|
private |
Definition at line 109 of file differentialevolution.cpp.
Definition at line 351 of file differentialevolution.cpp.
|
private |
Definition at line 259 of file differentialevolution.cpp.
|
private |
Definition at line 173 of file differentialevolution.hpp.
|
private |
Definition at line 174 of file differentialevolution.hpp.
|
private |
Definition at line 174 of file differentialevolution.hpp.
|
mutableprivate |
Definition at line 175 of file differentialevolution.hpp.
|
private |
Definition at line 175 of file differentialevolution.hpp.
|
private |
Definition at line 176 of file differentialevolution.hpp.
|
private |
Definition at line 177 of file differentialevolution.hpp.