NOMAD Source
Version 4.0.0 Beta
|
Template class for algorithm stop reasons. More...
#include <AlgoStopReasons.hpp>
Public Member Functions | |
AlgoStopReasons () | |
Constructor. More... | |
~AlgoStopReasons () | |
Destructor. More... | |
StopReason< StopType > & | getAlgoStopReason () |
Access to the algo stop reason (no the other generic stop reasons). 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 (StopType s) |
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... | |
StopReason< BaseStopType > & | getBaseStopReason () |
StopReason< EvalStopType > & | getEvalStopReason () |
StopReason< IterStopType > & | getIterStopReason () |
void | set (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 void | set (BaseStopType s) |
static void | set (EvalStopType s) |
static bool | testIf (BaseStopType s) |
Test static BaseStopType. More... | |
static bool | testIf (EvalStopType s) |
Test static EvalStopType. More... | |
static std::string | getEvalStopReasonAsString () |
Get the 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 | checkEvalTerminate () |
Private Attributes | |
StopReason< StopType > | _algoStopReason |
Template class for algorithm stop reasons.
The StopType defines which algorithm is considered.
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 20 of file AlgoStopReasons.hpp.
|
inlineexplicit |
|
inline |
|
inlineoverridevirtual |
Check among generic stop reasons and algo stop reason if the algorithm must terminate.
Reimplemented from AllStopReasons.
Definition at line 61 of file AlgoStopReasons.hpp.
|
inlinestatic |
Access to the AlgoStopReasons.
Definition at line 68 of file AlgoStopReasons.hpp.
|
inline |
Access to the algo stop reason (no the other generic stop reasons).
Definition at line 41 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 49 of file AlgoStopReasons.hpp.
|
inline |
Set the algo stop reason to a specific stop type.
Definition at line 44 of file AlgoStopReasons.hpp.
|
inlineoverridevirtual |
Reset stop reasons to their default STARTED state.
Reimplemented from AllStopReasons.
Definition at line 87 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 81 of file AlgoStopReasons.hpp.
|
private |
Definition at line 36 of file AlgoStopReasons.hpp.