Fawkes API
Fawkes Development Version
|
Constraint that can be queried to check if a node is blocked. More...
#include <>>
Public Member Functions | |
NavGraphNodeConstraint (const std::string &name) | |
Constructor. More... | |
NavGraphNodeConstraint (const char *name) | |
Constructor. More... | |
virtual | ~NavGraphNodeConstraint () |
Virtual empty destructor. More... | |
std::string | name () |
Get name of constraint. More... | |
virtual bool | compute (void) throw () |
Perform compuations before graph search and to indicate re-planning. More... | |
virtual bool | blocks (const fawkes::NavGraphNode &node)=0 throw () |
Check if constraint blocks a node. More... | |
bool | operator== (const std::string &name) const |
Check if constraint matches name. More... | |
Protected Attributes | |
std::string | name_ |
Name of constraint. More... | |
Constraint that can be queried to check if a node is blocked.
Definition at line 37 of file node_constraint.h.
fawkes::NavGraphNodeConstraint::NavGraphNodeConstraint | ( | const std::string & | name | ) |
Constructor.
name | name of node constraint |
Definition at line 51 of file node_constraint.cpp.
fawkes::NavGraphNodeConstraint::NavGraphNodeConstraint | ( | const char * | name | ) |
Constructor.
name | name of node constraint |
Definition at line 59 of file node_constraint.cpp.
|
virtual |
Virtual empty destructor.
Definition at line 66 of file node_constraint.cpp.
|
pure virtual |
Check if constraint blocks a node.
This method must be implemented by constraint classes. It is called to determine if a node should be considered blocked and therefore cannot be expanded during path search. Note that the method may not throw an exception. Handle this internally appropriately.
node | node to check for expansion |
Implemented in fawkes::NavGraphStaticListNodeConstraint, fawkes::NavGraphTimedReservationListNodeConstraint, and fawkes::NavGraphPolygonNodeConstraint.
|
virtual |
Perform compuations before graph search and to indicate re-planning.
The compute method is called on all constraints just before a path search is performed and to check if re-planning should be tried.
It can be used for example to cache results for the coming search run. The search guarantees that for each complete search run compute() is called once and only once and that no two search runs overlap, i.e., compute() will not be called while another search is still running.
Constraints must indicate whether any change has occured during computation or since the last compute() call through the return value. This is used to determine if re-planning should be attempted.
Reimplemented in fawkes::NavGraphStaticListNodeConstraint, fawkes::NavGraphTimedReservationListNodeConstraint, and fawkes::NavGraphPolygonNodeConstraint.
Definition at line 99 of file node_constraint.cpp.
std::string fawkes::NavGraphNodeConstraint::name | ( | ) |
Get name of constraint.
Definition at line 74 of file node_constraint.cpp.
References name_.
Referenced by NavGraphStaticConstraintsThread::finalize(), NavGraphNodeConstraint(), and operator==().
bool fawkes::NavGraphNodeConstraint::operator== | ( | const std::string & | name | ) | const |
Check if constraint matches name.
name | name string to compare this constraints name to |
Definition at line 111 of file node_constraint.cpp.
|
protected |
Name of constraint.
Definition at line 52 of file node_constraint.h.
Referenced by fawkes::NavGraphTimedReservationListNodeConstraint::add_node(), fawkes::NavGraphTimedReservationListNodeConstraint::compute(), name(), NavGraphNodeConstraint(), and operator==().