RAIN.GOB.GOBTree.GOBActionNode Class Reference

GOBActionNode is a special action type for GoalOrientedBehavior. GOBActionNodes are used to predict the change in world state caused by execution of their associated actions. The predictions are fed into the goal evaluation step and used to calculate an overall utility. GOB then chooses an action based on maximum overall utility. More...

Inheritance diagram for RAIN.GOB.GOBTree.GOBActionNode:
RAIN.BehaviorTrees.BTNode RAIN.Action.Action

List of all members.

Public Member Functions

 GOBActionNode (string nodeName)
 Even though GOBActionNode is built as a decorator, we want it to appear similar to a regular node. Unlike regular decorators, it can have its own name.
void SetAction (BTNode child)
 Set the action that should be performed when this GOBAction is selected.
override void AddChild (BTNode child)
 AddChild for GOBActionNode simply sets the single child action to be taken.
override void RemoveChild (string actionName)
 RemoveChild for GOBActionNode simply sets the single child onde to null. It does not bother to check that the actionName matches.
override ActionResult Start (Core.Agent agent, float deltaTime)
 Action.Start passthrough.
override ActionResult Execute (Core.Agent agent, float deltaTime)
 Action.Execute passthrough.
override ActionResult Stop (Core.Agent agent, float deltaTime)
 Action.Stop passthrough.
ActionContext CalculateUtilities (float deltaTime)
 CalculateUtilities creates a new ActionContext with the expected future value of variables after taking this GOBAction. Time based variables use deltaTime for t.
bool CanActivate (float deltaTime)
 CanActivate determines whether this GOBAction is available.

Public Attributes

const string NODETYPE = "task"
float lastScore
 The last score associated with this Action in overall GOB execution.
bool lastCanActivate
 A marker indicating whether the GOBAction could activate during the last evaluation.

Protected Attributes

BTNode actionNode = null
 We only allow a single child node, similar to a decorator.

Detailed Description

GOBActionNode is a special action type for GoalOrientedBehavior. GOBActionNodes are used to predict the change in world state caused by execution of their associated actions. The predictions are fed into the goal evaluation step and used to calculate an overall utility. GOB then chooses an action based on maximum overall utility.

GOBActionNode has been designed to fit into the BehaviorTree structure and can be used as a description of otherwise regular behavior tree nodes


Constructor & Destructor Documentation

RAIN.GOB.GOBTree.GOBActionNode.GOBActionNode ( string  nodeName)

Even though GOBActionNode is built as a decorator, we want it to appear similar to a regular node. Unlike regular decorators, it can have its own name.

Parameters:
nodeName

Member Function Documentation

override void RAIN.GOB.GOBTree.GOBActionNode.AddChild ( BTNode  child) [virtual]

AddChild for GOBActionNode simply sets the single child action to be taken.

Parameters:
childThe new child

Reimplemented from RAIN.BehaviorTrees.BTNode.

ActionContext RAIN.GOB.GOBTree.GOBActionNode.CalculateUtilities ( float  deltaTime)

CalculateUtilities creates a new ActionContext with the expected future value of variables after taking this GOBAction. Time based variables use deltaTime for t.

Parameters:
deltaTimeThe time used for t in embedded expressions
Returns:
Returns a new ActionContext containing the updated values, or null if the GOBAction can't activate
bool RAIN.GOB.GOBTree.GOBActionNode.CanActivate ( float  deltaTime)

CanActivate determines whether this GOBAction is available.

Parameters:
deltaTimeA timestep to use when evaluating conditionals
Returns:
true if all conditionals evaluate to true, false otherwise
override ActionResult RAIN.GOB.GOBTree.GOBActionNode.Execute ( Core.Agent  agent,
float  deltaTime 
)

Action.Execute passthrough.

Parameters:
agentAI Agent owner of the behavior tree
deltaTimetimestep in seconds
Returns:
Returns the ActionResult of the decorated node
override void RAIN.GOB.GOBTree.GOBActionNode.RemoveChild ( string  actionName) [virtual]

RemoveChild for GOBActionNode simply sets the single child onde to null. It does not bother to check that the actionName matches.

Parameters:
actionNameName of the child node to remove

Reimplemented from RAIN.BehaviorTrees.BTNode.

void RAIN.GOB.GOBTree.GOBActionNode.SetAction ( BTNode  child)

Set the action that should be performed when this GOBAction is selected.

Parameters:
child
override ActionResult RAIN.GOB.GOBTree.GOBActionNode.Start ( Core.Agent  agent,
float  deltaTime 
)

Action.Start passthrough.

Parameters:
agentAI Agent owner of the behavior tree
deltaTimetimestep in seconds
Returns:
Returns the ActionResult of the decorated node
override ActionResult RAIN.GOB.GOBTree.GOBActionNode.Stop ( Core.Agent  agent,
float  deltaTime 
)

Action.Stop passthrough.

Parameters:
agentAI Agent owner of the behavior tree
deltaTimetimestep in seconds
Returns:
Returns the ActionResult of the decorated node

Member Data Documentation

We only allow a single child node, similar to a decorator.

A marker indicating whether the GOBAction could activate during the last evaluation.

The last score associated with this Action in overall GOB execution.