Fawkes API  Fawkes Development Version
fawkes::NavGraphNodeConstraint Class Referenceabstract

Constraint that can be queried to check if a node is blocked. More...

#include <>>

Inheritance diagram for fawkes::NavGraphNodeConstraint:

Public Member Functions

 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...
 
virtual bool compute (void) throw ()
 Perform compuations before graph search and to indicate re-planning. More...
 
virtual bool blocks (const fawkes::NavGraphNode &node)=0 throw ()
 Check if constraint blocks a node. More...
 
bool operator== (const std::string &name) const
 Check if constraint matches name. More...
 

Protected Attributes

std::string name_
 Name of constraint. More...
 

Detailed Description

Constraint that can be queried to check if a node is blocked.

Author
Sebastian Reuter
Tim Niemueller

Definition at line 37 of file node_constraint.h.

Constructor & Destructor Documentation

◆ NavGraphNodeConstraint() [1/2]

fawkes::NavGraphNodeConstraint::NavGraphNodeConstraint ( const std::string &  name)

Constructor.

Parameters
namename of node constraint

Definition at line 51 of file node_constraint.cpp.

References name(), and name_.

◆ NavGraphNodeConstraint() [2/2]

fawkes::NavGraphNodeConstraint::NavGraphNodeConstraint ( const char *  name)

Constructor.

Parameters
namename of node constraint

Definition at line 59 of file node_constraint.cpp.

References name(), and name_.

◆ ~NavGraphNodeConstraint()

fawkes::NavGraphNodeConstraint::~NavGraphNodeConstraint ( )
virtual

Virtual empty destructor.

Definition at line 66 of file node_constraint.cpp.

Member Function Documentation

◆ blocks()

bool fawkes::NavGraphNodeConstraint::blocks ( const fawkes::NavGraphNode node)
throw (
)
pure 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

Implemented in fawkes::NavGraphStaticListNodeConstraint, fawkes::NavGraphTimedReservationListNodeConstraint, and fawkes::NavGraphPolygonNodeConstraint.

◆ compute()

bool fawkes::NavGraphNodeConstraint::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 in fawkes::NavGraphStaticListNodeConstraint, fawkes::NavGraphTimedReservationListNodeConstraint, and fawkes::NavGraphPolygonNodeConstraint.

Definition at line 99 of file node_constraint.cpp.

◆ name()

std::string fawkes::NavGraphNodeConstraint::name ( )

Get name of constraint.

Returns
name of constraint

Definition at line 74 of file node_constraint.cpp.

References name_.

Referenced by NavGraphStaticConstraintsThread::finalize(), NavGraphNodeConstraint(), and operator==().

◆ operator==()

bool fawkes::NavGraphNodeConstraint::operator== ( const std::string &  name) const

Check if constraint matches name.

Parameters
namename string to compare this constraints name to
Returns
true if the given name is the same as this constraint's name, false otherwise

Definition at line 111 of file node_constraint.cpp.

References name(), and name_.

Member Data Documentation

◆ name_

std::string fawkes::NavGraphNodeConstraint::name_
protected

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