libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
taskSolution.hpp
1 #ifndef TASKSOLUTION_H
2 #define TASKSOLUTION_H
3 
4 #include "taskAllSolutions.hpp"
5 #include "taskSubSolution.hpp"
6 
7 class TaskSubSolution;
8 
10 {
11  MOVE3D_STATIC_LOGGER;
12 public:
13  TaskSolution(TaskAllSolutions* taskAS, int id);
14  TaskSolution();
15  ~TaskSolution();
16 
17 
18  TaskSubSolution* getFirstSubSolution();
19  TaskSubSolution* getNextSubSolution(TaskSubSolution *ts);
20  TaskSubSolution* getSubSolutionWithId(int subId);
21 
22  int getId() {return alternativeId;}
23  void setId(int altId) {alternativeId = altId;}
24 
25  int getNbsubSolPerRobot(Robot* rob);
26  std::vector<TaskSubSolution*> getTSSByRobot(Robot* rob);
27  std::vector<TaskSubSolution*> getAllTSS();
28  std::vector<Robot*> getInvolvedRobots();
29 
30  void setTaskAllSolutions(TaskAllSolutions *TAS){_TAS=TAS;}
31  Task* getTask();
32 
33  bool isInPreviousDoneTSS(TaskSubSolution* tss);
34  void addToPreviousDoneTSS(TaskSubSolution* tss);
35 
36  void setStartWS(WorldState* start_WS) { _start_WS = start_WS;}
37  WorldState* getStartWS() {return _start_WS;}
38 
39  void setStopWS(WorldState* end_WS) { _end_WS = end_WS;}
40  WorldState* getStopWS() {return _end_WS;}
41 
42  bool isTrajComputed() {return _trajComputed;}
43  void setTrajComputed(bool val) {_trajComputed = val;}
44 
45  TaskConstraints* getTaskConstraints() {return _constraint;}
46  void setTaskConstraints(TaskConstraints* TC) {_constraint = TC;}
47 
48  void addToSolutions(TaskSubSolution* tss);
49 
50  double getDuration();
51 
52  double getCost() {return _cost;}
53  void setCost(double c) { _cost = c;}
54 
55  void addConf(confPtr_t q);
56  confPtr_t getNextConf();
57 
58  type_data getTypeData() {return _TData;}
59  void addTypeData(type_data td);
60  void clearTypeData();
61 
62 
63 private:
64  std::map<Robot*,std::vector<TaskSubSolution*> > solutionMap;
65  int alternativeId;
66  TaskAllSolutions* _TAS;
67 
68  std::vector<TaskSubSolution*> PreviousDoneTSS;
69 
70  WorldState* _start_WS;
71  WorldState* _end_WS;
72 
73  bool _trajComputed;
74 
75  TaskConstraints* _constraint;
76 
77  double _cost;
78 
79  std::vector<confPtr_t> importantConfs;
80  unsigned int importantConfsId;
81 
82  type_data _TData;
83 
84 };
85 #endif // TASKSOLUTION_H
Definition: taskSolution.hpp:9
Definition: taskConstraints.hpp:34
Definition: taskSubSolution.hpp:10
Definition: structTools.hpp:54
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
Definition: worldState.hpp:30
Definition: taskAllSolutions.hpp:7
Definition: task.hpp:44