Fawkes API  Fawkes Development Version
NavGraphClustersBlockConstraint Class Reference

Constraint to block edges close to clusters. More...

#include "clusters_block_constraint.h"

Inheritance diagram for NavGraphClustersBlockConstraint:

Public Member Functions

 NavGraphClustersBlockConstraint (const char *name, NavGraphClustersThread *parent)
 Constructor. More...
 
virtual ~NavGraphClustersBlockConstraint ()
 Virtual empty destructor. 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 to block edges close to clusters.

Author
Tim Niemueller

Definition at line 31 of file clusters_block_constraint.h.

Constructor & Destructor Documentation

◆ NavGraphClustersBlockConstraint()

NavGraphClustersBlockConstraint::NavGraphClustersBlockConstraint ( const char *  name,
NavGraphClustersThread parent 
)

Constructor.

Parameters
nameconstraint name
parentparent to call for blocked edges

Definition at line 33 of file clusters_block_constraint.cpp.

◆ ~NavGraphClustersBlockConstraint()

NavGraphClustersBlockConstraint::~NavGraphClustersBlockConstraint ( )
virtual

Virtual empty destructor.

Definition at line 41 of file clusters_block_constraint.cpp.

Member Function Documentation

◆ blocks()

bool NavGraphClustersBlockConstraint::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 55 of file clusters_block_constraint.cpp.

◆ compute()

bool NavGraphClustersBlockConstraint::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 47 of file clusters_block_constraint.cpp.

References NavGraphClustersThread::blocked_edges().


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