Fawkes API  Fawkes Development Version
fawkes::NavGraphTimedReservationListEdgeConstraint Class Reference

Constraint that holds a list of edges to block with timeouts. More...

#include <>>

Inheritance diagram for fawkes::NavGraphTimedReservationListEdgeConstraint:

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...
 
- Public Member Functions inherited from fawkes::NavGraphEdgeConstraint
 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

- Protected Attributes inherited from fawkes::NavGraphEdgeConstraint
std::string name_
 Name of constraint. More...
 

Detailed Description

Constraint that holds a list of edges to block with timeouts.

Author
Sebastian Reuter
Tim Niemueller

Definition at line 38 of file timed_reservation_list_edge_constraint.h.

Constructor & Destructor Documentation

◆ NavGraphTimedReservationListEdgeConstraint() [1/2]

fawkes::NavGraphTimedReservationListEdgeConstraint::NavGraphTimedReservationListEdgeConstraint ( Logger logger,
std::string  name,
fawkes::Clock clock 
)

Constructor.

Parameters
loggerlogger used for debug logging
namename of edge constraint
clocktime source to evaluate constraint timeouts

Definition at line 45 of file timed_reservation_list_edge_constraint.cpp.

◆ NavGraphTimedReservationListEdgeConstraint() [2/2]

fawkes::NavGraphTimedReservationListEdgeConstraint::NavGraphTimedReservationListEdgeConstraint ( Logger logger,
std::string  name,
fawkes::Clock clock,
std::vector< std::pair< fawkes::NavGraphEdge, fawkes::Time >>  edge_time_list 
)

Constructor.

Parameters
loggerlogger used for debug logging
namename of edge constraint
clocktime source to evaluate constraint timeouts
edge_time_listlist of edges with valid_time

Definition at line 59 of file timed_reservation_list_edge_constraint.cpp.

◆ ~NavGraphTimedReservationListEdgeConstraint()

fawkes::NavGraphTimedReservationListEdgeConstraint::~NavGraphTimedReservationListEdgeConstraint ( )
virtual

Virtual empty destructor.

Definition at line 71 of file timed_reservation_list_edge_constraint.cpp.

Member Function Documentation

◆ add_edge()

void fawkes::NavGraphTimedReservationListEdgeConstraint::add_edge ( const fawkes::NavGraphEdge edge,
const fawkes::Time  valid_time 
)

Add a single edge to constraint list.

Parameters
edgeedge to add to constraint list
valid_timevalid 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().

◆ add_edges()

void fawkes::NavGraphTimedReservationListEdgeConstraint::add_edges ( const std::vector< std::pair< fawkes::NavGraphEdge, fawkes::Time >> &  edges)

Add multiple edges to constraint list.

Parameters
edgesedges with timeout to add to constraint list

Definition at line 132 of file timed_reservation_list_edge_constraint.cpp.

References add_edge().

◆ blocks()

bool fawkes::NavGraphTimedReservationListEdgeConstraint::blocks ( const fawkes::NavGraphNode from,
const fawkes::NavGraphNode to 
)
throw (
)
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.

Parameters
fromnode from which the edge originates
tonode to which the edge leads
Returns
true if the edge should be considered blocked, false otherwise

Implements fawkes::NavGraphEdgeConstraint.

Definition at line 178 of file timed_reservation_list_edge_constraint.cpp.

◆ clear_edges()

void fawkes::NavGraphTimedReservationListEdgeConstraint::clear_edges ( )

Remove all edges.

Definition at line 204 of file timed_reservation_list_edge_constraint.cpp.

◆ compute()

bool fawkes::NavGraphTimedReservationListEdgeConstraint::compute ( void  )
throw (
)
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.

Returns
true if a change has occured during computation or since the last call, false otherwise

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_.

◆ edge_time_list()

const std::vector< std::pair< fawkes::NavGraphEdge, fawkes::Time > > & fawkes::NavGraphTimedReservationListEdgeConstraint::edge_time_list ( ) const

Get list of blocked edges.

Returns
list of blocked edges

Definition at line 196 of file timed_reservation_list_edge_constraint.cpp.

◆ has_edge()

bool fawkes::NavGraphTimedReservationListEdgeConstraint::has_edge ( const fawkes::NavGraphEdge edge)

Check if constraint has a specific edge.

Parameters
edgeedge to check
Returns
true if edge is in list, false otherwise

Definition at line 168 of file timed_reservation_list_edge_constraint.cpp.

Referenced by add_edge().

◆ remove_edge()

void fawkes::NavGraphTimedReservationListEdgeConstraint::remove_edge ( const fawkes::NavGraphEdge edge)

Remove a single edge from the constraint list.

Parameters
edgeedge to remote

Definition at line 148 of file timed_reservation_list_edge_constraint.cpp.


The documentation for this class was generated from the following files: