Fawkes API  Fawkes Development Version
fawkes::NavGraphStaticListNodeConstraint Class Reference

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

#include <>>

Inheritance diagram for fawkes::NavGraphStaticListNodeConstraint:

Public Member Functions

 NavGraphStaticListNodeConstraint (std::string name)
 Constructor. More...
 
 NavGraphStaticListNodeConstraint (std::string name, std::vector< fawkes::NavGraphNode > &node_list)
 Constructor. More...
 
virtual ~NavGraphStaticListNodeConstraint ()
 Virtual empty destructor. More...
 
const std::vector< fawkes::NavGraphNode > & node_list () const
 Get list of blocked nodes. More...
 
void add_node (const fawkes::NavGraphNode &node)
 Add a single node to constraint list. More...
 
void add_nodes (const std::vector< fawkes::NavGraphNode > &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...
 

Protected Attributes

std::vector< fawkes::NavGraphNodenode_list_
 Node list. More...
 
bool modified_
 Set to true if changes are made to the constraint. More...
 
- Protected Attributes inherited from fawkes::NavGraphNodeConstraint
std::string name_
 Name of constraint. More...
 

Detailed Description

Constraint that holds a list of nodes to block.

Author
Sebastian Reuter

Definition at line 38 of file static_list_node_constraint.h.

Constructor & Destructor Documentation

◆ NavGraphStaticListNodeConstraint() [1/2]

fawkes::NavGraphStaticListNodeConstraint::NavGraphStaticListNodeConstraint ( std::string  name)

Constructor.

Parameters
namename of node constraint

Definition at line 41 of file static_list_node_constraint.cpp.

References modified_.

◆ NavGraphStaticListNodeConstraint() [2/2]

fawkes::NavGraphStaticListNodeConstraint::NavGraphStaticListNodeConstraint ( std::string  name,
std::vector< fawkes::NavGraphNode > &  node_list 
)

Constructor.

Parameters
namename of node constraint
node_listlist of nodes to block

Definition at line 53 of file static_list_node_constraint.cpp.

References modified_, node_list(), and node_list_.

◆ ~NavGraphStaticListNodeConstraint()

fawkes::NavGraphStaticListNodeConstraint::~NavGraphStaticListNodeConstraint ( )
virtual

Virtual empty destructor.

Definition at line 63 of file static_list_node_constraint.cpp.

Member Function Documentation

◆ add_node()

void fawkes::NavGraphStaticListNodeConstraint::add_node ( const fawkes::NavGraphNode node)

Add a single node to constraint list.

Parameters
nodenode to add to constraint list

Definition at line 84 of file static_list_node_constraint.cpp.

References has_node(), modified_, and node_list_.

Referenced by add_nodes(), and NavGraphStaticConstraintsThread::init().

◆ add_nodes()

void fawkes::NavGraphStaticListNodeConstraint::add_nodes ( const std::vector< fawkes::NavGraphNode > &  nodes)

Add multiple nodes to constraint list.

Parameters
nodesnodes to add to constraint list

Definition at line 96 of file static_list_node_constraint.cpp.

References add_node().

◆ blocks()

virtual bool fawkes::NavGraphStaticListNodeConstraint::blocks ( const fawkes::NavGraphNode node)
throw (
)
inlinevirtual

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 58 of file static_list_node_constraint.h.

References has_node().

◆ clear_nodes()

void fawkes::NavGraphStaticListNodeConstraint::clear_nodes ( )

Remove all nodes.

Definition at line 141 of file static_list_node_constraint.cpp.

References modified_, and node_list_.

◆ compute()

bool fawkes::NavGraphStaticListNodeConstraint::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 69 of file static_list_node_constraint.cpp.

References modified_.

◆ has_node()

bool fawkes::NavGraphStaticListNodeConstraint::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 123 of file static_list_node_constraint.cpp.

References node_list_.

Referenced by add_node(), and blocks().

◆ node_list()

const std::vector< fawkes::NavGraphNode > & fawkes::NavGraphStaticListNodeConstraint::node_list ( ) const

Get list of blocked nodes.

Returns
list of blocked nodes

Definition at line 133 of file static_list_node_constraint.cpp.

References node_list_.

Referenced by NavGraphStaticListNodeConstraint().

◆ remove_node()

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

Remove a single node from the constraint list.

Parameters
nodenode to remote

Definition at line 108 of file static_list_node_constraint.cpp.

References modified_, and node_list_.

Member Data Documentation

◆ modified_

bool fawkes::NavGraphStaticListNodeConstraint::modified_
protected

Set to true if changes are made to the constraint.

Definition at line 63 of file static_list_node_constraint.h.

Referenced by add_node(), clear_nodes(), compute(), NavGraphStaticListNodeConstraint(), and remove_node().

◆ node_list_

std::vector<fawkes::NavGraphNode> fawkes::NavGraphStaticListNodeConstraint::node_list_
protected

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