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

Action object used in planning. Actions are instances constructed based on ActionTemplate. A planning entity takes actions in order to change the world state. More...

Public Member Functions

 Action (ActionTemplate actionTemplate, List< int > argumentIndices)
 Creates a new Action object based on the template. More...
 
bool IsLegal (WorldState state)
 Determines whether the action is legal (available) in the given state. More...
 
float GetCost (WorldState state)
 Returns the cost associated with this action. The costs are used by the planner's heuristic. More...
 
void ApplyToState (WorldState state)
 Applies the action's logic and modifies the state. More...
 

Public Attributes

List< int > ArgumentIndices => argumentIndices
 Returns a collection of IDs of objects that are assigned to the respective action's arguments. More...
 
string Name => actionTemplate.Name
 Gets the name of the action. More...
 
int TypeID => actionTemplate.TypeID
 Gets a unique type ID of the action. More...
 

Detailed Description

Action object used in planning. Actions are instances constructed based on ActionTemplate. A planning entity takes actions in order to change the world state.

Constructor & Destructor Documentation

◆ Action()

Grail.Planners.Action.Action ( ActionTemplate  actionTemplate,
List< int >  argumentIndices 
)
inline

Creates a new Action object based on the template.

Parameters
actionTemplateThe template (family/type) of the action; see ActionTemplate.
argumentIndicesIDs of specific objects that should be assigned as this action's parameters.

Member Function Documentation

◆ ApplyToState()

void Grail.Planners.Action.ApplyToState ( WorldState  state)
inline

Applies the action's logic and modifies the state.

Parameters
stateThe state to apply the effects of action to.

◆ GetCost()

float Grail.Planners.Action.GetCost ( WorldState  state)
inline

Returns the cost associated with this action. The costs are used by the planner's heuristic.

◆ IsLegal()

bool Grail.Planners.Action.IsLegal ( WorldState  state)
inline

Determines whether the action is legal (available) in the given state.

Parameters
state
Returns
true if the action is legal.

Member Data Documentation

◆ ArgumentIndices

List<int> Grail.Planners.Action.ArgumentIndices => argumentIndices

Returns a collection of IDs of objects that are assigned to the respective action's arguments.

◆ Name

string Grail.Planners.Action.Name => actionTemplate.Name

Gets the name of the action.

◆ TypeID

int Grail.Planners.Action.TypeID => actionTemplate.TypeID

Gets a unique type ID of the action.


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