Fawkes API
Fawkes Development Version
|
Constraint that can be queried to check if an edge is blocked. More...
#include <>>
Public Member Functions | |
NavGraphEdgeConstraint (const std::string &name) | |
Constructor. More... | |
NavGraphEdgeConstraint (const char *name) | |
Constructor. More... | |
virtual | ~NavGraphEdgeConstraint () |
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 &from, const fawkes::NavGraphNode &to)=0 throw () |
Check if constraint blocks an edge. 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 an edge is blocked.
Definition at line 34 of file edge_constraint.h.
fawkes::NavGraphEdgeConstraint::NavGraphEdgeConstraint | ( | const std::string & | name | ) |
Constructor.
name | name of edge constraint |
Definition at line 55 of file edge_constraint.cpp.
fawkes::NavGraphEdgeConstraint::NavGraphEdgeConstraint | ( | const char * | name | ) |
Constructor.
name | name of edge constraint |
Definition at line 63 of file edge_constraint.cpp.
|
virtual |
Virtual empty destructor.
Definition at line 69 of file edge_constraint.cpp.
|
pure virtual |
Check if constraint blocks an edge.
This method must be implemented by constraint classes. It is called to determine if an edge should be considered blocked and therefore cannot be expanded during path search.
Note that the nodes may be passed in either ordering, therefore you should not rely on a particular order, not even for directed nodes!
Further note that the method may not throw an exception. Handle this internally appropriately.
from | node from which the edge originates |
to | node to which the edge leads |
Implemented in fawkes::NavGraphTimedReservationListEdgeConstraint, fawkes::NavGraphStaticListEdgeConstraint, fawkes::NavGraphPolygonEdgeConstraint, and NavGraphClustersBlockConstraint.
|
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::NavGraphTimedReservationListEdgeConstraint, fawkes::NavGraphStaticListEdgeConstraint, fawkes::NavGraphPolygonEdgeConstraint, and NavGraphClustersBlockConstraint.
Definition at line 101 of file edge_constraint.cpp.
std::string fawkes::NavGraphEdgeConstraint::name | ( | ) |
Get name of constraint.
Definition at line 77 of file edge_constraint.cpp.
References name_.
Referenced by NavGraphStaticConstraintsThread::finalize(), ClipsNavGraphThread::finalize(), NavGraphClustersThread::finalize(), NavGraphEdgeConstraint(), fawkes::NavGraphTimedReservationListEdgeConstraint::NavGraphTimedReservationListEdgeConstraint(), and operator==().
bool fawkes::NavGraphEdgeConstraint::operator== | ( | const std::string & | name | ) | const |
Check if constraint matches name.
name | name string to compare this constraints name to |
Definition at line 112 of file edge_constraint.cpp.
|
protected |
Name of constraint.
Definition at line 49 of file edge_constraint.h.
Referenced by fawkes::NavGraphTimedReservationListEdgeConstraint::add_edge(), name(), NavGraphEdgeConstraint(), and operator==().