Fawkes API
Fawkes Development Version
|
Constraint that holds a list of edges to block. More...
#include <>>
Public Member Functions | |
NavGraphStaticListEdgeConstraint (std::string name) | |
Constructor. More... | |
NavGraphStaticListEdgeConstraint (std::string name, std::vector< fawkes::NavGraphEdge > &edge_list) | |
Constructor. More... | |
virtual | ~NavGraphStaticListEdgeConstraint () |
Virtual empty destructor. More... | |
const std::vector< fawkes::NavGraphEdge > & | edge_list () const |
Get list of blocked edges. More... | |
void | add_edge (const fawkes::NavGraphEdge &edge) |
Add a single edge to constraint list. More... | |
void | add_edges (const std::vector< fawkes::NavGraphEdge > &edges) |
Add multiple edges to constraint list. More... | |
void | remove_edge (const fawkes::NavGraphEdge &edge) |
Remove a single edge from the constraint list. More... | |
void | clear_edges () |
Remove all edges. More... | |
bool | has_edge (const fawkes::NavGraphEdge &edge) |
Check if constraint has a specific edge. 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) throw () |
Check if constraint blocks an edge. More... | |
![]() | |
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... | |
bool | operator== (const std::string &name) const |
Check if constraint matches name. More... | |
Additional Inherited Members | |
![]() | |
std::string | name_ |
Name of constraint. More... | |
Constraint that holds a list of edges to block.
Definition at line 38 of file static_list_edge_constraint.h.
fawkes::NavGraphStaticListEdgeConstraint::NavGraphStaticListEdgeConstraint | ( | std::string | name | ) |
Constructor.
name | name of edge constraint |
Definition at line 42 of file static_list_edge_constraint.cpp.
fawkes::NavGraphStaticListEdgeConstraint::NavGraphStaticListEdgeConstraint | ( | std::string | name, |
std::vector< fawkes::NavGraphEdge > & | edge_list | ||
) |
Constructor.
name | name of edge constraint |
edge_list | list of edges to block |
Definition at line 54 of file static_list_edge_constraint.cpp.
References edge_list().
|
virtual |
Virtual empty destructor.
Definition at line 64 of file static_list_edge_constraint.cpp.
void fawkes::NavGraphStaticListEdgeConstraint::add_edge | ( | const fawkes::NavGraphEdge & | edge | ) |
Add a single edge to constraint list.
edge | edge to add to constraint list |
Definition at line 85 of file static_list_edge_constraint.cpp.
References has_edge().
Referenced by add_edges(), ClipsNavGraphThread::clips_context_destroyed(), and NavGraphStaticConstraintsThread::init().
void fawkes::NavGraphStaticListEdgeConstraint::add_edges | ( | const std::vector< fawkes::NavGraphEdge > & | edges | ) |
Add multiple edges to constraint list.
edges | edges to add to constraint list |
Definition at line 97 of file static_list_edge_constraint.cpp.
References add_edge().
|
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 |
Implements fawkes::NavGraphEdgeConstraint.
Definition at line 152 of file static_list_edge_constraint.cpp.
void fawkes::NavGraphStaticListEdgeConstraint::clear_edges | ( | ) |
Remove all edges.
Definition at line 142 of file static_list_edge_constraint.cpp.
|
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 from fawkes::NavGraphEdgeConstraint.
Definition at line 70 of file static_list_edge_constraint.cpp.
const std::vector< fawkes::NavGraphEdge > & fawkes::NavGraphStaticListEdgeConstraint::edge_list | ( | ) | const |
Get list of blocked edges.
Definition at line 134 of file static_list_edge_constraint.cpp.
Referenced by NavGraphStaticListEdgeConstraint().
bool fawkes::NavGraphStaticListEdgeConstraint::has_edge | ( | const fawkes::NavGraphEdge & | edge | ) |
Check if constraint has a specific edge.
edge | edge to check |
Definition at line 124 of file static_list_edge_constraint.cpp.
Referenced by add_edge().
void fawkes::NavGraphStaticListEdgeConstraint::remove_edge | ( | const fawkes::NavGraphEdge & | edge | ) |
Remove a single edge from the constraint list.
edge | edge to remote |
Definition at line 109 of file static_list_edge_constraint.cpp.
Referenced by ClipsNavGraphThread::clips_context_destroyed().