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 37 of file edge_constraint.h.
fawkes::NavGraphEdgeConstraint::NavGraphEdgeConstraint | ( | const std::string & | name | ) |
Constructor.
name | name of edge constraint |
Definition at line 59 of file edge_constraint.cpp.
fawkes::NavGraphEdgeConstraint::NavGraphEdgeConstraint | ( | const char * | name | ) |
Constructor.
name | name of edge constraint |
Definition at line 67 of file edge_constraint.cpp.
|
virtual |
Virtual empty destructor.
Definition at line 74 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::NavGraphStaticListEdgeConstraint, fawkes::NavGraphTimedReservationListEdgeConstraint, 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::NavGraphStaticListEdgeConstraint, fawkes::NavGraphTimedReservationListEdgeConstraint, fawkes::NavGraphPolygonEdgeConstraint, and NavGraphClustersBlockConstraint.
Definition at line 107 of file edge_constraint.cpp.
std::string fawkes::NavGraphEdgeConstraint::name | ( | ) |
Get name of constraint.
Definition at line 82 of file edge_constraint.cpp.
References name_.
Referenced by NavGraphStaticConstraintsThread::finalize(), ClipsNavGraphThread::finalize(), NavGraphClustersThread::finalize(), NavGraphEdgeConstraint(), 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 119 of file edge_constraint.cpp.
|
protected |
Name of constraint.
Definition at line 53 of file edge_constraint.h.
Referenced by fawkes::NavGraphTimedReservationListEdgeConstraint::add_edge(), fawkes::NavGraphTimedReservationListEdgeConstraint::compute(), name(), NavGraphEdgeConstraint(), and operator==().