Meta-Behaviors

From ABL
Revision as of 12:42, 1 June 2007 by Kane (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Meta-behaviors are used to modify the Active Behavior Tree during runtime. These modifications are done using ReflectionWMEs, which provide behavior access to nodes in the ABT. Direct access to the ABT nodes is forbidden for safety reasons. The root of the tree is always a CollectionBehaviorWME.

Reflection WME Hierarchy

Error creating thumbnail: Unable to save thumbnail to destination
Error creating thumbnail: Unable to save thumbnail to destination

Example

to-do

Reflection Methods

Readable goal step state


boolean getPersistent()– true if step is marked persistent
boolean getPersistentWhenSucceeds() – true if step is marked persistent when succeeds
boolean getPersistentWhenFails() – true if step is marked persistent when fails
boolean getIgnoreFailure() – true if step is marked ignore failure
boolean getHasSuccessTest() – true if the step has a success test
boolean getEffectOnly() – true if step is marked effect only
boolean getIsAtomic() – true if the step is part of an atomic behavior
int getPriority() – the priority of the step
boolean getIsSuspended()– true if the step is currently suspended
BehaviorWME getParent() – the reflection WME for the step parent
boolean getIsValid() – true if the reflection WME still refers to a valid ABT node
String[] getConflicts() – an array of signatures of declared conflicting goals
boolean getIsExecuting() – true if the goal is currently executing
boolean getIsSuspended() – true if the goal is currently suspended
boolean getIsExpanded() – true if a behavior has been chosen for the goal
String getSignature() – the goal signature
BehaviorWME[] getChildren()/getChild() – the reflection WMEs of the child behavior

Writeable goal step state


setPersistent(boolean b) – change the persistent step annotation
setPersistentWhenSucceeds(boolean b) – change the persistent when succeeds step annotation
setPersistentWhenFails(boolean b) – change the persistent when fails step annotation.
setIgnoreFailure(boolean b) – change the ignore failure step annotation
setEffectOnly(boolean b) – change the effect only step annotation
setPriority(short i) – change the priority of the step

Actions performable on goal steps


fail() – fail the step
succeed() – succeed the step
suspend() – suspend the goal step
unsuspend() – unsuspend the goal step
resetStep() – reset the goal step

Miscellaneous methods


boolean isParent(GoalStepWME parentGoal) – returns true if the parameter parentGoal is a recursive parent of the goal step
boolean isParent(BehaviorWME parentBehavior) – returns true if the parameter parentBehavior is a recursive parent of the goal step