Domain actions for the planner

The last component that is necessary to author corresponds to the actions that the agents will execute in order to achieve their intentions. These actions, also named operators, are then used and combined by the planner to build a plan that if executed accordingly will achieve a given step’s success conditions. All operators are defined in one file (actions.xml) and are common to all characters.

Next, we present three examples of actions, one physical action and two speech acts. The walk-to action requires that the agent who performs the action is standing and has the effect of being on the desired interaction spot. The general SpeechAct action cannot be applied to some particular types of speech because these are modelled by specific operators that have additional effects. For instance, in addition to updating the SpeechContext (all speech operators except reinforcements do that), the protest speech act has the additional effect of getting hurt with a small likelihood (30%). The special variable [AGENT] represents the agent who performs the action.

 

<Action name=”walk-to([target],[interaction-spot])”>

  <PreConditions>

<Property name=”[AGENT](pose)” operator=”=” value=”standing” />

</PreConditions>

  <Effects>

    <Effect probability=”1.0″>

<Property name=”IS([interaction-spot],[AGENT],[target]”

value=”True” />

</Effect>

</Effects>

</Action>

<!– General SpeechAct –>

<Action name=”SpeechAct([target],[type])”>

<PreConditions>

<Property name=”[target]” operator=”!=” value=”[AGENT]” />

<Property name=”[type]” operator=”!=” value=”protest” />

<Property name=”[type]” operator=”!=” value=”laughoff” />

<Property name=”[type]” operator=”!=” value=”deceptionreveal” />

<Property name=”[type]” operator=”!=” value=”fightbackconfirmation” />

<Property name=”[type]” operator=”!=” value=”tellsomeoneconfirmation” />

</PreConditions>

  <Effects>

    <Effect probability=”1″>

<Property name=”SpeechContext()” operator=”=”

value=”#EVENT([AGENT],SpeechAct,[target],[type])” />

</Effect>

</Effects>

</Action>

<!– Specific protest SpeechAct that has the possible effect of getting hurt –>

<Action name=”SpeechAct([target],protest)”>

<PreConditions>

<Property name=”[target]” operator=”!=” value=”[AGENT]” />

</PreConditions>

<Effects>

  <Effect probability=”0.3″>

<Property name=”[AGENT](hurt)” operator=”=” value=”True” />

</Effect>

<Effect probability=”1″>

<Property name=”SpeechContext()” operator=”=”

value=”#EVENT([AGENT],SpeechAct,[target],protest)” />

</Effect>

</Effects>

</Action>

 

An action is defined by: the action’s name; a list of preconditions that must be verified in order to execute the action; a list of effects that can become verified if the action is executed. The action’s name is very important, because when the action is selected for execution, the name must match to an existing action in the framework/world simulator, and the action’s name must contain all relevant parameters for the action (ex: the target, if any).

 

The preconditions for an action are defined in the same way as preconditions for a goal are defined. However, one can only use equal (=) and unequal (!=) property conditions, and positive Recent Event conditions as action’s preconditions. There is another important difference related to unequal property conditions. Due to efficiency reasons, an unequal condition in the planner just corresponds to memorizing the inequality and comparing it to subsequent substitutions, if later on, there is a substitution that violates the inequality, the substitution is discarded. For this reason, inequality conditions are not required to appear later in the preconditions like they were in goal’s preconditions. Furthermore, they can even be the first ones, since they are efficient to compute and do not spawn multiple childs in the plan tree.

 

In order to specify an action’s effects one can only use equal (=) property conditions and positive recent event conditions. For each condition specified as effect it’s also necessary to define what is the likelihood of the effect to be verified if the action is executed. Authors are not required to define that a given action has the effect of verifying the corresponding recent event, because this effect is created automatically when the action is read from file. For instance, when the above protest speech act is read, there will be an additional effect of establishing a recent event that corresponds to protesting towards the action’s target.