22 #ifndef CMASTOPCRITERIA_H
23 #define CMASTOPCRITERIA_H
25 #include "cmaparameters.h"
34 template <
class TGenoPheno>
35 using StopCriteriaFunc = std::function<int (const CMAParameters<TGenoPheno> &cmap,
const CMASolutions &cmas)>;
54 template <
class TGenoPheno=NoBoundStrategy>
63 inline bool active()
const {
return _active; }
65 void set_active(
const bool &a) { _active = a; }
67 StopCriteriaFunc<TGenoPheno> _sfunc;
74 template <
class TGenoPheno=NoBoundStrategy>
104 std::map<int,StopCriteria<TGenoPheno> > _scriteria;
106 static std::map<int,std::string> _scriterias;
109 template <
class TGenoPheno>
111 {AUTOMAXITER,
"The automatically set maximal number of iterations per run has been reached"},
112 {TOLHISTFUN,
"[Success] The optimization has converged"},
113 {EQUALFUNVALS,
"[Partial Success] The objective function values are the same over too many iterations, check the formulation of your objective function"},
114 {TOLX,
"[Partial Success] All components of covariance matrix are very small (e.g. < 1e-12)"},
115 {TOLUPSIGMA,
"[Error] Mismatch between step size increase and decrease of all eigenvalues in covariance matrix. Try to restart the optimization."},
116 {STAGNATION,
"[Partial Success] Median of newest values is not smaller than the median of older values"},
117 {CONDITIONCOV,
"[Error] The covariance matrix's condition number exceeds 1e14. Check out the formulation of your problem"},
118 {NOEFFECTAXIS,
"[Partial Success] Mean remains constant along search axes"},
119 {NOEFFECTCOOR,
"[Partial Success] Mean remains constant in coordinates"},
120 {MAXFEVALS,
"The maximum number of function evaluations allowed for optimization has been reached"},
121 {MAXITER,
"The maximum number of iterations specified for optimization has been reached"},
122 {FTARGET,
"[Success] The objective function target value has been reached"}};
Holder of the set of evolving solutions from running an instance of CMA-ES.
Definition: cmasolutions.h:41
Definition: cmastopcriteria.h:55
CMAStopCriteria()
Constructor: instanciates a predefined set of termination criteria tests, see reference paper in cmas...
Definition: cmastopcriteria.cc:51
linear scaling of the parameter space to achieve similar sensitivity across all components.
Definition: acovarianceupdate.cc:25
Parameters for various flavors of the CMA-ES algorithm.
Definition: cmaparameters.h:35
int stop(const CMAParameters< TGenoPheno > &cmap, const CMASolutions &cmas) const
Termination criteria evaluation: the function iterates and evaluates the predefined criteria...
Definition: cmastopcriteria.cc:244
CMA-ES termination criteria, see reference paper in cmastrategy.h.
Definition: cmastopcriteria.h:75
int set_criteria_active(const int &c, const bool &active)
activates / deactivates a stopping criteria
Definition: cmastopcriteria.cc:267