RobWorkProject
23.9.11-
|
StopCriteria is a class for specifying an instant a compution should be aborted. More...
#include <StopCriteria.hpp>
Public Types | |
typedef rw::core::Ptr< StopCriteria > | Ptr |
smart pointer type to this class | |
Public Member Functions | |
bool | stop () const |
True is returned when the computation should be stopped. | |
StopCriteria::Ptr | instance () const |
A new instance of the property constructed to match the original initial state of the criteria. More... | |
virtual | ~StopCriteria () |
Destructor. | |
Static Public Member Functions | |
static StopCriteria::Ptr | stopAfter (double time) |
Stop the computation after time seconds from now. More... | |
static StopCriteria::Ptr | stopNever () |
Never stop the computation. | |
static StopCriteria::Ptr | stopNow () |
Immediately stop the computation. | |
static StopCriteria::Ptr | stopByFlag (bool *stop) |
Stop the computation when stop says so. More... | |
static StopCriteria::Ptr | stopByFun (boost::function< bool()> fun) |
Stop the computation when fun says so. | |
static StopCriteria::Ptr | stopCnt (int cnt) |
Stop the computation after cnt calls of the stop criteria. | |
static StopCriteria::Ptr | stopEither (const std::vector< StopCriteria::Ptr > &criteria) |
Stop if either of criteria says stop. | |
static StopCriteria::Ptr | stopEither (const StopCriteria::Ptr &a, const StopCriteria::Ptr &b) |
Stop if either a or b says stop. | |
Protected Member Functions | |
StopCriteria () | |
Constructor. | |
virtual bool | doStop () const =0 |
Subclass implementation of the stop() method. | |
virtual StopCriteria::Ptr | doInstance () const =0 |
Subclass implementation of the instance() method. | |
StopCriteria is a class for specifying an instant a compution should be aborted.
The computation determines when to stop by repeatedly polling the StopCriteria::stop() method. Therefore the stop() method should be implemented to have a very short, preferably deterministic running time.