Difference between revisions of "Meta-Behaviors"

From ABL
Jump to: navigation, search
 
(Reflection Methods)
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
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 [[Active Behavior Tree|ABT]]. Direct access to the [[Active Behavior Tree|ABT]] nodes is forbidden for safety reasons. The root of the tree is always a CollectionBehaviorWME.
 +
 +
== Reflection WME Hierarchy ==
 +
 +
[[Image:step-hierarchy.PNG]]
 +
[[Image:behavior-hierarchy.PNG]]
 +
 +
== Example ==
 +
 +
''to-do''
  
 
== Reflection Methods ==
 
== Reflection Methods ==
 
Readable goal step state  
 
Readable goal step state  
boolean getPersistent()– true if step is marked persistent
+
----
boolean getPersistentWhenSucceeds() – true if step is marked persistent when succeeds
+
boolean getPersistent()– true if step is marked persistent <br />
boolean getPersistentWhenFails() – true if step is marked persistent when fails
+
boolean getPersistentWhenSucceeds() – true if step is marked persistent when succeeds<br />
boolean getIgnoreFailure() – true if step is marked ignore failure
+
boolean getPersistentWhenFails() – true if step is marked persistent when fails<br />
boolean getHasSuccessTest() – true if the step has a success test
+
boolean getIgnoreFailure() – true if step is marked ignore failure<br />
boolean getEffectOnly() – true if step is marked effect only  
+
boolean getHasSuccessTest() – true if the step has a success test<br />
boolean getIsAtomic() – true if the step is part of an atomic behavior (atomic behaviors described on page 34).
+
boolean getEffectOnly() – true if step is marked effect only <br />
int getPriority() – the priority of the step
+
boolean getIsAtomic() – true if the step is part of an atomic behavior <br />
boolean getIsSuspended()– true if the step is currently suspended
+
int getPriority() – the priority of the step<br />
BehaviorWME getParent() – the reflection WME for the step parent
+
boolean getIsSuspended()– true if the step is currently suspended<br />
boolean getIsValid() – true if the reflection WME still refers to a valid ABT node
+
BehaviorWME getParent() – the reflection WME for the step parent<br />
String[] getConflicts() – an array of signatures of declared conflicting goals
+
boolean getIsValid() – true if the reflection WME still refers to a valid ABT node<br />
boolean getIsExecuting() – true if the goal is currently executing
+
String[] getConflicts() – an array of signatures of declared conflicting goals<br />
boolean getIsSuspended() – true if the goal is currently suspended
+
boolean getIsExecuting() – true if the goal is currently executing<br />
boolean getIsExpanded() – true if a behavior has been chosen for the goal
+
boolean getIsSuspended() – true if the goal is currently suspended<br />
String getSignature() – the goal signature
+
boolean getIsExpanded() – true if a behavior has been chosen for the goal<br />
BehaviorWME getChild() – the reflection WME of the child behavior
+
String getSignature() – the goal signature<br />
 +
BehaviorWME[] getChildren()/getChild() – the reflection WMEs of the child behavior<br />
  
 
Writeable goal step state
 
Writeable goal step state
setPersistent(boolean b) – change the persistent step annotation
+
----
setPersistentWhenSucceeds(boolean b) – change the persistent when succeeds step annotation
+
setPersistent(boolean b) – change the persistent step annotation<br />
setPersistentWhenFails(boolean b) – change the persistent when fails step annotation.
+
setPersistentWhenSucceeds(boolean b) – change the persistent when succeeds step annotation<br />
setIgnoreFailure(boolean b) – change the ignore failure step annotation
+
setPersistentWhenFails(boolean b) – change the persistent when fails step annotation.<br />
setEffectOnly(boolean b) – change the effect only step annotation
+
setIgnoreFailure(boolean b) – change the ignore failure step annotation<br />
setPriority(boolean b) – change the priority of the step
+
setEffectOnly(boolean b) – change the effect only step annotation<br />
 +
setPriority(short i) – change the priority of the step<br />
  
 
Actions performable on goal steps
 
Actions performable on goal steps
fail() – fail the step
+
----
succeed() – succeed the step
+
fail() – fail the step<br />
suspend() – suspend the goal step
+
succeed() – succeed the step<br />
unsuspend() – unsuspend the goal step
+
suspend() – suspend the goal step<br />
resetStep() – reset the goal step
+
unsuspend() – unsuspend the goal step<br />
 +
resetStep() – reset the goal step<br />
  
 
Miscellaneous methods  
 
Miscellaneous methods  
boolean isParent(GoalStepWME parentGoal) – returns true if the parameter parentGoal is a recursive parent of the goal step
+
----
 +
boolean isParent(GoalStepWME parentGoal) – returns true if the parameter parentGoal is a recursive parent of the goal step<br />
 
boolean isParent(BehaviorWME parentBehavior) – returns true if the parameter parentBehavior 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
 +
<br />

Latest revision as of 12:42, 1 June 2007

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