libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
graphupdater.hpp
1 #ifndef GRAPHUPDATER_HPP
2 #define GRAPHUPDATER_HPP
3 
4 #include "API/Roadmap/node.hpp"
5 #include "API/Roadmap/edge.hpp"
6 #include "API/Trajectory/trajectory.hpp"
7 #include "API/Roadmap/graph.hpp"
8 #include <vector>
9 #include <set>
10 
11 using namespace std;
12 using namespace API;
13 
15 {
16 public:
17 
18  //contructors and destructor
19  GraphUpdater(Graph * graph);
20 
21  double reduction(unsigned int param);
22 
23  bool connexity(unsigned int param);
24  bool coverage(unsigned int param);
25 
26  bool correction(unsigned int param, double timelimit = -1);
27  bool correction(Node* from, unsigned int param, double timelimit = -1);
28  bool correction(confPtr_t from, unsigned int param, double timelimit = -1);
29 
30  vector<vector<Node*> > getAvailableTrajectories(confPtr_t from, bool computeNew = false);
31  vector<vector<Node*> > getAvailableTrajectories(Node* from, bool computeNew = false);
32 
33  Trajectory* getBestTrajectory(confPtr_t from, bool updateEnv = true);
34  Trajectory* getBestTrajectory(Node* from, bool updateEnv = true);
35 
36  vector<Trajectory*> getTrajectories();
37 
38  void setCurrentTrajectory(Trajectory* trajectory);
39  Trajectory* getCurrentTrajectory();
40 
41  void setCurrentConfiguration(confPtr_t configuration);
42  Node* getPrevNode();
43  Node* getNextNode();
44 
45 private:
46  Graph* graph;
47  Node* start;
48  Node* goal;
49 
50  Trajectory* currentTrajectory;
51  confPtr_t currentConfiguration;
52  Node* prevNode;
53  Node* nextNode;
54 
55  vector< vector<Node*> > trajectories;
56 
57  void updateTrajectories();
58  vector<Node*> getChildrenOf(Graph* graph, vector<Node*> nodes);
59  vector<Node*> getParentOf(Graph* graph, vector<Node*> nodes);
60  unsigned int connectNodes(vector<Node*> nodes);
61 };
62 
63 extern GraphUpdater* API_activeGraphUpdater;
64 
65 #endif
Classe représentant un Node d'un Graph.
Definition: node.hpp:39
Definition: graph.hpp:28
Definition: trajectory.hpp:40
Definition: graphupdater.hpp:14