A class representing a model (family) of an action that can be simulated by a planner. Action objects are produced based on the ActionTemplate.
More...
|
| string | Name => name |
| | Gets a log-friendly name of the actions produced by the template. More...
|
| |
|
| PreconditionFunction | Preconditions [get, set] |
| | A precondition function that will be checked to verify the legality of the action. Represented as a boolean function accepting a vector of action arguments (WorldObjects) and the current WorldState reference. More...
|
| |
| EffectFunction | Effects [get, set] |
| | A function applied to the world state each time this action is performed in a planner iteration. Represented as a function returning void and accepting a vector of action arguments (WorldObjects) and the current WorldState reference. More...
|
| |
| CostFunction | Cost [get, set] |
| | A function returning execution cost of the action, given a world state Represented as a function returning a number representing the action's cost, accepting a vector of action arguments (WorldObjects) and the current WorldState reference More...
|
| |
| int | TypeID [get, set] |
| | A unique ID of the action template. More...
|
| |
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.Planners.ActionTemplate.ActionTemplate |
( |
string |
name, |
|
|
List< int > |
actionParameterTypes |
|
) |
| |
|
inline |
Constructs a new ActionTemplate object. After creation, please remember to assign the ConditionFunction, EffectFunction, and CostFunction.
- 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} |
◆ CostFunction()
| delegate float Grail.Planners.ActionTemplate.CostFunction |
( |
List< WorldObject > |
worldObjects, |
|
|
WorldState |
state |
|
) |
| |
Delegate for Cost; Cost.
- Parameters
-
| worldObjects | Specific objects assigned as the arguments of the action. |
| state | The current world state. Provided as the extra context. You can use both or just one of the parameters of this function. |
- Returns
◆ EffectFunction()
| delegate void Grail.Planners.ActionTemplate.EffectFunction |
( |
List< WorldObject > |
worldObjects, |
|
|
WorldState |
state |
|
) |
| |
Delegate for Effects; Effects.
- Parameters
-
| worldObjects | Specific objects assigned as the arguments of the action. |
| state | The world state object to apply the effects to. |
◆ GenerateActions()
Generates all action instances based on the action template and the given state.
Constructor
- Parameters
-
| name | - |
| actionParameterTypes | - |
| 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 |
| state | The current state of the planner |
- Returns
- A list of actions with parameters that could be generated in the current state of the planner.
◆ PreconditionFunction()
| delegate bool Grail.Planners.ActionTemplate.PreconditionFunction |
( |
List< WorldObject > |
worldObjects, |
|
|
WorldState |
state |
|
) |
| |
Delegate for Preconditions; Preconditions.
- Parameters
-
| worldObjects | Specific objects assigned as the arguments of the action. |
| state | The current world state. Provided as the extra context. You can use both or just one of the parameters of this function. |
- Returns
◆ Name
| string Grail.Planners.ActionTemplate.Name => name |
Gets a log-friendly name of the actions produced by the template.
◆ Cost
A function returning execution cost of the action, given a world state Represented as a function returning a number representing the action's cost, accepting a vector of action arguments (WorldObjects) and the current WorldState reference
If this is still unclear, please consult the web documentation.
◆ Effects
A function applied to the world state each time this action is performed in a planner iteration. Represented as a function returning void and accepting a vector of action arguments (WorldObjects) and the current WorldState reference.
If this is still unclear, please consult the web documentation.
◆ Preconditions
A precondition function that will be checked to verify the legality of the action. Represented as a boolean function accepting a vector of action arguments (WorldObjects) and the current WorldState reference.
If this is still unclear, please consult the web documentation.
◆ TypeID
| int Grail.Planners.ActionTemplate.TypeID |
|
getset |
A unique ID of the action template.
The documentation for this class was generated from the following file:
- GrailPlanners/source/Planner/Action/ActionTemplate.cs