(C++)  1.0.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::planning::ActionTemplate Class Reference

A class representing an action that can be simulated by grail planner. More...

#include <ActionTemplate.hh>

Public Member Functions

 ActionTemplate (const std::string &name, const std::vector< unsigned int > &actionParameterTypes)
 
 ActionTemplate (ActionTemplate &&other)=default
 
void SetPreconditions (PreconditionFunction preconditionFunction)
 
void SetEffects (EffectFunction effectFunction)
 
void SetCostFunction (CostFunction costFunction)
 
void SetTypeId (int id)
 
int GetTypeId () const
 
const std::string & GetName () const
 
std::vector< class ActionGenerateActions (const class WorldState &worldState) const
 

Friends

class Action
 

Detailed Description

A class representing an action that can be simulated by grail planner.

Member Function Documentation

◆ SetCostFunction()

void grail::planning::ActionTemplate::SetCostFunction ( CostFunction  costFunction)

Sets a function returning execution cost of the action, given a world state

Parameters
costFunction- a function returing a number representing the action's cost, accepting a vector of action arguments (WorldObjects) and the current WorldState reference

◆ SetEffects()

void grail::planning::ActionTemplate::SetEffects ( EffectFunction  effectFunction)

Sets a function applied to a world state each time this action is performed in a planner iteration

Parameters
effectfunction - a function returning void and accepting a vector of action arguments (WorldObjects) and the current WorldState reference

◆ SetPreconditions()

void grail::planning::ActionTemplate::SetPreconditions ( PreconditionFunction  preconditionFunction)

Sets a precondition function that will be checked to verify legality of the action

Parameters
preconditionFunction- a boolean function accepting a vector of action arguments (WorldObjects) and the current WorldState reference

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