Encapsulate a termination condition for a motion planner. Planners will call operator() to decide whether they should terminate before a solution is found or not. operator() will return true if either the implemented condition is met (the call to eval() returns true) or if the user called terminate(true). More...
#include <PlannerTerminationCondition.h>
Public Member Functions | |
PlannerTerminationCondition (const PlannerTerminationConditionFn &fn=PlannerTerminationConditionFn()) | |
Construct a termination condition. By default, eval() will call the externally specified function fn to decide whether the planner should terminate. The function fn does not always need to be specified, if a different implementation of eval() is provided by a derived class. | |
bool | operator() (void) const |
Return true if the planner should stop its computation. | |
virtual void | terminate (bool flag) |
Notify that the condition for termination should become true, regardless of what eval() returns. | |
virtual bool | eval (void) const |
The implementation of some termination condition. By default, this just calls fn_() | |
Protected Attributes | |
PlannerTerminationConditionFn | fn_ |
Function pointer to the piece of code that decides whether a termination condition has been met. | |
bool | terminate_ |
Flag indicating whether the user has externally requested that the condition for termination should become true. |
Encapsulate a termination condition for a motion planner. Planners will call operator() to decide whether they should terminate before a solution is found or not. operator() will return true if either the implemented condition is met (the call to eval() returns true) or if the user called terminate(true).
Definition at line 64 of file PlannerTerminationCondition.h.