Fawkes API
Fawkes Development Version
|
Constraint that holds a list of edges to block with timeouts. More...
#include <>>
Public Member Functions | |
NavGraphTimedReservationListEdgeConstraint (Logger *logger, std::string constraint_name, fawkes::Clock *clock) | |
Constructor. More... | |
NavGraphTimedReservationListEdgeConstraint (Logger *logger, std::string constraint_name, fawkes::Clock *clock, std::vector< std::pair< fawkes::NavGraphEdge, fawkes::Time >> edge_time_list) | |
Constructor. More... | |
virtual | ~NavGraphTimedReservationListEdgeConstraint () |
Virtual empty destructor. More... | |
const std::vector< std::pair< fawkes::NavGraphEdge, fawkes::Time > > & | edge_time_list () const |
Get list of blocked edges. More... | |
void | add_edge (const fawkes::NavGraphEdge &edge, const fawkes::Time valid_time) |
Add a single edge to constraint list. More... | |
void | add_edges (const std::vector< std::pair< fawkes::NavGraphEdge, fawkes::Time >> &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 with timeouts.
Definition at line 38 of file timed_reservation_list_edge_constraint.h.
fawkes::NavGraphTimedReservationListEdgeConstraint::NavGraphTimedReservationListEdgeConstraint | ( | Logger * | logger, |
std::string | name, | ||
fawkes::Clock * | clock | ||
) |
Constructor.
logger | logger used for debug logging |
name | name of edge constraint |
clock | time source to evaluate constraint timeouts |
Definition at line 45 of file timed_reservation_list_edge_constraint.cpp.
fawkes::NavGraphTimedReservationListEdgeConstraint::NavGraphTimedReservationListEdgeConstraint | ( | Logger * | logger, |
std::string | name, | ||
fawkes::Clock * | clock, | ||
std::vector< std::pair< fawkes::NavGraphEdge, fawkes::Time >> | edge_time_list | ||
) |
Constructor.
logger | logger used for debug logging |
name | name of edge constraint |
clock | time source to evaluate constraint timeouts |
edge_time_list | list of edges with valid_time |
Definition at line 59 of file timed_reservation_list_edge_constraint.cpp.
|
virtual |
Virtual empty destructor.
Definition at line 71 of file timed_reservation_list_edge_constraint.cpp.
void fawkes::NavGraphTimedReservationListEdgeConstraint::add_edge | ( | const fawkes::NavGraphEdge & | edge, |
const fawkes::Time | valid_time | ||
) |
Add a single edge to constraint list.
edge | edge to add to constraint list |
valid_time | valid time for this edge |
Definition at line 110 of file timed_reservation_list_edge_constraint.cpp.
References fawkes::NavGraphEdge::from(), has_edge(), fawkes::Time::in_sec(), fawkes::Logger::log_warn(), fawkes::NavGraphEdgeConstraint::name_, and fawkes::NavGraphEdge::to().
Referenced by add_edges().
void fawkes::NavGraphTimedReservationListEdgeConstraint::add_edges | ( | const std::vector< std::pair< fawkes::NavGraphEdge, fawkes::Time >> & | edges | ) |
Add multiple edges to constraint list.
edges | edges with timeout to add to constraint list |
Definition at line 132 of file timed_reservation_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 178 of file timed_reservation_list_edge_constraint.cpp.
void fawkes::NavGraphTimedReservationListEdgeConstraint::clear_edges | ( | ) |
Remove all edges.
Definition at line 204 of file timed_reservation_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 77 of file timed_reservation_list_edge_constraint.cpp.
References fawkes::Logger::log_info(), and fawkes::NavGraphEdgeConstraint::name_.
const std::vector< std::pair< fawkes::NavGraphEdge, fawkes::Time > > & fawkes::NavGraphTimedReservationListEdgeConstraint::edge_time_list | ( | ) | const |
Get list of blocked edges.
Definition at line 196 of file timed_reservation_list_edge_constraint.cpp.
bool fawkes::NavGraphTimedReservationListEdgeConstraint::has_edge | ( | const fawkes::NavGraphEdge & | edge | ) |
Check if constraint has a specific edge.
edge | edge to check |
Definition at line 168 of file timed_reservation_list_edge_constraint.cpp.
Referenced by add_edge().
void fawkes::NavGraphTimedReservationListEdgeConstraint::remove_edge | ( | const fawkes::NavGraphEdge & | edge | ) |
Remove a single edge from the constraint list.
edge | edge to remote |
Definition at line 148 of file timed_reservation_list_edge_constraint.cpp.