Fawkes API
Fawkes Development Version
|
22 #ifndef _NAVGRAPH_CONSTRAINTS_CONSTRAINT_REPO_H_
23 #define _NAVGRAPH_CONSTRAINTS_CONSTRAINT_REPO_H_
25 #include <navgraph/constraints/edge_constraint.h>
26 #include <navgraph/constraints/edge_cost_constraint.h>
27 #include <navgraph/constraints/node_constraint.h>
28 #include <navgraph/navgraph_edge.h>
37 class NavGraphConstraintRepo
80 std::map<std::string, std::string>
blocks(
const std::vector<fawkes::NavGraphNode> &nodes);
82 std::map<std::pair<std::string, std::string>, std::string>
83 blocks(
const std::vector<fawkes::NavGraphEdge> &edges);
85 std::list<std::tuple<std::string, std::string, std::string, float>>
86 cost_factor(
const std::vector<fawkes::NavGraphEdge> &edges);
88 bool modified(
bool reset_modified =
false);
bool compute()
Call compute method on all registered constraints.
fawkes::NavGraphNodeConstraint * get_node_constraint(std::string &name)
Get a node constraint by name.
const NodeConstraintList & node_constraints() const
Get a list of registered node constraints.
void unregister_constraint(std::string name)
Unregister a constraint by name.
~NavGraphConstraintRepo()
Destructor.
bool has_constraints() const
Check if there are any constraints at all.
std::vector< fawkes::NavGraphNodeConstraint * > NodeConstraintList
List of navgraph node constraints.
float cost_factor(const fawkes::NavGraphNode &from, const fawkes::NavGraphNode &to)
Get the highest increasing cost factor for an edge.
std::vector< fawkes::NavGraphEdgeConstraint * > EdgeConstraintList
List of navgraph edge constraints.
const EdgeCostConstraintList & edge_cost_constraints() const
Get a list of registered edge cost constraints.
NavGraphConstraintRepo()
Constructor.
NavGraphNodeConstraint * blocks(const fawkes::NavGraphNode &node)
Check if any constraint in the repo blocks the node.
const EdgeConstraintList & edge_constraints() const
Get a list of registered edge constraints.
fawkes::NavGraphEdgeCostConstraint * get_edge_cost_constraint(std::string &name)
Get an edge cost constraint by name.
bool modified(bool reset_modified=false)
Check if the constraint repo has been modified.
NavGraphEdgeCostConstraint * increases_cost(const fawkes::NavGraphNode &from, const fawkes::NavGraphNode &to)
Check if any constraint in the repo increases the cost of the edge.
void register_constraint(NavGraphNodeConstraint *constraint)
Register a constraint.
bool has_constraint(std::string &name)
Check by name if a constraint has been registered.
fawkes::NavGraphEdgeConstraint * get_edge_constraint(std::string &name)
Get an edge constraint by name.
std::vector< fawkes::NavGraphEdgeCostConstraint * > EdgeCostConstraintList
List of navgraph edge cost constraints.