Fawkes API
Fawkes Development Version
|
Constraint apply a static cost factor to blocked edges. More...
#include "clusters_static_cost_constraint.h"
Public Member Functions | |
NavGraphClustersStaticCostConstraint (const char *name, NavGraphClustersThread *parent, float cost_factor) | |
Constructor. More... | |
virtual | ~NavGraphClustersStaticCostConstraint () |
Virtual empty destructor. More... | |
virtual bool | compute (void) throw () |
Perform compuations before graph search and to indicate re-planning. More... | |
virtual float | cost_factor (const fawkes::NavGraphNode &from, const fawkes::NavGraphNode &to) throw () |
Get cost factor for given edge. More... | |
![]() | |
NavGraphEdgeCostConstraint (std::string &name) | |
Constructor. More... | |
NavGraphEdgeCostConstraint (const char *name) | |
Constructor. More... | |
virtual | ~NavGraphEdgeCostConstraint () |
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 | |
![]() | |
std::string | name_ |
Name of constraint. More... | |
Constraint apply a static cost factor to blocked edges.
Definition at line 31 of file clusters_static_cost_constraint.h.
NavGraphClustersStaticCostConstraint::NavGraphClustersStaticCostConstraint | ( | const char * | name, |
NavGraphClustersThread * | parent, | ||
float | cost_factor | ||
) |
Constructor.
name | constraint name |
parent | parent to call for blocked edges |
cost_factor | cost factor to return for blocked edges |
Definition at line 34 of file clusters_static_cost_constraint.cpp.
References cost_factor().
|
virtual |
Virtual empty destructor.
Definition at line 45 of file clusters_static_cost_constraint.cpp.
|
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.
Reimplemented from fawkes::NavGraphEdgeCostConstraint.
Definition at line 51 of file clusters_static_cost_constraint.cpp.
References NavGraphClustersThread::blocked_edges().
|
virtual |
Get cost factor for given edge.
This method must be implemented by constraint classes. It is called to determine a cost factor for an edge. That is, the path costs from the originating node to the destination node are multiplied with this factor and thus the chance of following that specific edge is decreased. The factor must be greater or equal to 1. That is a requirement to keep heuristics admissible and thus the search optimal.
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.
from | node from which the edge originates |
to | node to which the edge leads |
Implements fawkes::NavGraphEdgeCostConstraint.
Definition at line 59 of file clusters_static_cost_constraint.cpp.
Referenced by NavGraphClustersStaticCostConstraint().