Fawkes API  Fawkes Development Version
edge_cost_constraint.h
1 /***************************************************************************
2  * edge_cost_constraint.h - base class for edge cost constraints
3  *
4  * Created: Fri Jul 18 12:08:41 2014
5  * Copyright 2014 Tim Niemueller
6  ****************************************************************************/
7 
8 /* This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Library General Public License for more details.
17  *
18  * Read the full text in the LICENSE.GPL file in the doc directory.
19  */
20 
21 #ifndef __NAVGRAPH_CONSTRAINTS_EDGE_COST_CONSTRAINT_H_
22 #define __NAVGRAPH_CONSTRAINTS_EDGE_COST_CONSTRAINT_H_
23 
24 #include <vector>
25 #include <string>
26 
27 #include <navgraph/navgraph_node.h>
28 
29 namespace fawkes{
30 #if 0 /* just to make Emacs auto-indent happy */
31 }
32 #endif
33 
34 class Logger;
35 
37 {
38  public:
39  NavGraphEdgeCostConstraint(std::string &name);
40  NavGraphEdgeCostConstraint(const char *name);
42 
43  std::string name();
44 
45  virtual bool compute(void) throw();
46  virtual float cost_factor(const fawkes::NavGraphNode &from,
47  const fawkes::NavGraphNode &to) throw() = 0;
48 
49  bool operator==(const std::string &name) const;
50 
51  protected:
52  std::string name_;
53 
54 };
55 
56 } // end namespace fawkes
57 
58 #endif
virtual ~NavGraphEdgeCostConstraint()
Virtual empty destructor.
NavGraphEdgeCostConstraint(std::string &name)
Constructor.
Fawkes library namespace.
Constraint that can be queried for an edge cost factor.
virtual bool compute(void)
Perform compuations before graph search and to indicate re-planning.
virtual float cost_factor(const fawkes::NavGraphNode &from, const fawkes::NavGraphNode &to)=0
Get cost factor for given edge.
std::string name_
Name of constraint.
Topological graph node.
Definition: navgraph_node.h:38
bool operator==(const std::string &name) const
Check if constraint matches name.
std::string name()
Get name of constraint.