Loading...
Searching...
No Matches
ompl::base::PlannerTerminationCondition Class Reference

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 <ompl/base/PlannerTerminationCondition.h>

Inheritance diagram for ompl::base::PlannerTerminationCondition:

Public Member Functions

 PlannerTerminationCondition (const PlannerTerminationConditionFn &fn)
 Construct a termination condition. By default, eval() will call the externally specified function fn to decide whether the planner should terminate.
 
 PlannerTerminationCondition (const PlannerTerminationConditionFn &fn, double period)
 Construct a termination condition that is evaluated every period seconds. The evaluation of the condition consists of calling fn() in a separate thread. Calls to eval() will always return the last value computed by the call to fn().
 
bool operator() () const
 Return true if the planner should stop its computation.
 
 operator bool () const
 Cast as true if the planner should stop its computation.
 
void terminate () const
 Notify that the condition for termination should become true, regardless of what eval() returns. This function may be called while the condition is being evaluated by other threads.
 
bool eval () const
 The implementation of some termination condition. By default, this just calls fn_()
 

Detailed Description

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 63 of file PlannerTerminationCondition.h.

Constructor & Destructor Documentation

◆ PlannerTerminationCondition() [1/2]

ompl::base::PlannerTerminationCondition::PlannerTerminationCondition ( const PlannerTerminationConditionFn fn)

Construct a termination condition. By default, eval() will call the externally specified function fn to decide whether the planner should terminate.

Definition at line 161 of file PlannerTerminationCondition.cpp.

◆ PlannerTerminationCondition() [2/2]

ompl::base::PlannerTerminationCondition::PlannerTerminationCondition ( const PlannerTerminationConditionFn fn,
double  period 
)

Construct a termination condition that is evaluated every period seconds. The evaluation of the condition consists of calling fn() in a separate thread. Calls to eval() will always return the last value computed by the call to fn().

Definition at line 166 of file PlannerTerminationCondition.cpp.

Member Function Documentation

◆ eval()

bool ompl::base::PlannerTerminationCondition::eval ( ) const

The implementation of some termination condition. By default, this just calls fn_()

Definition at line 177 of file PlannerTerminationCondition.cpp.

◆ operator bool()

ompl::base::PlannerTerminationCondition::operator bool ( ) const
inline

Cast as true if the planner should stop its computation.

Definition at line 85 of file PlannerTerminationCondition.h.

◆ operator()()

bool ompl::base::PlannerTerminationCondition::operator() ( ) const
inline

Return true if the planner should stop its computation.

Definition at line 79 of file PlannerTerminationCondition.h.

◆ terminate()

void ompl::base::PlannerTerminationCondition::terminate ( ) const

Notify that the condition for termination should become true, regardless of what eval() returns. This function may be called while the condition is being evaluated by other threads.

Definition at line 172 of file PlannerTerminationCondition.cpp.


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