libROM
v1.0
Data-driven physical simulation library
|
#include <DifferentialEvolution.h>
Public Member Functions | |
DifferentialEvolution (const IOptimizable &costFunction, unsigned int populationSize, double F=0.8, double CR=0.9, int randomSeed=1, bool shouldCheckConstraints=true, std::function< void(const DifferentialEvolution &)> callback=nullptr, std::function< bool(const DifferentialEvolution &)> terminationCondition=nullptr) | |
Constructor. More... | |
std::vector< double > | Optimize (int min_iterations, int max_iterations, double cost_tolerance, bool verbose=true) |
Constructor. More... | |
Class DifferentialEvolution is a general purpose black box optimizer for the class IOptimizable.
Definition at line 120 of file DifferentialEvolution.h.
CAROM::DifferentialEvolution::DifferentialEvolution | ( | const IOptimizable & | costFunction, |
unsigned int | populationSize, | ||
double | F = 0.8 , |
||
double | CR = 0.9 , |
||
int | randomSeed = 1 , |
||
bool | shouldCheckConstraints = true , |
||
std::function< void(const DifferentialEvolution &)> | callback = nullptr , |
||
std::function< bool(const DifferentialEvolution &)> | terminationCondition = nullptr |
||
) |
Constructor.
[in] | costFunction | Cost function to minimize |
[in] | populationSize | Number of agents in each optimization step |
[in] | F | The differential weight. |
[in] | CR | The crossover probability. |
[in] | randomSeed | Set random seed to a fix value to have repeatable (non stochastic) experiments |
[in] | shouldCheckConstraints | Should constraints be checked on for each new candidate. This check may be turned off to increase performance if the cost function is defined and has no local minimum outside of the constraints. |
[in] | callback | Optional callback to be called after each optimization iteration has finished. |
[in] | terminationCondition | Optional termination condition callback to be called after each optimization iteration has finished. |
Definition at line 22 of file DifferentialEvolution.cpp.
std::vector< double > CAROM::DifferentialEvolution::Optimize | ( | int | min_iterations, |
int | max_iterations, | ||
double | cost_tolerance, | ||
bool | verbose = true |
||
) |
Constructor.
[in] | min_iterations | The minimum number of iterations to run. Cost tolerance is not checked until then. |
[in] | max_iterations | The maximum number of iterations to run. |
[in] | cost_tolerance | The cost tolerance to determine convergence. |
[in] | verbose | Verbosity. |
Definition at line 66 of file DifferentialEvolution.cpp.