Grail (C#)  1.4.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
Grail.Planners.DomainTranslator Class Referenceabstract

An abstract class to implement that is responsible for translating an in-game world state to a plan-space world state. and from abstract plan to behavior sequence
It serves as a translation layer between the planning AI and the rest of the game. More...

Public Member Functions

 DomainTranslator (bool isDomainReusable=true)
 Constructs a DomainTranslator instance. More...
 
abstract Plan TranslatePlan (AIEntity entity, Planner.AbstractPlan plan, Goal goal)
 Creates a Behavior-based plan to apply in the game based on the plan constructed in the abstract planning space.
Keep in mind that a single Action does not have to correspond to a single Behavior - your plan translation logic can be arbitrary. More...
 
WorldState GetWorldState (AIEntity entity, Goal goal)
 

Protected Member Functions

abstract List< IPlannerObjectGeneratePlannerObjects (AIEntity entity, Goal goal)
 
abstract List< WorldObjectTypeCreateObjectTypes (AIEntity entity, Goal goal)
 
abstract void AddActionTemplates (AIEntity entity, Domain domain, Goal goal)
 
virtual void SetWorldStateParameters (AIEntity entity, WorldState state, Goal goal)
 Inside this method, the initial WorldState parameters should be set. Use state.SetParameter. More...
 

Properties

ObjectIndexBinding Binding [get]
 Returns the (IPlannerObject <-> WorldObject) index binding. More...
 

Detailed Description

An abstract class to implement that is responsible for translating an in-game world state to a plan-space world state. and from abstract plan to behavior sequence
It serves as a translation layer between the planning AI and the rest of the game.

Constructor & Destructor Documentation

◆ DomainTranslator()

Grail.Planners.DomainTranslator.DomainTranslator ( bool  isDomainReusable = true)
inline

Constructs a DomainTranslator instance.

Parameters
isDomainReusableif set to true, the planner will assume that the planning domain remains constant and can be reused - as a result addActionTemplates and createObjectTypes will be invoked only once.

Member Function Documentation

◆ AddActionTemplates()

abstract void Grail.Planners.DomainTranslator.AddActionTemplates ( AIEntity  entity,
Domain  domain,
Goal  goal 
)
protectedpure virtual

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

◆ CreateObjectTypes()

abstract List<WorldObjectType> Grail.Planners.DomainTranslator.CreateObjectTypes ( AIEntity  entity,
Goal  goal 
)
protectedpure virtual
Returns
All possible world object types used by the planner (see WorldObjectType).

◆ GeneratePlannerObjects()

abstract List<IPlannerObject> Grail.Planners.DomainTranslator.GeneratePlannerObjects ( AIEntity  entity,
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.

◆ SetWorldStateParameters()

virtual void Grail.Planners.DomainTranslator.SetWorldStateParameters ( AIEntity  entity,
WorldState  state,
Goal  goal 
)
inlineprotectedvirtual

Inside this method, the initial WorldState parameters should be set. Use state.SetParameter.

Parameters
entityThe AIEntity which uses the planner.
stateThe current state in the planning space.
goalThe goal to plan actions to.

◆ TranslatePlan()

abstract Plan Grail.Planners.DomainTranslator.TranslatePlan ( AIEntity  entity,
Planner.AbstractPlan  plan,
Goal  goal 
)
pure virtual

Creates a Behavior-based plan to apply in the game based on the plan constructed in the abstract planning space.
Keep in mind that a single Action does not have to correspond to a single Behavior - your plan translation logic can be arbitrary.

Parameters
entityThe AIEntity that utilizes planning for behavior selection.
planThe abstract plan (from the planning space).
goalThe goal for which the plan was constructed.
Returns
A Plan object constructed based on the Action vector provided by the planner.

Property Documentation

◆ Binding

ObjectIndexBinding Grail.Planners.DomainTranslator.Binding
get

Returns the (IPlannerObject <-> WorldObject) index binding.


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