Fawkes API  Fawkes Development Version
fawkes::NavGraphTimedReservationListNodeConstraint Class Reference

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

#include <>>

Inheritance diagram for fawkes::NavGraphTimedReservationListNodeConstraint:

Public Member Functions

 NavGraphTimedReservationListNodeConstraint (Logger *logger, std::string constraint_name, fawkes::Clock *clock)
 Constructor. More...
 
 NavGraphTimedReservationListNodeConstraint (Logger *logger, std::string constraint_name, fawkes::Clock *clock, std::vector< std::pair< fawkes::NavGraphNode, fawkes::Time >> node_time_list)
 Constructor. More...
 
virtual ~NavGraphTimedReservationListNodeConstraint ()
 Virtual empty destructor. More...
 
const std::vector< std::pair< fawkes::NavGraphNode, fawkes::Time > > & node_time_list () const
 Get list of blocked nodes. More...
 
void add_node (const fawkes::NavGraphNode &node, const fawkes::Time valid_time)
 Add a single node to constraint list. More...
 
void add_nodes (const std::vector< std::pair< fawkes::NavGraphNode, fawkes::Time >> &timed_nodes)
 Add multiple nodes to constraint list. More...
 
void remove_node (const fawkes::NavGraphNode &node)
 Remove a single node from the constraint list. More...
 
void clear_nodes ()
 Remove all nodes. More...
 
bool has_node (const fawkes::NavGraphNode &node)
 Check if constraint has a specific node. More...
 
virtual bool compute (void) throw ()
 Perform compuations before graph search and to indicate re-planning. More...
 
virtual bool blocks (const fawkes::NavGraphNode &node) throw ()
 Check if constraint blocks a node. More...
 
- Public Member Functions inherited from fawkes::NavGraphNodeConstraint
 NavGraphNodeConstraint (const std::string &name)
 Constructor. More...
 
 NavGraphNodeConstraint (const char *name)
 Constructor. More...
 
virtual ~NavGraphNodeConstraint ()
 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::NavGraphNodeConstraint
std::string name_
 Name of constraint. More...
 

Detailed Description

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

Author
Sebastian Reuter
Tim Niemueller

Definition at line 38 of file timed_reservation_list_node_constraint.h.

Constructor & Destructor Documentation

◆ NavGraphTimedReservationListNodeConstraint() [1/2]

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

Constructor.

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

Definition at line 44 of file timed_reservation_list_node_constraint.cpp.

◆ NavGraphTimedReservationListNodeConstraint() [2/2]

fawkes::NavGraphTimedReservationListNodeConstraint::NavGraphTimedReservationListNodeConstraint ( Logger logger,
std::string  name,
fawkes::Clock clock,
std::vector< std::pair< fawkes::NavGraphNode, fawkes::Time >>  node_time_list 
)

Constructor.

Parameters
loggerlogger used for debug logging
namename of node constraint
clocktime source to evaluate constraint timeouts
node_time_listlist of nodes with valid_time

Definition at line 58 of file timed_reservation_list_node_constraint.cpp.

◆ ~NavGraphTimedReservationListNodeConstraint()

fawkes::NavGraphTimedReservationListNodeConstraint::~NavGraphTimedReservationListNodeConstraint ( )
virtual

Virtual empty destructor.

Definition at line 70 of file timed_reservation_list_node_constraint.cpp.

Member Function Documentation

◆ add_node()

void fawkes::NavGraphTimedReservationListNodeConstraint::add_node ( const fawkes::NavGraphNode node,
const fawkes::Time  valid_time 
)

Add a single node to constraint list.

Parameters
nodenode to add to constraint list
valid_timevalid time for this node

Definition at line 109 of file timed_reservation_list_node_constraint.cpp.

References add_nodes(), has_node(), fawkes::Time::in_sec(), fawkes::Logger::log_warn(), fawkes::NavGraphNode::name(), and fawkes::NavGraphNodeConstraint::name_.

Referenced by add_nodes().

◆ add_nodes()

void fawkes::NavGraphTimedReservationListNodeConstraint::add_nodes ( const std::vector< std::pair< fawkes::NavGraphNode, fawkes::Time >> &  timed_nodes)

Add multiple nodes to constraint list.

Parameters
timed_nodesnodes with timeout to add to constraint list

Definition at line 132 of file timed_reservation_list_node_constraint.cpp.

References add_node().

Referenced by add_node().

◆ blocks()

bool fawkes::NavGraphTimedReservationListNodeConstraint::blocks ( const fawkes::NavGraphNode node)
throw (
)
virtual

Check if constraint blocks a node.

This method must be implemented by constraint classes. It is called to determine if a node should be considered blocked and therefore cannot be expanded during path search. Note that the method may not throw an exception. Handle this internally appropriately.

Parameters
nodenode to check for expansion
Returns
true if the node should be considered blocked, false otherwise

Implements fawkes::NavGraphNodeConstraint.

Definition at line 177 of file timed_reservation_list_node_constraint.cpp.

◆ clear_nodes()

void fawkes::NavGraphTimedReservationListNodeConstraint::clear_nodes ( )

Remove all nodes.

Definition at line 200 of file timed_reservation_list_node_constraint.cpp.

◆ compute()

bool fawkes::NavGraphTimedReservationListNodeConstraint::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::NavGraphNodeConstraint.

Definition at line 76 of file timed_reservation_list_node_constraint.cpp.

References fawkes::Logger::log_debug(), and fawkes::NavGraphNodeConstraint::name_.

◆ has_node()

bool fawkes::NavGraphTimedReservationListNodeConstraint::has_node ( const fawkes::NavGraphNode node)

Check if constraint has a specific node.

Parameters
nodenode to check
Returns
true if node is in list, false otherwise

Definition at line 167 of file timed_reservation_list_node_constraint.cpp.

Referenced by add_node().

◆ node_time_list()

const std::vector< std::pair< fawkes::NavGraphNode, fawkes::Time > > & fawkes::NavGraphTimedReservationListNodeConstraint::node_time_list ( ) const

Get list of blocked nodes.

Returns
list of blocked nodes

Definition at line 192 of file timed_reservation_list_node_constraint.cpp.

◆ remove_node()

void fawkes::NavGraphTimedReservationListNodeConstraint::remove_node ( const fawkes::NavGraphNode node)

Remove a single node from the constraint list.

Parameters
nodenode to remote

Definition at line 147 of file timed_reservation_list_node_constraint.cpp.


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