(C++)  1.0.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
DomainTranslator.hh
1 #ifndef GRAIL_DOMAIN_TRANSLATOR_H
2 #define GRAIL_DOMAIN_TRANSLATOR_H
3 
4 #include "IPlannerObject.hh"
5 #include "ObjectIndexBinding.hh"
6 #include "../GrailSystem/Behavior.hh"
7 #include "../GrailSystem/Plan.hh"
8 
9 
10 namespace grail
11 {
12  namespace planning
13  {
14  class Goal;
15 
19  {
20  public:
24  DomainTranslator(MemoryPool& memory, bool isDomainReusable = true);
25  DomainTranslator(const DomainTranslator&) = default;
27 
28  virtual ~DomainTranslator() = default;
29 
30  DomainTranslator& operator = (const DomainTranslator&) = default;
31  DomainTranslator& operator = (DomainTranslator&&) = default;
32 
33  WorldState GetWorldState(AIEntity& entity, const class Goal& goal);
34 
37 
41  virtual Plan TranslatePlan(const AIEntity& entity, const Planner::AbstractPlan& plan, const Goal& goal) const = 0;
42 
43  protected:
46  virtual std::vector<IPlannerObject*> GeneratePlannerObjects(AIEntity& entity, const Goal& goal) = 0;
47 
49  virtual std::vector<WorldObjectType> CreateObjectTypes(const AIEntity& entity, const Goal& goal) = 0;
50 
53  virtual void AddActionTemplates(const AIEntity& entity, const std::shared_ptr<Domain>& domain, const Goal& goal) = 0;
54 
57  virtual void SetWorldStateParameters(const AIEntity& entity, WorldState& state, const Goal& goal) const;
58 
59  MemoryPool& memory;
60  ObjectIndexBinding binding{};
61 
62 
63  private:
64  bool isDomainReusable = false;
65  std::shared_ptr<Domain> domain = nullptr;
66 
67  };
68  }
69 }
70 #endif //GRAIL_DOMAIN_TRANSLATOR_H
The AIEntity class - Defines a basic object which can execute behaviors.
Definition: AIEntity.hh:39
The MemoryPool class - preallocated memory container for optimization issues.
Definition: MemoryPool.hh:74
Definition: DomainTranslator.hh:19
virtual void AddActionTemplates(const AIEntity &entity, const std::shared_ptr< Domain > &domain, const Goal &goal)=0
const ObjectIndexBinding & GetObjectIndexBinding() const
Definition: DomainTranslator.cpp:35
virtual Plan TranslatePlan(const AIEntity &entity, const Planner::AbstractPlan &plan, const Goal &goal) const =0
virtual std::vector< WorldObjectType > CreateObjectTypes(const AIEntity &entity, const Goal &goal)=0
DomainTranslator(MemoryPool &memory, bool isDomainReusable=true)
Definition: DomainTranslator.cpp:9
virtual void SetWorldStateParameters(const AIEntity &entity, WorldState &state, const Goal &goal) const
Definition: DomainTranslator.cpp:40
virtual std::vector< IPlannerObject * > GeneratePlannerObjects(AIEntity &entity, const Goal &goal)=0
Represents a planner goal, used by PlannerReasoner.
Definition: Goal.hh:15
Definition: ObjectIndexBinding.hh:14
A data structure used by PlannerReasoner to execute a sequence of behaviors.
Definition: Plan.hh:16
A class representing planner world state.
Definition: WorldState.hh:15