The overall behavior of this example is that the agent will start working on the top-level goal and then notice every 125 cycles that the conclude specification is met and will exhibit some data-driven behavior. The goal-driven plan will be suspended temporarily because the utility of the data-driven plan is higher than the goal-driven one. The maintain goal state will be undone four times before the agent removes that goal and exits.
ParseJamAgentDefinition
|
::=
|
agent_components
|
agent_components
|
::=
|
( ( goal )* | ( fact )* |
( plan )* | ( "{" plan_body_elements "}" )* )+
|
goal
|
::=
|
goal_action ";"
|
fact
|
::=
|
explist ";"
|
plan
|
::=
|
"{" plan_components "}"
|
plan_components
|
::=
|
plan_component ( plan_component )*
|
plan_component
|
::=
|
plan_name
|
|
|
|
plan_doc
|
|
|
|
plan_goalspec
|
|
|
|
plan_concludespec
|
|
|
|
plan_context
|
|
|
|
plan_precondition
|
|
|
|
plan_utility
|
|
|
|
plan_effects
|
|
|
|
plan_failure
|
|
|
|
plan_attributes
|
|
|
|
plan_body
|
plan_name
|
::=
|
( )?
|
plan_doc
|
::=
|
( )?
|
plan_attributes
|
::=
|
( )?
|
plan_goalspec
|
::=
|
( goal_action ";" )?
|
plan_concludespec
|
::=
|
( relation ";" )?
|
plan_context
|
::=
|
( condition_list )?
|
plan_precondition
|
::=
|
( condition_list )?
|
plan_utility
|
::=
|
( expression ";" )?
|
plan_effects
|
::=
|
( plan_body_elements )?
|
plan_failure
|
::=
|
( plan_body_elements )?
|
plan_body
|
::=
|
( plan_body_elements )?
|
plan_branch
|
::=
|
"{" plan_body_elements "}"
|
plan_body_elements
|
::=
|
plan_body_element ( plan_body_element )*
|
plan_body_element
|
::=
|
action ";"
|
|
|
|
plan_branch ( plan_branch )* ";"
|
|
|
|
plan_branch ( plan_branch )* ";"
|
|
|
|
plan_branch ( plan_branch )* ";"
|
|
|
|
plan_branch ( plan_branch )* ";"
|
|
|
|
plan_branch ( plan_branch )* ";"
|
|
|
|
wait_construct
|
|
|
|
":" action plan_branch ";"
|
|
|
|
":" action plan_branch ";"
|
|
|
|
plan_branch
":" action ";"
|
|
|
|
plan_branch ";"
|
|
|
|
action plan_branch ( action plan_branch )* ( plan_branch )? ";"
|
wait_construct
|
::=
|
":" action ";"
|
|
|
|
relation ";"
|
condition_list
|
::=
|
condition ( condition )*
|
condition
|
::=
|
expression ";"
|
|
|
|
explist ";"
|
|
|
|
explist ";"
|
action
|
::=
|
exec_action
|
|
|
|
misc_action
|
|
|
|
goal_action
|
exec_action
|
::=
|
"." explist
|
|
|
|
explist
|
|
|
|
explist
|
|
|
|
explist
|
|
|
|
explist
|
|
|
|
expression
|
|
|
|
explist
|
|
|
|
explist
|
|
|
|
"(" explist ")" "(" explist ")"
|
misc_action
|
::=
|
expression expression
|
|
|
|
explist
|
|
|
|
|
|
|
|
goal_action
|
|
|
|
goal_action
|
goal_action
|
::=
|
goal_action_basic ( expression )? ( explist )? ( explist )?
|
|
|
|
goal_action_basic
|
goal_action_basic
|
::=
|
relation
|
|
|
|
relation
|
|
|
|
relation
|
|
|
|
relation
|
relation
|
::=
|
explist
|
expression
|
::=
|
value
|
|
|
|
variable
|
|
|
|
funcall
|
|
|
|
predicate
|
explist
|
::=
|
( expression ( expression )* )?
|
value
|
::=
|
|
|
|
|
|
|
|
|
|
variable
|
::=
|
|
funcall
|
::=
|
"(" ( | ) explist ")"
|
predicate
|
::=
|
"(" explist ")"
|
|
|
|
"(" explist ")"
|
|
|
|
"(" explist ")"
|
errorSkipTo
|
::=
|
java code
|
getMatchedText
|
::=
|
java code
|
getSpecialTokenText
|
::=
|
java code
|