#include <ActionTemplate.hh>
|
| ActionTemplate (const std::string &name, const std::vector< unsigned int > &actionParameterTypes, PreconditionFunction preconditionFunction, EffectFunction effectFunction, CostFunction costFunction) |
|
| ActionTemplate (ActionTemplate &&other)=default |
|
int | GetTypeId () const |
|
const std::string & | GetName () const |
|
std::vector< class Action > | GenerateActions (const class WorldState &worldState) const |
|
A class representing a model (family) of an action that can be simulated by a planner. "Action" objects are produced based on the "ActionTemplate".
◆ ActionTemplate()
grail::planner::ActionTemplate::ActionTemplate |
( |
const std::string & |
name, |
|
|
const std::vector< unsigned int > & |
actionParameterTypes, |
|
|
PreconditionFunction |
preconditionFunction, |
|
|
EffectFunction |
effectFunction, |
|
|
CostFunction |
costFunction |
|
) |
| |
Constructor
- Parameters
-
name | - the name of this family of actions. |
actionParameterTypes | - IDs of types of objects that are parameters of the actions instantiated using this template. E.g. name=attack; actionParameterTypes={enemyTypeIDs} |
preconditionFunction | - a boolean function accepting a vector of action arguments (WorldObjects) and the current WorldState reference |
effectFunction | - a function returning void and accepting a vector of action arguments (WorldObjects) and the current WorldState reference |
costFunction | - a function returning a number representing the action's cost, accepting a vector of action arguments (WorldObjects) and the current WorldState reference |
◆ GenerateActions()
std::vector< Action > grail::planner::ActionTemplate::GenerateActions |
( |
const class WorldState & |
worldState | ) |
const |
Generates all action instances based on the action template and the given state.
- Parameters
-
worldState | - the current state of the planner. |
- Returns
- A list of actions with parameters that could be generated in the current state of the planner.
◆ GetName()
const std::string & grail::planner::ActionTemplate::GetName |
( |
| ) |
const |
Gets a log-friendly name of the actions produced by the template.
- Returns
- Name of the actions produced by the template.
◆ GetTypeId()
int grail::planner::ActionTemplate::GetTypeId |
( |
| ) |
const |
A unique ID of the action template.
- Returns
- A unique ID of the action template.
The documentation for this class was generated from the following files:
- GrailPlanners/Planner/Action/ActionTemplate.hh
- GrailPlanners/Planner/Action/ActionTemplate.cpp