NOMAD Source
Version 4.0.0 Beta
|
Template class for algorithm stop reasons. More...
#include <AlgoStopReasons.hpp>
Public Member Functions | |
AlgoStopReasons () | |
Constructor. More... | |
virtual | ~AlgoStopReasons () |
Destructor. More... | |
void | set (StopType s) |
Set the algo stop reason to a specific stop type. More... | |
std::string | getStopReasonAsString () const override |
Get the stop reason that requires termination as a string. More... | |
bool | checkTerminate () const override |
Check among generic stop reasons and algo stop reason if the algorithm must terminate. More... | |
bool | testIf (const StopType &s) const |
Test for a specific algorithm stop type. More... | |
void | setStarted () override |
Reset stop reasons to their default STARTED state. More... | |
![]() | |
AllStopReasons () | |
Constructor. More... | |
virtual | ~AllStopReasons () |
Destructor. More... | |
const StopReason< EvalGlobalStopType > & | getEvalGlobalStopReason () |
const StopReason< IterStopType > & | getIterStopReason () const |
void | set (const IterStopType &s) |
bool | testIf (IterStopType s) |
Test IterStopType. More... | |
Static Public Member Functions | |
static std::shared_ptr< AlgoStopReasons< StopType > > | get (std::shared_ptr< AllStopReasons > allStopReasons) |
Access to the AlgoStopReasons. More... | |
![]() | |
static const StopReason< BaseStopType > & | getBaseStopReason () |
static void | set (const BaseStopType &s) |
static void | set (const EvalGlobalStopType &s) |
static bool | testIf (const BaseStopType &s) |
Test static BaseStopType. More... | |
static bool | testIf (const EvalGlobalStopType &s) |
Test static EvalGlobalStopType. More... | |
static std::string | getEvalGlobalStopReasonAsString () |
Get the global eval stop reason as a string. More... | |
static std::string | getBaseStopReasonAsString () |
Get the base stop reason as a string. More... | |
static bool | checkBaseTerminate () |
static bool | checkEvalGlobalTerminate () |
Private Attributes | |
StopReason< StopType > | _algoStopReason |
Stop reason specific to this algorithm. More... | |
Template class for algorithm stop reasons.
The class is templated with a StopType defined according to which algorithm is considered. For example, we have MadsStopType, LHStopType and NMStopType.
At some point during an algorithm a stop reason is set. It can be specific to the algorithm or generic (that is be an AllStopReasons stop type).
The stop reasons in AllStopReasons are private and not directly accessible. But the AlgoStopReasons::checkTerminate() function, checks both AllStopReasons and AlgoStopReasons.
Definition at line 65 of file AlgoStopReasons.hpp.
|
inlineexplicit |
|
inlinevirtual |
|
inlineoverridevirtual |
Check among generic stop reasons and algo stop reason if the algorithm must terminate.
Reimplemented from AllStopReasons.
Definition at line 116 of file AlgoStopReasons.hpp.
|
inlinestatic |
Access to the AlgoStopReasons.
Definition at line 126 of file AlgoStopReasons.hpp.
|
inlineoverridevirtual |
Get the stop reason that requires termination as a string.
If no termination is required, an empty string is returned.
Reimplemented from AllStopReasons.
Definition at line 91 of file AlgoStopReasons.hpp.
|
inline |
Set the algo stop reason to a specific stop type.
Definition at line 85 of file AlgoStopReasons.hpp.
|
inlineoverridevirtual |
Reset stop reasons to their default STARTED state.
Reimplemented from AllStopReasons.
Definition at line 147 of file AlgoStopReasons.hpp.
|
inline |
Test for a specific algorithm stop type.
Used to pass a sub-algorithm stop reason to a parent algorithm stop reason.
Definition at line 140 of file AlgoStopReasons.hpp.
|
private |
Stop reason specific to this algorithm.
Definition at line 81 of file AlgoStopReasons.hpp.