libcmaes 0.10.2
A C++11 library for stochastic optimization with CMA-ES
Loading...
Searching...
No Matches
libcmaes::CMAStopCriteria< TGenoPheno > Class Template Reference

CMA-ES termination criteria, see reference paper in cmastrategy.h. More...

#include <libcmaes/cmastopcriteria.h>

Public Member Functions

 CMAStopCriteria ()
 Constructor: instanciates a predefined set of termination criteria tests, see reference paper in cmastrategy.h.
 
int stop (const CMAParameters< TGenoPheno > &cmap, const CMASolutions &cmas) const
 Termination criteria evaluation: the function iterates and evaluates the predefined criteria.
 
int set_criteria_active (const int &c, const bool &active)
 activates / deactivates a stopping criteria
 

Private Attributes

std::map< int, StopCriteria< TGenoPheno > > _scriteria
 
bool _active
 

Static Private Attributes

static std::map< int, std::string > _scriterias
 

Friends

class CMASolutions
 

Detailed Description

template<class TGenoPheno = NoBoundStrategy>
class libcmaes::CMAStopCriteria< TGenoPheno >

CMA-ES termination criteria, see reference paper in cmastrategy.h.

Member Function Documentation

◆ set_criteria_active()

template<class TGenoPheno >
int libcmaes::CMAStopCriteria< TGenoPheno >::set_criteria_active ( const int c,
const bool active 
)

activates / deactivates a stopping criteria

Parameters
cthe criteria to modify
trueto activate, false to deactivate
Returns
1 if criteria cannot be found, 0 otherwise

◆ stop()

Termination criteria evaluation: the function iterates and evaluates the predefined criteria.

Returns
0 if no termination criteria triggers, the termination code otherwise (< 0 for an error, > 1 for a partial success).

Member Data Documentation

◆ _active

template<class TGenoPheno = NoBoundStrategy>
bool libcmaes::CMAStopCriteria< TGenoPheno >::_active
private

whether these termination criteria are active.

◆ _scriteria

template<class TGenoPheno = NoBoundStrategy>
std::map<int,StopCriteria<TGenoPheno> > libcmaes::CMAStopCriteria< TGenoPheno >::_scriteria
private

the set of predefined criteria, with priorities.

◆ _scriterias

template<class TGenoPheno >
std::map< int, std::string > libcmaes::CMAStopCriteria< TGenoPheno >::_scriterias
staticprivate
Initial value:
= {{CONT,"OK"},
{AUTOMAXITER,"The automatically set maximal number of iterations per run has been reached"},
{TOLHISTFUN,"[Success] The optimization has converged"},
{EQUALFUNVALS,"[Partial Success] The objective function values are the same over too many iterations, check the formulation of your objective function"},
{TOLX,"[Partial Success] All components of covariance matrix are very small (e.g. < 1e-12)"},
{TOLUPSIGMA,"[Error] Mismatch between step size increase and decrease of all eigenvalues in covariance matrix. Try to restart the optimization."},
{STAGNATION,"[Partial Success] Median of newest values is not smaller than the median of older values"},
{CONDITIONCOV,"[Error] The covariance matrix's condition number exceeds 1e14. Check out the formulation of your problem"},
{NOEFFECTAXIS,"[Partial Success] Mean remains constant along search axes"},
{NOEFFECTCOOR,"[Partial Success] Mean remains constant in coordinates"},
{MAXFEVALS,"The maximum number of function evaluations allowed for optimization has been reached"},
{MAXITER,"The maximum number of iterations specified for optimization has been reached"},
{FTARGET,"[Success] The objective function target value has been reached"}}

The documentation for this class was generated from the following files: