Fawkes API  Fawkes Development Version
fawkes::NavGraphEdgeConstraint Class Referenceabstract

Constraint that can be queried to check if an edge is blocked. More...

#include <>>

Inheritance diagram for fawkes::NavGraphEdgeConstraint:

Public Member Functions

 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...
 
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)=0 throw ()
 Check if constraint blocks an edge. 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 an edge is blocked.

Author
Sebastian Reuter
Tim Niemueller

Definition at line 37 of file edge_constraint.h.

Constructor & Destructor Documentation

◆ NavGraphEdgeConstraint() [1/2]

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

Constructor.

Parameters
namename of edge constraint

Definition at line 59 of file edge_constraint.cpp.

References name(), and name_.

◆ NavGraphEdgeConstraint() [2/2]

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

Constructor.

Parameters
namename of edge constraint

Definition at line 67 of file edge_constraint.cpp.

References name(), and name_.

◆ ~NavGraphEdgeConstraint()

fawkes::NavGraphEdgeConstraint::~NavGraphEdgeConstraint ( )
virtual

Virtual empty destructor.

Definition at line 74 of file edge_constraint.cpp.

Member Function Documentation

◆ blocks()

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

Implemented in fawkes::NavGraphStaticListEdgeConstraint, fawkes::NavGraphTimedReservationListEdgeConstraint, fawkes::NavGraphPolygonEdgeConstraint, and NavGraphClustersBlockConstraint.

◆ compute()

bool fawkes::NavGraphEdgeConstraint::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::NavGraphStaticListEdgeConstraint, fawkes::NavGraphTimedReservationListEdgeConstraint, fawkes::NavGraphPolygonEdgeConstraint, and NavGraphClustersBlockConstraint.

Definition at line 107 of file edge_constraint.cpp.

◆ name()

std::string fawkes::NavGraphEdgeConstraint::name ( )

Get name of constraint.

Returns
name of constraint

Definition at line 82 of file edge_constraint.cpp.

References name_.

Referenced by NavGraphStaticConstraintsThread::finalize(), ClipsNavGraphThread::finalize(), NavGraphClustersThread::finalize(), NavGraphEdgeConstraint(), and operator==().

◆ operator==()

bool fawkes::NavGraphEdgeConstraint::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 119 of file edge_constraint.cpp.

References name(), and name_.

Member Data Documentation

◆ name_

std::string fawkes::NavGraphEdgeConstraint::name_
protected

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