Fawkes API  Fawkes Development Version
fawkes::NavGraphStaticListEdgeConstraint Class Reference

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

#include <>>

Inheritance diagram for fawkes::NavGraphStaticListEdgeConstraint:

Public Member Functions

 NavGraphStaticListEdgeConstraint (std::string name)
 Constructor. More...
 
 NavGraphStaticListEdgeConstraint (std::string name, std::vector< fawkes::NavGraphEdge > &edge_list)
 Constructor. More...
 
virtual ~NavGraphStaticListEdgeConstraint ()
 Virtual empty destructor. More...
 
const std::vector< fawkes::NavGraphEdge > & edge_list () const
 Get list of blocked edges. More...
 
void add_edge (const fawkes::NavGraphEdge &edge)
 Add a single edge to constraint list. More...
 
void add_edges (const std::vector< fawkes::NavGraphEdge > &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.

Author
Sebastian Reuter
Tim Niemueller

Definition at line 38 of file static_list_edge_constraint.h.

Constructor & Destructor Documentation

◆ NavGraphStaticListEdgeConstraint() [1/2]

fawkes::NavGraphStaticListEdgeConstraint::NavGraphStaticListEdgeConstraint ( std::string  name)

Constructor.

Parameters
namename of edge constraint

Definition at line 42 of file static_list_edge_constraint.cpp.

◆ NavGraphStaticListEdgeConstraint() [2/2]

fawkes::NavGraphStaticListEdgeConstraint::NavGraphStaticListEdgeConstraint ( std::string  name,
std::vector< fawkes::NavGraphEdge > &  edge_list 
)

Constructor.

Parameters
namename of edge constraint
edge_listlist of edges to block

Definition at line 54 of file static_list_edge_constraint.cpp.

References edge_list().

◆ ~NavGraphStaticListEdgeConstraint()

fawkes::NavGraphStaticListEdgeConstraint::~NavGraphStaticListEdgeConstraint ( )
virtual

Virtual empty destructor.

Definition at line 64 of file static_list_edge_constraint.cpp.

Member Function Documentation

◆ add_edge()

void fawkes::NavGraphStaticListEdgeConstraint::add_edge ( const fawkes::NavGraphEdge edge)

Add a single edge to constraint list.

Parameters
edgeedge to add to constraint list

Definition at line 85 of file static_list_edge_constraint.cpp.

References has_edge().

Referenced by add_edges(), ClipsNavGraphThread::clips_context_destroyed(), and NavGraphStaticConstraintsThread::init().

◆ add_edges()

void fawkes::NavGraphStaticListEdgeConstraint::add_edges ( const std::vector< fawkes::NavGraphEdge > &  edges)

Add multiple edges to constraint list.

Parameters
edgesedges to add to constraint list

Definition at line 97 of file static_list_edge_constraint.cpp.

References add_edge().

◆ blocks()

bool fawkes::NavGraphStaticListEdgeConstraint::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 152 of file static_list_edge_constraint.cpp.

◆ clear_edges()

void fawkes::NavGraphStaticListEdgeConstraint::clear_edges ( )

Remove all edges.

Definition at line 142 of file static_list_edge_constraint.cpp.

◆ compute()

bool fawkes::NavGraphStaticListEdgeConstraint::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 70 of file static_list_edge_constraint.cpp.

◆ edge_list()

const std::vector< fawkes::NavGraphEdge > & fawkes::NavGraphStaticListEdgeConstraint::edge_list ( ) const

Get list of blocked edges.

Returns
list of blocked edges

Definition at line 134 of file static_list_edge_constraint.cpp.

Referenced by NavGraphStaticListEdgeConstraint().

◆ has_edge()

bool fawkes::NavGraphStaticListEdgeConstraint::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 124 of file static_list_edge_constraint.cpp.

Referenced by add_edge().

◆ remove_edge()

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

Remove a single edge from the constraint list.

Parameters
edgeedge to remote

Definition at line 109 of file static_list_edge_constraint.cpp.

Referenced by ClipsNavGraphThread::clips_context_destroyed().


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