Behavior Modifiers

From ABL
Revision as of 13:21, 2 August 2006 by Dbueno (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
BehaviorModifiers ::= ( Precondition | Specificity | ContextCondition | EntryCondition | NumberNeededForSuccess | TeamMemberSpecifier | SuccessCondition | ReinforcementSignals | ReinforcementState )
Precondition ::= <PRECONDITION> <LBRACE> TestExpression <RBRACE>
TeamMemberSpecifier ::= <TEAMMEMBERS> ( <IDENTIFIER> )+ <SEMICOLON>
ContextCondition ::= <CONTEXT_CONDITION> <LBRACE> TestExpression <RBRACE>
EntryCondition ::= <ENTRY_CONDITION> <LBRACE> TestExpression <RBRACE>
SuccessCondition ::= <SUCCESS_CONDITION> <LBRACE> TestExpression <RBRACE>


The behavior modifier specificity modifies behavior selection when executing a goal. A behavior is normally chosen by first using signature matching to locate a subset of behaviors from the behavior library that could potentially accomplish the goal, testing the preconditions of this subset of behaviors, and randomly selecting a behavior from those with satisfied preconditions. A specificity modifier associates an integer specificity with a behavior. In the event that multiple matching behaviors have satisfied preconditions, the behavior with the highest specificity is chosen. The term "specificity" refers to the notion that, given two different satisfied preconditions, one of the preconditions is satisfied in a larger subset of all possible working memory states, and is thus more general, while the other is satisfied by a smaller subset of working memory states, and is thus more specific. By allowing authors to associate specificities with behaviors, ABL implements the heuristic of first trying the behavior whose precondition is most specific to the current state the agent finds itself in.


specificity Nat ;


sequential behavior A() {
    specificity 1;

sequential behavior A() {
    specificity 10;

All other things being equal, the A with the higher specificity will be executed before the other is considered.

Number Needed for Success

Normally all the non-effect_only steps of a behavior must succeed for the behavior to succeed. Sometimes however, in a parallel or collection behavior, only a subset of the steps need to succeed, without knowing ahead of time which subset is necessary (if you knew ahead of time which subset actually needed to succeed, the other steps could be marked effect_only).

For example, suppose two subgoals are being pursued in parallel, but once either one of them succeeds, the enclosing behavior should succeed (and thus abort the unfinished subgoal). The behavior annotation number_needed_for_success expresses this. It is used to specify the number of non-effect_only steps that must succeed in order for the behavior to succeed.


number_needed_for_success Nat ;