(C++)  1.1.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
PlannerSnapshots.h
1 #ifndef GRAIL_PLANNER_SNAPSHOT_H
2 #define GRAIL_PLANNER_SNAPSHOT_H
3 
4 #include <vector>
5 #include <map>
6 #include <limits>
7 #include <utility>
8 #include <string>
9 
10 namespace grail
11 {
12  namespace planning
13  {
14  class WorldState;
15  class Action;
16  class ParametrizedObject;
17  }
18 
22  {
23  std::string typeName;
24  unsigned int objectId = 0;
25 
27  std::map<std::string, std::string> objectData{};
28  };
29 
33  {
34  std::string name{};
35  std::vector<std::string> parametrization{};
36  std::vector<PlannerWorldObjectSnapshot> resultingWorldState{};
37 
38  PlannerActionSnapshot(const planning::Action& action, const planning::WorldState& worldState);
39  PlannerActionSnapshot() = default;
40 
41  private:
42  void AddParametrizedObjectSnapshot(const planning::ParametrizedObject& parametrizedObject,
43  unsigned int objectId, const std::string& objectName);
44 
45  };
46 
50  {
52  size_t iterationNumber = 0;
53 
55  std::vector<PlannerActionSnapshot> planActions = {};
56 
57  bool goalReached = false;
58 
60  double score = 0;
61  double totalCost = std::numeric_limits<double>::max();
62  PlannerIterationSnapshot(size_t keyIterationIndex);
63  PlannerIterationSnapshot() = default;
64  };
65 
68 
70  {
71  std::vector<PlannerIterationSnapshot> iterations = {};
72 
73  float absoluteTime = 0;
74  float relativeTime = 0;
75  size_t entityId = 0;
76  };
77 }
78 #endif
Definition: Action.hh:11
Definition: ParametrizedObject.h:21
A class representing planner world state.
Definition: WorldState.hh:15
Definition: PlannerSnapshots.h:33
Definition: PlannerSnapshots.h:50
double score
Heuristic score of the plan.
Definition: PlannerSnapshots.h:60
size_t iterationNumber
The object contains info about iteration with number = IterationNumber.
Definition: PlannerSnapshots.h:52
std::vector< PlannerActionSnapshot > planActions
In the serialized iteration, the plan consists of planActions.
Definition: PlannerSnapshots.h:55
Definition: PlannerSnapshots.h:70
Definition: PlannerSnapshots.h:22
std::map< std::string, std::string > objectData
Internal state of the WorldObject.
Definition: PlannerSnapshots.h:27