(C++)  1.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::planning::DomainTranslator Class Referenceabstract

#include <DomainTranslator.hh>

Collaboration diagram for grail::planning::DomainTranslator:

Public Member Functions

 DomainTranslator (MemoryPool &memory, bool isDomainReusable=true)
 
 DomainTranslator (const DomainTranslator &)=default
 
 DomainTranslator (DomainTranslator &&)=default
 
DomainTranslatoroperator= (const DomainTranslator &)=default
 
DomainTranslatoroperator= (DomainTranslator &&)=default
 
WorldState GetWorldState (AIEntity &entity, const class Goal &goal)
 
const ObjectIndexBindingGetObjectIndexBinding () const
 
virtual Plan TranslatePlan (const AIEntity &entity, const Planner::AbstractPlan &plan, const Goal &goal) const =0
 

Protected Member Functions

virtual std::vector< IPlannerObject * > GeneratePlannerObjects (AIEntity &entity, const Goal &goal)=0
 
virtual std::vector< WorldObjectTypeCreateObjectTypes (const AIEntity &entity, const Goal &goal)=0
 
virtual void AddActionTemplates (const AIEntity &entity, const std::shared_ptr< Domain > &domain, const Goal &goal)=0
 
virtual void SetWorldStateParameters (const AIEntity &entity, WorldState &state, const Goal &goal) const
 

Protected Attributes

MemoryPoolmemory
 
ObjectIndexBinding binding {}
 

Detailed Description

An abstract class to implement translating from in-game world state to plan-space world state and from abstract plan to behavior sequence.

Constructor & Destructor Documentation

grail::planning::DomainTranslator::DomainTranslator ( MemoryPool memory,
bool  isDomainReusable = true 
)

Constructs a DomainTranslator using the specified MemoryPool.

Parameters
isDomainReusable- if set to true, the planner will assume that the planning domain remains constant, meaning that addActionTemplates and createObjectTypes will be invoked only once on DomainTranslator construction

Member Function Documentation

virtual void grail::planning::DomainTranslator::AddActionTemplates ( const AIEntity entity,
const std::shared_ptr< Domain > &  domain,
const Goal goal 
)
protectedpure virtual

Inside this method, action templates for all possible actions should be added to the Domain. Use Domain::addActionTemplate

virtual std::vector<WorldObjectType> grail::planning::DomainTranslator::CreateObjectTypes ( const AIEntity entity,
const Goal goal 
)
protectedpure virtual
Returns
All possible world object types used by the planner (see WorldObjectType).
virtual std::vector<IPlannerObject*> grail::planning::DomainTranslator::GeneratePlannerObjects ( AIEntity entity,
const Goal goal 
)
protectedpure virtual

This method should return a vector of IPlannerObject instances that correspond to in-game objects. An ObjectIndexBinding instance will be created from the returned objects.

const ObjectIndexBinding & grail::planning::DomainTranslator::GetObjectIndexBinding ( ) const
Returns
the constructed (IPlannerObject <-> WorldObject) index binding
void grail::planning::DomainTranslator::SetWorldStateParameters ( const AIEntity entity,
WorldState state,
const Goal goal 
) const
protectedvirtual

Inside this method, initial abstract WorldState parameters should be set. Use state.setParameter

virtual Plan grail::planning::DomainTranslator::TranslatePlan ( const AIEntity entity,
const Planner::AbstractPlan plan,
const Goal goal 
) const
pure virtual

/return A Plan object constructed based on the Action vector provided by the planner. Keep in mind that a single Action does not have to correspond to a single Behavior - your plan translation logic can be arbitrary.


The documentation for this class was generated from the following files: