Changeset 898


Ignore:
Timestamp:
01/31/2011 01:13:47 PM (8 years ago)
Author:
dave
Message:

started fatima code and remote companion sprite update

Location:
scenarios/GerminationX/oak
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • scenarios/GerminationX/oak/data/characters/minds/Actions.xml

    r437 r898  
    11<DomainActions> 
    2         <!-- physical actions --> 
    3         <Action name="pick-from-floor([target])"> 
    4                 <PreConditions> 
    5                         <Property name="[AGENT](pose)" operator="=" value="standing"/> 
    6                 </PreConditions> 
    7                 <Effects> 
    8                         <Effect probability="1.0"> 
    9                                 <Property name="[target](on-top)" operator="=" value="none"/> 
    10                         </Effect> 
    11                         <Effect probability="1.0"> 
    12                                 <Property name="[AGENT](hold,[target])" operator="=" value="True"/> 
    13                         </Effect> 
    14                 </Effects> 
    15         </Action> 
    16         <Action name="swipe([target])"> 
    17                 <PreConditions> 
    18                         <Property name="[AGENT](pose)" operator="=" value="standing"/> 
    19                         <Property name="[target](owner)" operator="=" value="[targetowner]"/> 
    20                         <RecentEvent occurred="True" subject="[AGENT]" action="Reply" target="[targetowner]" parameters="teasedefend,negativeanswer"/> 
    21                 </PreConditions> 
    22                 <Effects> 
    23                 </Effects> 
    24         </Action> 
    252        <Action name="poke([target])"> 
    263                <PreConditions> 
     
    3310                </Effects> 
    3411        </Action> 
    35         <Action name="steal([owner],[item])"> 
    36                 <PreConditions> 
    37                         <Property name="[item](type)" operator="=" value="object"/> 
    38                         <Property name="[item](owner)" operator="=" value="[owner]"/> 
    39                         <Property name="[owner]" operator="!=" value="[AGENT]"/> 
    40                 </PreConditions> 
    41                 <Effects> 
    42                         <Effect probability="1.0"> 
    43                                 <Property name="[AGENT](hasItem,[item])" operator="=" value="True"/> 
    44                         </Effect> 
    45                 </Effects> 
    46         </Action> 
    47         <Action name="attack([target])"> 
     12 
     13        <Action name="sing([target])"> 
    4814                <PreConditions> 
    4915                        <Property name="[AGENT](pose)" operator="=" value="standing"/> 
    5016                </PreConditions> 
    5117                <Effects> 
    52                         <Effect probability="0.6"> 
    53                                 <Property name="[target](hurt)" operator="=" value="True"/> 
    54                         </Effect> 
    55                         <Effect probability="0.4"> 
    56                                 <Property name="[SELF](hurt)" operator="=" value="True"/> 
    57                         </Effect> 
    58                 </Effects> 
    59         </Action> 
    60         <Action name="throw([target],[item])"> 
    61                 <PreConditions> 
    62                         <Property name="[AGENT](pose)" operator="=" value="standing"/> 
    63                         <Property name="[AGENT](hasItem,[item])" operator="=" value="True"/> 
    64                         <Property name="[Item](throwable)" operator="=" value="True"/> 
    65                 </PreConditions> 
    66                 <Effects> 
    67                         <Effect probability="1.0"> 
    68                                 <Property name="[AGENT](hasItem,[item])" operator="=" value="False"/> 
    69                         </Effect> 
    70                 </Effects> 
    71         </Action> 
    72         <!-- Coping Strategy: walking away - not linked to graphics yet --> 
    73         <Action name="walkAway"> 
    74                 <PreConditions> 
    75                         <Property name="[AGENT](pose)" operator="=" value="standing"/> 
    76                         <!--<RecentEvent occurred="true" subject="[AGENT]" action="Question" target="[bully]" parameters="confrontationleave"/>--> 
    77                 </PreConditions> 
    78                 <Effects> 
    79                         <Effect probability="1.0"> 
    80                                 <Property name="[AGENT](needToCope)" operator="=" value="False"/> 
    81                         </Effect> 
    82                 </Effects> 
    83         </Action> 
    84         <!-- Coping Strategy: walking away - not linked to graphics yet --> 
    85         <Action name="runAway"> 
    86                 <PreConditions> 
    87                         <Property name="[AGENT](pose)" operator="=" value="standing"/> 
    88                 </PreConditions> 
    89                 <Effects> 
    90                         <Effect probability="1.0"> 
    91                                 <Property name="[AGENT](needToCope)" operator="=" value="False"/> 
    92                         </Effect> 
    93                 </Effects> 
    94         </Action> 
    95         <!-- PR 061123 added walkAwayVictim as a test - not linked to graphics yet--> 
    96         <Action name="walkAwayVictim([victim])" probability="0.3"> 
    97                 <PreConditions> 
    98                         <Property name="[AGENT](pose)" operator="=" value="standing"/> 
    99                 </PreConditions> 
    100                 <Effects> 
    101                 </Effects> 
    102         </Action> 
    103          
    104         <!-- User Speech  actions, interaction only --> 
    105         <Action name="UserSpeech([target],suggestcopingstrategy,[cs])" probability="0.8"> 
    106                 <PreConditions> 
    107                         <Property name="[AGENT]" operator="=" value="User"/> 
    108                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],Question,[AGENT],askforadvice)"/> 
    109                 </PreConditions> 
    110                 <Effects> 
    111                         <Effect probability="1.0"> 
    112                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],UserSpeech,[target],suggestcopingstrategy,[cs])"/> 
    113                         </Effect> 
    114                 </Effects> 
    115         </Action> 
    116          
    117         <Action name="UserSpeech([target],suggestcopingstrategy,[cs])" probability="0.3"> 
    118                 <PreConditions> 
    119                         <Property name="[AGENT]" operator="=" value="User"/> 
    120                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],Question,[AGENT],askforadvice2nd)"/> 
    121                 </PreConditions> 
    122                 <Effects> 
    123                         <Effect probability="1.0"> 
    124                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],UserSpeech,[target],suggestcopingstrategy,[cs])"/> 
    125                         </Effect> 
    126                 </Effects> 
    127         </Action> 
    128          
    129         <Action name="UserSpeech([target],suggestcopingstrategy,[cs])" probability="0.5"> 
    130                 <PreConditions> 
    131                         <Property name="[AGENT]" operator="=" value="User"/> 
    132                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],Question,[AGENT],askagain)"/> 
    133                 </PreConditions> 
    134                 <Effects> 
    135                         <Effect probability="1.0"> 
    136                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],UserSpeech,[target],suggestcopingstrategy,[cs])"/> 
    137                         </Effect> 
    138                 </Effects> 
    139         </Action> 
    140          
    141         <Action name="UserSpeech([target],yes,[strategy])" probability="0.8"> 
    142                 <PreConditions> 
    143                         <Property name="[AGENT]" operator="=" value="User"/> 
    144                         <RecentEvent occurred="True" subject="[SELF]" action="activate" target="AskIfKeepStrategy"/> 
    145                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="AskCopingStrategy"/> 
    146                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],CopingSpeech,[AGENT],askifkeepcopingstrategy,[strategy])"/> 
    147                 </PreConditions> 
    148                 <Effects> 
    149                         <Effect probability="1.0"> 
    150                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],UserSpeech,[target],yes,[strategy])"/> 
    151                         </Effect> 
    152                 </Effects> 
    153         </Action> 
    154          
    155         <Action name="UserSpeech([target],yes,[strategy])" probability="1.0"> 
    156                 <PreConditions> 
    157                         <Property name="[AGENT]" operator="=" value="User"/> 
    158                         <RecentEvent occurred="True" subject="[SELF]" action="activate" target="AskCopingStrategy"/> 
    159                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],CopingSpeech,[AGENT],confirmcopingstrategy,[strategy])"/> 
    160                 </PreConditions> 
    161                 <Effects> 
    162                         <Effect probability="1.0"> 
    163                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],UserSpeech,[target],yes,[strategy])"/> 
    164                         </Effect> 
    165                 </Effects> 
    166         </Action> 
    167          
    168         <Action name="UserSpeech([target],yes,[strategy])" probability="0.5"> 
    169                 <PreConditions> 
    170                         <Property name="[AGENT]" operator="=" value="User"/> 
    171                         <RecentEvent occurred="True" subject="[SELF]" action="fail" target="AskCopingStrategy"/> 
    172                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],CopingSpeech,[AGENT],suggestcopingstrategy,[strategy])"/> 
    173                 </PreConditions> 
    174                 <Effects> 
    175                         <Effect probability="1.0"> 
    176                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],UserSpeech,[target],yes,[strategy])"/> 
    177                         </Effect> 
    178                 </Effects> 
    179         </Action> 
    180          
    181         <Action name="UserSpeech([target],givereason)" probability="1.0"> 
    182                 <PreConditions> 
    183                         <Property name="[AGENT]" operator="=" value="User"/> 
    184                         <RecentEvent occurred="True" subject="[SELF]" action="activate" target="AskCopingStrategy"/> 
    185                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],Question,[AGENT],askforreason)"/> 
    186                 </PreConditions> 
    187                 <Effects> 
    188                         <Effect probability="1.0"> 
    189                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],UserSpeech,[target],givereason)"/> 
    190                         </Effect> 
    191                 </Effects> 
    192         </Action> 
    193          
    194         <Action name="UserSpeech([target],givereason)" probability="1.0"> 
    195                 <PreConditions> 
    196                         <Property name="[AGENT]" operator="=" value="User"/> 
    197                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="AskCopingStrategy" /> 
    198                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],Question,[AGENT],askwhykeep)"/> 
    199                 </PreConditions> 
    200                 <Effects> 
    201                         <Effect probability="1.0"> 
    202                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],UserSpeech,[target],givereason)"/> 
    203                         </Effect> 
    204                 </Effects> 
    205         </Action> 
    206          
    207         <!-- Speech Actions for the Victim's interaction with the user --> 
    208         <Action name="CopingSpeech(User,confirmcopingstrategy,[cs])"> 
    209                 <PreConditions> 
    210                         <Property name="SpeechContext()" operator="=" value="#EVENT(User,UserSpeech,[AGENT],suggestcopingstrategy,[cs])"/> 
    211                 </PreConditions> 
    212                 <Effects> 
    213                         <Effect probability="1.0"> 
    214                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],CopingSpeech,User,confirmcopingstrategy,[cs])"/> 
    215                         </Effect> 
    216                 </Effects> 
    217         </Action> 
    218          
    219         <Action name="CopingSpeech(User,suggestcopingstrategy,[coping])"> 
    220                 <PreConditions> 
    221                         <RecentEvent occurred="True" subject="[SELF]" action="fail" target="AskCopingStrategy"/> 
    222                         <Property name="[AGENT](cansuggestcoping,[coping])" operator="=" value="True"/> 
    223                         <Property name="[AGENT](numberOfTries,[coping])" operator="LesserThan" value="6"/> 
    224                 </PreConditions> 
    225                 <Effects> 
    226                         <Effect probability="1.0"> 
    227                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],CopingSpeech,User,suggestcopingstrategy,[coping])"/> 
    228                         </Effect> 
    229                 </Effects> 
    230         </Action> 
    231          
    232         <Action name="CopingSpeech(User,askifkeepcopingstrategy,[coping])"> 
    233                 <PreConditions> 
    234                         <Property name="[AGENT](copingStrategy)" operator="=" value="[coping]" /> 
    235                         <Property name="[coping]" operator="!=" value="False" /> 
    236                 </PreConditions> 
    237                 <Effects> 
    238                         <Effect probability="1.0"> 
    239                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],CopingSpeech,User,askifkeepcopingstrategy,[coping])"/> 
    240                         </Effect> 
    241                 </Effects> 
    242         </Action> 
    243          
    244         <Action name="CopingSpeech(User,cannotkeepcopingstrategy,[coping])"> 
    245                 <PreConditions> 
    246                         <Property name="[AGENT](copingStrategy)" operator="=" value="[coping]" /> 
    247                         <Property name="[coping]" operator="!=" value="False" /> 
    248                 </PreConditions> 
    249                 <Effects> 
    250                         <Effect probability="1.0"> 
    251                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],CopingSpeech,User,cannotkeepcopingstrategy,[coping])"/> 
    252                         </Effect> 
    253                 </Effects> 
    254         </Action> 
    255          
    256         <Action name="CopingSpeech(User,acceptcopingstrategy,[coping])"> 
    257                 <PreConditions> 
    258                         <Property name="[AGENT](copingStrategy)" operator="=" value="[coping]" /> 
    259                         <Property name="[coping]" operator="!=" value="False" /> 
    260                 </PreConditions> 
    261                 <Effects> 
    262                         <Effect probability="1.0"> 
    263                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],CopingSpeech,User,acceptstrategy,[coping])"/> 
    264                         </Effect> 
    265                 </Effects> 
    266         </Action> 
    267          
    268         <Action name="CopingSpeech(User,declinecopingstrategy,[coping])"> 
    269                 <PreConditions> 
    270                         <Property name="[AGENT](copingStrategy)" operator="=" value="[coping]" /> 
    271                         <Property name="[coping]" operator="!=" value="False" /> 
    272                 </PreConditions> 
    273                 <Effects> 
    274                         <Effect probability="1.0"> 
    275                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],CopingSpeech,User,declinecopingstrategy,[coping])"/> 
    276                         </Effect> 
    277                 </Effects> 
    278         </Action> 
    279          
    280         <!-- General SpeechAct --> 
    281         <Action name="SpeechAct([target],[type])"> 
    282                 <PreConditions> 
    283                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    284                         <Property name="[type]" operator="!=" value="protest"/> 
    285                         <Property name="[type]" operator="!=" value="deceptionreveal"/> 
    286                         <Property name="[type]" operator="!=" value="annoy"/> 
    287                         <Property name="[type]" operator="!=" value="laughoff"/> 
    288                         <Property name="[type]" operator="!=" value="followdontcare"/> 
    289                 </PreConditions> 
    290                 <Effects> 
    291                         <Effect probability="1"> 
    292                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],SpeechAct,[target],[type])"/> 
    293                         </Effect> 
    294                 </Effects> 
    295         </Action> 
    296         <!-- Specific protest SpeechAct that has the possible effect of getting hurt --> 
    297         <Action name="SpeechAct([target],protest)"> 
    298                 <PreConditions> 
    299                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    300                 </PreConditions> 
    301                 <Effects> 
    302                         <Effect probability="0.4"> 
    303                                 <Property name="[AGENT](atRisk)" operator="=" value="True"/> 
    304                         </Effect> 
    305                         <Effect probability="1"> 
    306                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],SpeechAct,[target],protest)"/> 
    307                         </Effect> 
    308                 </Effects> 
    309         </Action> 
    310         <!-- Specific laughoff SpeechAct that has the possible effect of getting hurt --> 
    311         <Action name="SpeechAct([target],laughoff)"> 
    312                 <PreConditions> 
    313                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    314                 </PreConditions> 
    315                 <Effects> 
    316                         <Effect probability="0.4"> 
    317                                 <Property name="[AGENT](atRisk)" operator="=" value="True"/> 
    318                         </Effect> 
    319                         <Effect probability="1"> 
    320                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],SpeechAct,[target],protest)"/> 
    321                         </Effect> 
    322                 </Effects> 
    323         </Action> 
    324         <!-- Specific SpeechAct for followdontcare --> 
    325         <Action name="SpeechAct([target],followdontcare)"> 
    326                 <PreConditions> 
    327                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    328                 </PreConditions> 
    329                 <Effects> 
    33018                        <Effect probability="0.8"> 
    331                                 <Property name="[AGENT](atRisk)" operator="=" value="True"/> 
    332                         </Effect> 
    333                         <Effect probability="1"> 
    334                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],SpeechAct,[target],followdontcare)"/> 
    335                         </Effect> 
    336                 </Effects> 
    337         </Action> 
    338         <!-- Specific annoy SpeechAct that has the possible effect of annoying the target --> 
    339         <Action name="SpeechAct([target],annoy)"> 
    340                 <PreConditions> 
    341                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    342                 </PreConditions> 
    343                 <Effects> 
    344                         <Effect probability="0.5"> 
    345                                 <Property name="[target](annoyed)" operator="=" value="True"/> 
    346                         </Effect> 
    347                         <Effect probability="1"> 
    348                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],SpeechAct,[target],annoy)"/> 
    349                         </Effect> 
    350                 </Effects> 
    351         </Action> 
    352         <!-- Specific cancelinvitation SpeechAct that reflects that if someone tries to sabotage the partyinvitation the cancel 
    353               invitation will be much more likely. It is still possible to use the generic speechAct for this purpose, but the likelihood 
    354                   is quite small --> 
    355         <Action name="SpeechAct([target],partyinvitationwithdraw)" probability="0.8"> 
    356                 <PreConditions> 
    357                         <RecentEvent occurred="True" subject="[saboteur]" action="SpeechAct" target="[AGENT]" parameters="partyinvitationsabotagehost,[target]"/> 
    358                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    359                 </PreConditions> 
    360                 <Effects> 
    361                         <Effect probability="1"> 
    362                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],SpeechAct,[target],partyinvitationwithdraw)"/> 
    363                         </Effect> 
    364                 </Effects> 
    365         </Action> 
    366         <!-- Specific deceptionreveal SpeechAct that consists in the agent revealing the deception, the victim will need to cope --> 
    367         <Action name="SpeechAct([target],deceptionreveal)"> 
    368                 <PreConditions> 
    369                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    370                         <RecentEvent occurred="True" subject="[target]" action="Reply" target="[AGENT]" parameters="deception,positiveanswer"/> 
    371                 </PreConditions> 
    372                 <Effects> 
    373                         <Effect probability="1"> 
    374                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],SpeechAct,[target],deceptionreveal)"/> 
    375                         </Effect> 
    376                 </Effects> 
    377         </Action> 
    378     --> 
    379      
    380     <!-- Join Group Speech Acts --> 
    381         <Action name="SpeechAct([target],joingroupquestionthreatleave,[group])" probability="0.5"> 
    382                 <PreConditions> 
    383                         <Property name="[AGENT](role)" operator="=" value="Bully"/> 
    384                         <Property name="[group](isGroup)" operator="=" value="True"/> 
    385                         <Property name="[target](inGroup,[group])" operator="=" value="True"/> 
    386                         <Property name="[AGENT](inGroup,[group])" operator="=" value="True"/> 
    387                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],Question,[AGENT],joingroupquestionnegativeanswerobject)"/> 
    388                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    389                 </PreConditions> 
    390                 <Effects> 
    391                         <Effect probability="1"> 
    392                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],SpeechAct,[target],joingroupquestionthreatleave,[group])"/> 
    393                         </Effect> 
    394                 </Effects> 
    395         </Action> 
    396         <Action name="SpeechAct([target],joingroupquestionnegativeanswerobjectaccept,[group])" probability="0.5"> 
    397                 <PreConditions> 
    398                         <Property name="[AGENT](role)" operator="=" value="Bully"/> 
    399                         <Property name="[group](isGroup)" operator="=" value="True"/> 
    400                         <Property name="[target](inGroup,[group])" operator="=" value="True"/> 
    401                         <Property name="[AGENT](inGroup,[group])" operator="=" value="True"/> 
    402                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],Question,[AGENT],joingroupquestionnegativeanswerobject)"/> 
    403                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    404                 </PreConditions> 
    405                 <Effects> 
    406                         <Effect probability="1"> 
    407                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],SpeechAct,[target],joingroupquestionnegativeanswerobjectaccept,[group])"/> 
    408                         </Effect> 
    409                 </Effects> 
    410         </Action> 
    411         <Action name="SpeechAct([target],joingroupquestionnegativeanswerobjectacceptanswer,[group])" probability="0.5"> 
    412                 <PreConditions> 
    413                         <Property name="[target](role)" operator="=" value="Bully"/> 
    414                         <Property name="[group](isGroup)" operator="=" value="True"/> 
    415                         <Property name="[target](inGroup,[group])" operator="=" value="True"/> 
    416                         <Property name="[AGENT](inGroup,[group])" operator="=" value="True"/> 
    417                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],SpeechAct,[AGENT],joingroupquestionnegativeanswerobjectaccept,[group])"/> 
    418                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    419                 </PreConditions> 
    420                 <Effects> 
    421                         <Effect probability="1"> 
    422                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],SpeechAct,[target],joingroupquestionnegativeanswerobjectacceptanswer,[group])"/> 
    423                         </Effect> 
    424                 </Effects> 
    425         </Action> 
    426         <Action name="SpeechAct([target],joingroupquestionthreatleavepositiveanswer,[group])" probability="0.5"> 
    427                 <PreConditions> 
    428                         <Property name="[target](role)" operator="=" value="Bully"/> 
    429                         <Property name="[group](isGroup)" operator="=" value="True"/> 
    430                         <Property name="[target](inGroup,[group])" operator="=" value="True"/> 
    431                         <Property name="[AGENT](inGroup,[group])" operator="=" value="True"/> 
    432                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],SpeechAct,[AGENT],joingroupquestionthreatleave,[group])"/> 
    433                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    434                 </PreConditions> 
    435                 <Effects> 
    436                         <Effect probability="1"> 
    437                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],SpeechAct,[target],joingroupquestionthreatleavepositiveanswer,[group])"/> 
    438                         </Effect> 
    439                 </Effects> 
    440         </Action> 
    441         <Action name="SpeechAct([target],joingroupquestionthreatleavenegativeanswer,[group])" probability="0.5"> 
    442                 <PreConditions> 
    443                         <Property name="[target](role)" operator="=" value="Bully"/> 
    444                         <Property name="[group](isGroup)" operator="=" value="True"/> 
    445                         <Property name="[target](inGroup,[group])" operator="=" value="True"/> 
    446                         <Property name="[AGENT](inGroup,[group])" operator="=" value="True"/> 
    447                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],SpeechAct,[AGENT],joingroupquestionthreatleave,[group])"/> 
    448                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    449                 </PreConditions> 
    450                 <Effects> 
    451                         <Effect probability="1"> 
    452                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],SpeechAct,[target],joingroupquestionthreatleavenegativeanswer,[group])"/> 
    453                         </Effect> 
    454                 </Effects> 
    455         </Action> 
    456         <Action name="Question([target],joingroupconvince,[group])"> 
    457                 <PreConditions> 
    458                         <Property name="[group](isGroupOf1)" operator="=" value="True"/> 
    459                         <Property name="[target](inGroup,[group])" operator="=" value="True"/> 
    460                         <RecentEvent subject="[target]" target="[AGENT]" action="Reply" parameters="joingroupquestion,negativeanswer,[group]"/> 
    461                 </PreConditions> 
    462                 <Effects> 
    463                         <Effect probability="1"> 
    464                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],Question,[target],joingroupconvince,[group])"/> 
    465                         </Effect> 
    466                 </Effects> 
    467         </Action> 
    468         <Action name="Reply([target],joingroupconvince,positiveanswer,[group])" probability="0.5"> 
    469                 <PreConditions> 
    470                         <Property name="[group](isGroupOf1)" operator="=" value="True"/> 
    471                         <Property name="[target](inGroup,[group])" operator="=" value="Pending"/> 
    472                         <RecentEvent subject="[target]" target="[AGENT]" action="Question" parameters="joingroupconvince,[group]"/> 
    473                 </PreConditions> 
    474                 <Effects> 
    475                         <Effect probability="1"> 
    476                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],Reply,[target],joingroupconvince,positiveanswer,[group])"/> 
    477                         </Effect> 
    478                 </Effects> 
    479         </Action> 
    480         <Action name="Reply([target],joingroupconvince,negativeanswer,[group])" probability="0.5"> 
    481                 <PreConditions> 
    482                         <Property name="[group](isGroupOf1)" operator="=" value="True"/> 
    483                         <Property name="[target](inGroup,[group])" operator="=" value="Pending"/> 
    484                         <RecentEvent subject="[target]" target="[AGENT]" action="Question" parameters="joingroupconvince,[group]"/> 
    485                 </PreConditions> 
    486                 <Effects> 
    487                         <Effect probability="1"> 
    488                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],Reply,[target],joingroupconvince,negativeanswer,[group])"/> 
    489                         </Effect> 
    490                 </Effects> 
    491         </Action> 
    492         <!-- General SpeechAct that contains an additional topic --> 
    493         <Action name="SpeechAct([target],[type],[topic])"> 
    494                 <PreConditions> 
    495                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    496                         <Property name="[type]" operator="!=" value="joingroupquestionthreatleave"/> 
    497                         <Property name="[type]" operator="!=" value="joingroupquestionthreatleavepositiveanswer"/> 
    498                         <Property name="[type]" operator="!=" value="joingroupquestionthreatleavenegativeanswer"/> 
    499                         <Property name="[type]" operator="!=" value="joingroupquestionnegativeanswerobjectaccept"/> 
    500                         <Property name="[type]" operator="!=" value="joingroupquestionnegativeanswerobjectacceptanswer"/> 
    501                 </PreConditions> 
    502                 <Effects> 
    503                         <Effect probability="1"> 
    504                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],SpeechAct,[target],[type],[topic])"/> 
    505                         </Effect> 
    506                 </Effects> 
    507         </Action> 
    508         <!-- General Reinforcement SpeechAct --> 
    509         <Action name="Reinforce([target],[type])"> 
    510                 <PreConditions> 
    511                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    512                 </PreConditions> 
    513                 <Effects> 
    514                 </Effects> 
    515         </Action> 
    516         <!-- General Question SpeechAct --> 
    517         <Action name="Question([target],[question])"> 
    518                 <PreConditions> 
    519                         <Property name="[question]" operator="!=" value="threatfightback"/> 
    520                         <Property name="[question]" operator="!=" value="laughoff"/> 
    521                         <Property name="[question]" operator="!=" value="protest"/> 
    522                         <Property name="[question]" operator="!=" value="askforadvice"/> 
    523                         <Property name="[question]" operator="!=" value="askforadvice2nd"/> 
    524                         <Property name="[question]" operator="!=" value="askagain"/> 
    525                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    526                 </PreConditions> 
    527                 <Effects> 
    528                         <Effect probability="1"> 
    529                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],Question,[target],[question])"/> 
    530                         </Effect> 
    531                 </Effects> 
    532         </Action> 
    533         <!-- Specific protest Question that has the possible effect of getting hurt --> 
    534         <Action name="Question([target],protest)"> 
    535                 <PreConditions> 
    536                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    537                 </PreConditions> 
    538                 <Effects> 
    539                         <Effect probability="0.4"> 
    540                                 <Property name="[AGENT](atRisk)" operator="=" value="True"/> 
    541                         </Effect> 
    542                         <Effect probability="1"> 
    543                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],Question,[target],protest)"/> 
    544                         </Effect> 
    545                 </Effects> 
    546         </Action> 
    547         <!-- Specific laughoff Question that has the possible effect of getting hurt --> 
    548         <Action name="Question([target],laughoff)"> 
    549                 <PreConditions> 
    550                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    551                 </PreConditions> 
    552                 <Effects> 
    553                         <Effect probability="0.4"> 
    554                                 <Property name="[AGENT](atRisk)" operator="=" value="True"/> 
    555                         </Effect> 
    556                         <Effect probability="1"> 
    557                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],Question,[target],laughoff)"/> 
    558                         </Effect> 
    559                 </Effects> 
    560         </Action> 
    561         <!-- Specific threatfightback question --> 
    562         <Action name="Question([target],threatfightback)"> 
    563                 <PreConditions> 
    564                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    565                 </PreConditions> 
    566                 <Effects> 
    567                         <Effect probability="0.7"> 
    568                                 <Property name="[AGENT](atRisk)" operator="=" value="True"/> 
    569                         </Effect> 
    570                         <Effect probability="1"> 
    571                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],Question,[target],threatfightback)"/> 
    572                         </Effect> 
    573                 </Effects> 
    574         </Action> 
    575         <!-- Specific threatfightback question --> 
    576         <Action name="Question([target],helpprotection)" probability="0.7"> 
    577                 <PreConditions> 
    578                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    579                         <RecentEvent occurred="True" subject="[target]" target="[AGENT]" action="Reply" parameters="helpquestion,positiveanswer"/> 
    580                 </PreConditions> 
    581                 <Effects> 
    582                         <Effect probability="1"> 
    583                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],Question,[target],helpprotection)"/> 
    584                         </Effect> 
    585                 </Effects> 
    586         </Action> 
    587         <!-- Specific askforadvice question --> 
    588         <Action name="Question([target],askforadvice)"> 
    589                 <PreConditions> 
    590                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    591                         <RecentEvent occurred="False" subject="[AGENT]" target="[target]" action="Question" parameters="askforadvice"/> 
    592                 </PreConditions> 
    593                 <Effects> 
    594                         <Effect probability="1"> 
    595                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],Question,[target],askforadvice)"/> 
    596                         </Effect> 
    597                 </Effects> 
    598         </Action> 
    599         <!-- Specific askforadvice2nd question --> 
    600         <Action name="Question([target],askforadvice2nd)"> 
    601                 <PreConditions> 
    602                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    603                         <RecentEvent occurred="True" subject="[target]" target="[AGENT]" action="UserSpeech" parameters="suggestcopingstrategy,*"/> 
    604                 </PreConditions> 
    605                 <Effects> 
    606                         <Effect probability="1"> 
    607                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],Question,[target],askforadvice2nd)"/> 
    608                         </Effect> 
    609                 </Effects> 
    610         </Action> 
    611         <!-- Specific askagain question --> 
    612         <Action name="Question([target],askagain)"> 
    613                 <PreConditions> 
    614                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    615                         <RecentEvent occurred="True" subject="[AGENT]" target="[target]" action="Question" parameters="askforadvice"/> 
    616                         <RecentEvent occurred="False" subject="[target]" target="[AGENT]" action="UserSpeech" parameters="suggestcopingstrategy,*"/> 
    617                 </PreConditions> 
    618                 <Effects> 
    619                         <Effect probability="1"> 
    620                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],Question,[target],askagain)"/> 
    621                         </Effect> 
    622                 </Effects> 
    623         </Action> 
    624  
    625         <!-- Group related questions --> 
    626         <Action name="Question([target],[question],[group])"> 
    627                 <PreConditions> 
    628                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    629                         <Property name="[question]" operator="!=" value="joingroupconvince"/> 
    630                         <Property name="[group](isGroup)" operator="=" value="True"/> 
    631                 </PreConditions> 
    632                 <Effects> 
    633                         <Effect probability="1"> 
    634                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],Question,[target],[question],[group])"/> 
    635                         </Effect> 
    636                 </Effects> 
    637         </Action> 
    638         <!-- General positive Reply SpeechAct. It's probability of execution by another agent is a little higher because this Reply is incentivated 
    639               by a question --> 
    640         <Action name="Reply([target],[question],positiveanswer)" probability="0.5"> 
    641                 <PreConditions> 
    642                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    643                         <Property name="[question]" operator="!=" value="joingroupquestionnegativeanswerobject"/> 
    644                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],Question,[AGENT],[question])"/> 
    645                 </PreConditions> 
    646                 <Effects> 
    647                         <Effect probability="1"> 
    648                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],Reply,[target],[question],positiveanswer)"/> 
    649                         </Effect> 
    650                 </Effects> 
    651         </Action> 
    652         <!-- General negative Reply SpeechAct. It's probability of execution by another agent is a little higher because this Reply is incentivated 
    653               by a question. Additionally, saying no has some likelihood of getting hurt. --> 
    654         <Action name="Reply([target],[question],negativeanswer)" probability="0.5"> 
    655                 <PreConditions> 
    656                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    657                         <Property name="[question]" operator="!=" value="joinparty"/> 
    658                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],Question,[AGENT],[question])"/> 
    659                 </PreConditions> 
    660                 <Effects> 
    661                         <Effect probability="0.4"> 
    662                                 <Property name="[AGENT](atRisk)" operator="=" value="True"/> 
    663                         </Effect> 
    664                         <Effect probability="1"> 
    665                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],Reply,[target],[question],positiveanswer)"/> 
    666                         </Effect> 
    667                 </Effects> 
    668         </Action> 
    669         <!-- Specific negative Reply to a joinparty question. This operator reflects that if someone tries to sabotage the partyinvitation 
    670                 the cancel the negative reply will be much more likely. It is still possible to use the generic Reply for this purpose, but the likelihood 
    671                   is quite small --> 
    672         <Action name="Reply([target],joinparty,negativeanswer)" probability="0.8"> 
    673                 <PreConditions> 
    674                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],Question,[AGENT],joinparty)"/> 
    675                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    676                         <RecentEvent occurred="True" subject="[saboteur]" action="SpeechAct" target="[AGENT]" parameters="partyinvitationsabotagehost,[target]"/> 
    677                 </PreConditions> 
    678                 <Effects> 
    679                         <Effect probability="1"> 
    680                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],Reply,[target],joinparty,negativeanswer)"/> 
    681                         </Effect> 
    682                 </Effects> 
    683         </Action> 
    684         <!-- Reply SpeechAct used for replying to joingroup questions. It's probability of execution by another agent is a little higher because this Reply is incentivated 
    685               by a question --> 
    686         <Action name="Reply([target],joingroupquestion,[answer],[group])" probability="0.5"> 
    687                 <PreConditions> 
    688                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    689                         <Property name="[group](isGroup)" operator="=" value="True"/> 
    690                         <Property name="[AGENT](inGroup,[group])" operator="=" value="True"/> 
    691                         <RecentEvent subject="[target]" target="[group]" action="Question" parameters="joingroupquestion"/> 
    692                 </PreConditions> 
    693                 <Effects> 
    694                         <Effect probability="1"> 
    695                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],Reply,[target],joingroupquestion,[answer],[group])"/> 
    696                         </Effect> 
    697                 </Effects> 
    698         </Action> 
    699         <!-- Reply SpeechAct used for replying to joingroup questions. It's probability of execution by another agent is a little higher because this Reply is incentivated 
    700               by a question --> 
    701         <Action name="Reply([target],joingroupquestionpositiveanswerobject,[answer],[group])" probability="0.5"> 
    702                 <PreConditions> 
    703                         <Property name="[target]" operator="!=" value="[AGENT]"/> 
    704                         <Property name="[group](isGroup)" operator="=" value="True"/> 
    705                         <Property name="[AGENT](inGroup,[group])" operator="=" value="True"/> 
    706                         <RecentEvent subject="[target]" target="[AGENT]" action="Question" parameters="joingroupquestionpositiveanswerobject,[group]"/> 
    707                 </PreConditions> 
    708                 <Effects> 
    709                         <Effect probability="1"> 
    710                                 <Property name="SpeechContext()" operator="=" value="#EVENT([AGENT],Reply,[target],joingroupquestionpositiveanswerobject,[answer],[group])"/> 
    711                         </Effect> 
    712                 </Effects> 
    713         </Action> 
    714         <!-- Inference Operators --> 
    715         <!-- InvitedToParty = True inference --> 
    716         <Action name="InferenceOperator1([Inviter],[Invited])"> 
    717                 <PreConditions> 
    718                         <RecentEvent occurred="True" subject="[Invited]" action="Reply" target="[Inviter]" parameters="partyinvitation,positiveanswer"/> 
    719                 </PreConditions> 
    720                 <Effects> 
    721                         <Effect probability="1"> 
    722                                 <Property name="InvitedToParty([Inviter],[Invited])" operator="=" value="True"/> 
    723                         </Effect> 
    724                 </Effects> 
    725         </Action> 
    726         <Action name="InferenceOperator2([Inviter],[Invited])"> 
    727                 <PreConditions> 
    728                         <RecentEvent occurred="True" subject="[Inviter]" action="Reply" target="[Invited]" parameters="joinparty,positiveanswer"/> 
    729                 </PreConditions> 
    730                 <Effects> 
    731                         <Effect probability="1"> 
    732                                 <Property name="InvitedToParty([Inviter],[Invited])" operator="=" value="True"/> 
    733                         </Effect> 
    734                 </Effects> 
    735         </Action> 
    736         <!-- invitedToParty = False inference --> 
    737         <Action name="InferenceOperator3([Inviter],[Invited])"> 
    738                 <PreConditions> 
    739                         <RecentEvent occurred="True" subject="[Inviter]" action="SpeechAct" target="[Invited]" parameters="partyinvitationwithdraw"/> 
    740                 </PreConditions> 
    741                 <Effects> 
    742                         <Effect probability="1"> 
    743                                 <Property name="InvitedToParty([Inviter],[Invited])" operator="=" value="False"/> 
    744                         </Effect> 
    745                 </Effects> 
    746         </Action> 
    747         <Action name="InferenceOperator4([Inviter],[Invited])"> 
    748                 <PreConditions> 
    749                         <RecentEvent occurred="True" subject="[Inviter]" action="Reply" target="[Invited]" parameters="joinparty,negativeanswer"/> 
    750                 </PreConditions> 
    751                 <Effects> 
    752                         <Effect probability="1"> 
    753                                 <Property name="InvitedToParty([Inviter],[Invited])" operator="=" value="False"/> 
    754                         </Effect> 
    755                 </Effects> 
    756         </Action> 
    757         <!-- NeedToCope inferences --> 
    758         <!-- I need to cope if I'm distressed --> 
    759         <Action name="InferenceNeedToCopeDistress()"> 
    760                 <PreConditions> 
    761                         <EmotionCondition emotion="Distress" min-intensity="3"/> 
    762                 </PreConditions> 
    763                 <Effects> 
    764                         <Effect probability="1.0"> 
    765                                 <Property name="[SELF](needToCope)" operator="=" value="True"/> 
    766                         </Effect> 
    767                 </Effects> 
    768         </Action> 
    769         <Action name="InferenceNeedToCopeDistress()"> 
    770                 <PreConditions> 
    771                         <EmotionCondition active="False" emotion="Distress" min-intensity="2"/> 
    772                 </PreConditions> 
    773                 <Effects> 
    774                         <Effect probability="1.0"> 
    775                                 <Property name="[SELF](needToCope)" operator="=" value="False"/> 
    776                         </Effect> 
    777                 </Effects> 
    778         </Action> 
    779         <!-- user conversation inferences --> 
    780         <Action name="InferenceAskIfKeepFailed(user)"> 
    781                 <PreConditions> 
    782                         <!--<RecentEvent occurred="False" subject="User" action="UserSpeech" target="[SELF]" parameters="no" />--> 
    783                         <RecentEvent occurred="True" subject="[SELF]" action="fail" target="AskIfKeepStrategy" /> 
    784                         <Property name="stopInference(askifkeepfailed)" operator="!=" value="True"/> 
    785                 </PreConditions> 
    786                 <Effects> 
    787                         <Effect probability="1.0"> 
    788                                 <Property name="[SELF](copingStrategy)" operator="=" value="False"/> 
    789                                 <Property name="stopInference(askifkeepfailed)" operator="=" value="True"/> 
    790                         </Effect> 
    791                 </Effects> 
    792         </Action> 
    793          
    794         <Action name="InferenceAskIfKeepFailed2([target],[coping])"> 
    795                 <PreConditions> 
    796                         <RecentEvent occurred="False" subject="[SELF]" action="fail" target="AskIfKeepStrategy" /> 
    797                 </PreConditions> 
    798                 <Effects> 
    799                         <Effect probability="1.0"> 
    800                                 <Property name="stopInference(askifkeepfailed)" operator="=" value="False"/> 
    801                         </Effect> 
    802                 </Effects> 
    803         </Action> 
    804          
    805         <Action name="InferenceCopingStrategy([target],[coping])"> 
    806                 <PreConditions> 
    807                         <Property name="SpeechContext()" operator="=" value="#EVENT(User,UserSpeech,[target],suggestcopingstrategy,[coping])"/> 
    808                         <Property name="[target](canChangeCoping)" operator="=" value="True"/> 
    809                 </PreConditions> 
    810                 <Effects> 
    811                         <Effect probability="1.0"> 
    812                                 <Property name="[target](canChangeCoping)" operator="=" value="False"/> 
    813                                 <Property name="[target](copingStrategy)" operator="=" value="[coping]"/> 
    814                         </Effect> 
    815                 </Effects> 
    816         </Action> 
    817          
    818         <Action name="InferenceCopingStrategy2([target],[coping])"> 
    819                 <PreConditions> 
    820                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],CopingSpeech,User,suggestcopingstrategy,[coping])"/> 
    821                 </PreConditions> 
    822                 <Effects> 
    823                         <Effect probability="1.0"> 
    824                                 <Property name="[target](canChangeCoping)" operator="=" value="False"/> 
    825                                 <Property name="[target](copingStrategy)" operator="=" value="[coping]"/> 
    826                         </Effect> 
    827                 </Effects> 
    828         </Action> 
    829          
    830         <!--<Action name="InferenceCopingStrategy3([target],[coping])"> 
    831                 <PreConditions> 
    832                         <Property name="SpeechContext()" operator="=" value="#EVENT(User,UserSpeech,[target],yes,[coping])"/> 
    833                         <Property name="[coping]" operator="!=" value="null" /> 
    834                         <Property name="[target](canChangeCoping)" operator="=" value="True"/> 
    835                 </PreConditions> 
    836                 <Effects> 
    837                         <Effect probability="1.0"> 
    838                                 <Property name="[target](canChangeCoping)" operator="=" value="False"/> 
    839                                  
    840                         </Effect> 
    841                 </Effects> 
    842         </Action>--> 
    843          
    844         <Action name="InferenceStrategyConfirmed([target],[coping])"> 
    845                 <PreConditions> 
    846                         <Property name="SpeechContext()" operator="=" value="#EVENT(User,UserSpeech,[target],yes,[coping])"/> 
    847                         <Property name="[coping]" operator="!=" value="null" /> 
    848                 </PreConditions> 
    849                 <Effects> 
    850                         <Effect probability="1.0"> 
    851                                 <Property name="[target](canChangeCoping)" operator="=" value="False"/> 
    852                                 <Property name="[target](copingStrategy)" operator="=" value="[coping]"/> 
    853                                 <Property name="[target](confirmedStrategy)" operator="=" value="True"/> 
    854                         </Effect> 
    855                 </Effects> 
    856         </Action> 
    857          
    858         <Action name="InferenceStrategyDisconfirmed([target])"> 
    859                 <PreConditions> 
    860                         <Property name="SpeechContext()" operator="=" value="#EVENT(User,UserSpeech,[target],no)"/> 
    861                         <Property name="[target](canChangeCoping)" operator="=" value="True"/> 
    862                 </PreConditions> 
    863                 <Effects> 
    864                         <Effect probability="1.0"> 
    865                                 <Property name="[target](canChangeCoping)" operator="=" value="False"/> 
    866                                 <Property name="[target](confirmedStrategy)" operator="=" value="False"/> 
    867                                 <Property name="[target](copingStrategy)" operator="=" value="False"/> 
    868                         </Effect> 
    869                 </Effects> 
    870         </Action> 
    871          
    872         <Action name="InferenceStrategyDeclined([target],[coping])"> 
    873                 <PreConditions> 
    874                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],CopingSpeech,User,declinecopingstrategy,[coping])"/> 
    875                 </PreConditions> 
    876                 <Effects> 
    877                         <Effect probability="1.0"> 
    878                                 <Property name="[target](confirmedStrategy)" operator="=" value="False"/> 
    879                                 <Property name="[target](copingStrategy)" operator="=" value="False"/> 
    880                         </Effect> 
    881                 </Effects> 
    882         </Action> 
    883          
    884         <Action name="InferenceCannotKeep([target])"> 
    885                 <PreConditions> 
    886                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],CopingSpeech,User,cannotkeepcopingstrategy,[cs])"/> 
    887                 </PreConditions> 
    888                 <Effects> 
    889                         <Effect probability="1.0"> 
    890                                 <Property name="[target](confirmedStrategy)" operator="=" value="False"/> 
    891                                 <Property name="[target](copingStrategy)" operator="=" value="False"/> 
    892                         </Effect> 
    893                 </Effects> 
    894         </Action> 
    895          
    896         <Action name="InferenceCanChangeCoping1([target])"> 
    897                 <PreConditions> 
    898                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],CopingSpeech,User,confirmcopingstrategy,[cs])"/> 
    899                 </PreConditions> 
    900                 <Effects> 
    901                         <Effect probability="1.0"> 
    902                                 <Property name="[target](canChangeCoping)" operator="=" value="True"/> 
    903                         </Effect> 
    904                 </Effects> 
    905         </Action> 
    906          
    907         <Action name="InferenceCanChangeCoping2([target])"> 
    908                 <PreConditions> 
    909                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],CopingSpeech,User,askifkeepcopingstrategy,[cs])"/> 
    910                 </PreConditions> 
    911                 <Effects> 
    912                         <Effect probability="1.0"> 
    913                                 <Property name="[target](canChangeCoping)" operator="=" value="True"/> 
    914                         </Effect> 
    915                 </Effects> 
    916         </Action> 
    917          
    918         <Action name="InferenceCanChangeCoping3([target])"> 
    919                 <PreConditions> 
    920                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],Question,User,askforadvice)"/> 
    921                 </PreConditions> 
    922                 <Effects> 
    923                         <Effect probability="1.0"> 
    924                                 <Property name="[target](canChangeCoping)" operator="=" value="True"/> 
    925                         </Effect> 
    926                 </Effects> 
    927         </Action> 
    928          
    929         <Action name="InferenceCanChangeCoping4([target])"> 
    930                 <PreConditions> 
    931                         <Property name="SpeechContext()" operator="=" value="#EVENT([target],Question,User,askforadvice2nd)"/> 
    932                 </PreConditions> 
    933                 <Effects> 
    934                         <Effect probability="1.0"> 
    935                                 <Property name="[target](canChangeCoping)" operator="=" value="True"/> 
    936                         </Effect> 
    937                 </Effects> 
    938         </Action> 
    939  
    940         <Action name="InferenceAskReason([target])"> 
    941                 <PreConditions> 
    942                         <RecentEvent occurred="True" subject="[SELF]" action="activate" target="AskCopingStrategy"/> 
    943                         <Property name="SpeechContext()" operator="=" value="#EVENT([SELF],Question,[target],askforreason)"/> 
    944                 </PreConditions> 
    945                 <Effects> 
    946                         <Effect probability="1.0"> 
    947                                 <Property name="[SELF](askedwhy,[target])" operator="=" value="True"/> 
    948                         </Effect> 
    949                 </Effects> 
    950         </Action> 
    951         <Action name="InferenceAskWhyKeep([target])"> 
    952                 <PreConditions> 
    953                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="AskCopingStrategy" /> 
    954                         <Property name="SpeechContext()" operator="=" value="#EVENT([SELF],Question,[target],askwhykeep)"/> 
    955                 </PreConditions> 
    956                 <Effects> 
    957                         <Effect probability="1.0"> 
    958                                 <Property name="[SELF](askedwhy,[target])" operator="=" value="True"/> 
    959                         </Effect> 
    960                 </Effects> 
    961         </Action> 
    962  
    963         <!-- grande martelada .. --> 
    964         <Action name="InferenceMarteladaNotAskWhy(user)"> 
    965                 <PreConditions> 
    966                         <RecentEvent occurred="True" subject="[SELF]" action="activate" target="WaitForReason" /> 
    967                 </PreConditions> 
    968                 <Effects> 
    969                         <Effect probability="1.0"> 
    970                                 <Property name="[SELF](askedwhy,User)" operator="=" value="False"/> 
    971                         </Effect> 
    972                 </Effects> 
    973         </Action> 
    974         <!-- fim da martelada --> 
    975  
    976  
    977          
    978         <!-- the following operators deal with the counting of coping strategies selected --> 
    979         <Action name="InferenceIgnoreSelected()"> 
    980                 <PreConditions> 
    981                         <RecentEvent occurred="True" subject="[SELF]" action="activate" target="Ignore"/> 
    982                         <Property name="stopInference(ignore)" operator="!=" value="True"/> 
    983                 </PreConditions> 
    984                 <Effects> 
    985                         <Effect probability="1.0"> 
    986                                 <Property name="stopInference(ignore)" operator="=" value="True"/> 
    987                                 <Property name="Increment(ignore)" operator="=" value="True"/> 
    988                         </Effect> 
    989                 </Effects> 
    990         </Action> 
    991         <Action name="InferenceIgnoreUnSelected()"> 
    992                 <PreConditions> 
    993                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="Ignore"/> 
    994                 </PreConditions> 
    995                 <Effects> 
    996                         <Effect probability="1.0"> 
    997                                 <Property name="stopInference(ignore)" operator="=" value="False"/> 
    998                         </Effect> 
    999                 </Effects> 
    1000         </Action> 
    1001         <Action name="InferenceStandUpSelected()"> 
    1002                 <PreConditions> 
    1003                         <RecentEvent occurred="True" subject="[SELF]" action="activate" target="StandUp"/> 
    1004                         <Property name="stopInference(standup)" operator="!=" value="True"/> 
    1005                 </PreConditions> 
    1006                 <Effects> 
    1007                         <Effect probability="1.0"> 
    1008                                 <Property name="stopInference(standup)" operator="=" value="True"/> 
    1009                                 <Property name="Increment(standup)" operator="=" value="True"/> 
    1010                         </Effect> 
    1011                 </Effects> 
    1012         </Action> 
    1013         <Action name="InferenceStandUpUnSelected()"> 
    1014                 <PreConditions> 
    1015                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="StandUp"/> 
    1016                 </PreConditions> 
    1017                 <Effects> 
    1018                         <Effect probability="1.0"> 
    1019                                 <Property name="stopInference(standup)" operator="=" value="False"/> 
    1020                         </Effect> 
    1021                 </Effects> 
    1022         </Action> 
    1023         <Action name="InferenceMakeNewFriendSelected()"> 
    1024                 <PreConditions> 
    1025                         <RecentEvent occurred="True" subject="[SELF]" action="activate" target="MakeNewFriend"/> 
    1026                         <Property name="stopInference(makenewfriend)" operator="!=" value="True"/> 
    1027                 </PreConditions> 
    1028                 <Effects> 
    1029                         <Effect probability="1.0"> 
    1030                                 <Property name="stopInference(makenewfriend)" operator="=" value="True"/> 
    1031                                 <Property name="Increment(makenewfriend)" operator="=" value="True"/> 
    1032                         </Effect> 
    1033                 </Effects> 
    1034         </Action> 
    1035         <Action name="InferenceMakeNewFriendUnSelected()"> 
    1036                 <PreConditions> 
    1037                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="MakeNewFriend"/> 
    1038                 </PreConditions> 
    1039                 <Effects> 
    1040                         <Effect probability="1.0"> 
    1041                                 <Property name="stopInference(makenewfriend)" operator="=" value="False"/> 
    1042                         </Effect> 
    1043                 </Effects> 
    1044         </Action> 
    1045         <Action name="InferenceTellFriendSelected()"> 
    1046                 <PreConditions> 
    1047                         <RecentEvent occurred="True" subject="[SELF]" action="activate" target="TellFriend"/> 
    1048                         <Property name="stopInference(tellfriend)" operator="!=" value="True"/> 
    1049                 </PreConditions> 
    1050                 <Effects> 
    1051                         <Effect probability="1.0"> 
    1052                                 <Property name="stopInference(tellfriend)" operator="=" value="True"/> 
    1053                                 <Property name="Increment(tellfriend)" operator="=" value="True"/> 
    1054                         </Effect> 
    1055                 </Effects> 
    1056         </Action> 
    1057         <Action name="InferenceTellFriendUnSelected()"> 
    1058                 <PreConditions> 
    1059                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="TellFriend"/> 
    1060                 </PreConditions> 
    1061                 <Effects> 
    1062                         <Effect probability="1.0"> 
    1063                                 <Property name="stopInference(tellfriend)" operator="=" value="False"/> 
    1064                         </Effect> 
    1065                 </Effects> 
    1066         </Action> 
    1067         <Action name="InferenceWalkAwaySelected()"> 
    1068                 <PreConditions> 
    1069                         <RecentEvent occurred="True" subject="[SELF]" action="activate" target="WalkAway"/> 
    1070                         <Property name="stopInference(walkaway)" operator="!=" value="True"/> 
    1071                 </PreConditions> 
    1072                 <Effects> 
    1073                         <Effect probability="1.0"> 
    1074                                 <Property name="stopInference(walkaway)" operator="=" value="True"/> 
    1075                                 <Property name="Increment(walkaway)" operator="=" value="True"/> 
    1076                         </Effect> 
    1077                 </Effects> 
    1078         </Action> 
    1079         <Action name="InferenceWalkAwayUnSelected()"> 
    1080                 <PreConditions> 
    1081                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="WalkAway"/> 
    1082                 </PreConditions> 
    1083                 <Effects> 
    1084                         <Effect probability="1.0"> 
    1085                                 <Property name="stopInference(walkAway)" operator="=" value="False"/> 
    1086                         </Effect> 
    1087                 </Effects> 
    1088         </Action> 
    1089         <Action name="InferenceRunAwaySelected()"> 
    1090                 <PreConditions> 
    1091                         <RecentEvent occurred="True" subject="[SELF]" action="activate" target="RunAway"/> 
    1092                         <Property name="stopInference(runaway)" operator="!=" value="True"/> 
    1093                 </PreConditions> 
    1094                 <Effects> 
    1095                         <Effect probability="1.0"> 
    1096                                 <Property name="stopInference(runaway)" operator="=" value="True"/> 
    1097                                 <Property name="Increment(runaway)" operator="=" value="True"/> 
    1098                         </Effect> 
    1099                 </Effects> 
    1100         </Action> 
    1101         <Action name="InferenceRunAwayUnSelected()"> 
    1102                 <PreConditions> 
    1103                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="RunAway"/> 
    1104                 </PreConditions> 
    1105                 <Effects> 
    1106                         <Effect probability="1.0"> 
    1107                                 <Property name="stopInference(runaway)" operator="=" value="False"/> 
    1108                         </Effect> 
    1109                 </Effects> 
    1110         </Action> 
    1111         <Action name="InferenceLaughOffSelected()"> 
    1112                 <PreConditions> 
    1113                         <RecentEvent occurred="True" subject="[SELF]" action="activate" target="LaughOff"/> 
    1114                         <Property name="stopInference(laughoff)" operator="!=" value="True"/> 
    1115                 </PreConditions> 
    1116                 <Effects> 
    1117                         <Effect probability="1.0"> 
    1118                                 <Property name="stopInference(laughoff)" operator="=" value="True"/> 
    1119                                 <Property name="Increment(laughoff)" operator="=" value="True"/> 
    1120                         </Effect> 
    1121                 </Effects> 
    1122         </Action> 
    1123         <Action name="InferenceLaughOffUnSelected()"> 
    1124                 <PreConditions> 
    1125                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="LaughOff"/> 
    1126                 </PreConditions> 
    1127                 <Effects> 
    1128                         <Effect probability="1.0"> 
    1129                                 <Property name="stopInference(laughoff)" operator="=" value="False"/> 
    1130                         </Effect> 
    1131                 </Effects> 
    1132         </Action> 
    1133         <Action name="InferenceFightBackSelected()"> 
    1134                 <PreConditions> 
    1135                         <RecentEvent occurred="True" subject="[SELF]" action="activate" target="FightBack"/> 
    1136                         <Property name="stopInference(fightback)" operator="!=" value="True"/> 
    1137                 </PreConditions> 
    1138                 <Effects> 
    1139                         <Effect probability="1.0"> 
    1140                                 <Property name="stopInference(fightback)" operator="=" value="True"/> 
    1141                                 <Property name="Increment(fightback)" operator="=" value="True"/> 
    1142                         </Effect> 
    1143                 </Effects> 
    1144         </Action> 
    1145         <Action name="InferenceFightBackUnSelected()"> 
    1146                 <PreConditions> 
    1147                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="FightBack"/> 
    1148                 </PreConditions> 
    1149                 <Effects> 
    1150                         <Effect probability="1.0"> 
    1151                                 <Property name="stopInference(fightback)" operator="=" value="False"/> 
    1152                         </Effect> 
    1153                 </Effects> 
    1154         </Action> 
    1155         <Action name="InferenceInsultSelected()"> 
    1156                 <PreConditions> 
    1157                         <RecentEvent occurred="True" subject="[SELF]" action="activate" target="Insult"/> 
    1158                         <Property name="stopInference(insult)" operator="!=" value="True"/> 
    1159                 </PreConditions> 
    1160                 <Effects> 
    1161                         <Effect probability="1.0"> 
    1162                                 <Property name="stopInference(insult)" operator="=" value="True"/> 
    1163                                 <Property name="Increment(insult)" operator="=" value="True"/> 
    1164                         </Effect> 
    1165                 </Effects> 
    1166         </Action> 
    1167         <Action name="InferenceInsultUnSelected()"> 
    1168                 <PreConditions> 
    1169                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="Insult"/> 
    1170                 </PreConditions> 
    1171                 <Effects> 
    1172                         <Effect probability="1.0"> 
    1173                                 <Property name="stopInference(insult)" operator="=" value="False"/> 
    1174                         </Effect> 
    1175                 </Effects> 
    1176         </Action> 
    1177         <Action name="InferenceIncrementCS1([coping])"> 
    1178                 <PreConditions> 
    1179                         <Property name="Increment([coping])" operator="=" value="True"/> 
    1180                         <Property name="[SELF](numberOfTries,[coping])" operator="=" value="0"/> 
    1181                 </PreConditions> 
    1182                 <Effects> 
    1183                         <Effect probability="1.0"> 
    1184                                 <Property name="Increment([coping])" operator="=" value="False"/> 
    1185                                 <Property name="[SELF](numberOfTries,[coping])" operator="=" value="1"/> 
    1186                         </Effect> 
    1187                 </Effects> 
    1188         </Action> 
    1189         <Action name="InferenceIncrementCS2([coping])"> 
    1190                 <PreConditions> 
    1191                         <Property name="Increment([coping])" operator="=" value="True"/> 
    1192                         <Property name="[SELF](numberOfTries,[coping])" operator="=" value="1"/> 
    1193                 </PreConditions> 
    1194                 <Effects> 
    1195                         <Effect probability="1.0"> 
    1196                                 <Property name="Increment([coping])" operator="=" value="False"/> 
    1197                                 <Property name="[SELF](numberOfTries,[coping])" operator="=" value="2"/> 
    1198                         </Effect> 
    1199                 </Effects> 
    1200         </Action> 
    1201         <Action name="InferenceIncrementCS3([coping])"> 
    1202                 <PreConditions> 
    1203                         <Property name="Increment([coping])" operator="=" value="True"/> 
    1204                         <Property name="[SELF](numberOfTries,[coping])" operator="=" value="2"/> 
    1205                 </PreConditions> 
    1206                 <Effects> 
    1207                         <Effect probability="1.0"> 
    1208                                 <Property name="Increment([coping])" operator="=" value="False"/> 
    1209                                 <Property name="[SELF](numberOfTries,[coping])" operator="=" value="3"/> 
    1210                         </Effect> 
    1211                 </Effects> 
    1212         </Action> 
    1213         <Action name="InferenceIncrementCS4([coping])"> 
    1214                 <PreConditions> 
    1215                         <Property name="Increment([coping])" operator="=" value="True"/> 
    1216                         <Property name="[SELF](numberOfTries,[coping])" operator="=" value="3"/> 
    1217                 </PreConditions> 
    1218                 <Effects> 
    1219                         <Effect probability="1.0"> 
    1220                                 <Property name="Increment([coping])" operator="=" value="False"/> 
    1221                                 <Property name="[SELF](numberOfTries,[coping])" operator="=" value="4"/> 
    1222                         </Effect> 
    1223                 </Effects> 
    1224         </Action> 
    1225         <Action name="InferenceIncrementCS5([coping])"> 
    1226                 <PreConditions> 
    1227                         <Property name="Increment([coping])" operator="=" value="True"/> 
    1228                         <Property name="[SELF](numberOfTries,[coping])" operator="=" value="4"/> 
    1229                 </PreConditions> 
    1230                 <Effects> 
    1231                         <Effect probability="1.0"> 
    1232                                 <Property name="Increment([coping])" operator="=" value="False"/> 
    1233                                 <Property name="[SELF](numberOfTries,[coping])" operator="=" value="5"/> 
    1234                         </Effect> 
    1235                 </Effects> 
    1236         </Action> 
    1237         <Action name="InferenceIncrementCS6([coping])"> 
    1238                 <PreConditions> 
    1239                         <Property name="Increment([coping])" operator="=" value="True"/> 
    1240                         <Property name="[SELF](numberOfTries,[coping])" operator="=" value="5"/> 
    1241                 </PreConditions> 
    1242                 <Effects> 
    1243                         <Effect probability="1.0"> 
    1244                                 <Property name="Increment([coping])" operator="=" value="False"/> 
    1245                                 <Property name="[SELF](numberOfTries,[coping])" operator="=" value="6"/> 
    1246                         </Effect> 
    1247                 </Effects> 
    1248         </Action> 
    1249         <!-- Annoyed inferences --> 
    1250         <Action name="InferenceAnnoyed1([target])"> 
    1251                 <PreConditions> 
    1252                         <RecentEvent occurred="True" subject="[target]" action="SpeechAct" target="[any]" parameters="protest"/> 
    1253                 </PreConditions> 
    1254                 <Effects> 
    1255                         <Effect probability="1.0"> 
    125619                                <Property name="[target](annoyed)" operator="=" value="True"/> 
    125720                        </Effect> 
    125821                </Effects> 
    125922        </Action> 
    1260         <Action name="InferenceAnnoyed2([target])"> 
    1261                 <PreConditions> 
    1262                         <RecentEvent occurred="True" subject="[target]" action="cry"/> 
    1263                 </PreConditions> 
    1264                 <Effects> 
    1265                         <Effect probability="1.0"> 
    1266                                 <Property name="[target](annoyed)" operator="=" value="True"/> 
    1267                         </Effect> 
    1268                 </Effects> 
    1269         </Action> 
    1270         <Action name="InferenceAnnoyed3([target])"> 
    1271                 <PreConditions> 
    1272                         <RecentEvent occurred="True" subject="[target]" action="SpeechAct" target="[any]" parameters="insult"/> 
    1273                 </PreConditions> 
    1274                 <Effects> 
    1275                         <Effect probability="1.0"> 
    1276                                 <Property name="[target](annoyed)" operator="=" value="True"/> 
    1277                         </Effect> 
    1278                 </Effects> 
    1279         </Action> 
    1280         <Action name="InferenceAnnoyed4([target])"> 
    1281                 <PreConditions> 
    1282                         <RecentEvent occurred="True" subject="[target]" action="Question" target="[any]" parameters="threatfightback"/> 
    1283                 </PreConditions> 
    1284                 <Effects> 
    1285                         <Effect probability="1.0"> 
    1286                                 <Property name="[target](annoyed)" operator="=" value="True"/> 
    1287                         </Effect> 
    1288                 </Effects> 
    1289         </Action> 
    1290         <!-- Inference operators for the "join group" situation that involves 3 agents, i.e. trying to join a groupOf2 --> 
    1291         <Action name="InferenceGroup1([JoinAgent],[GroupAgent1],[GroupAgent2],[group])"> 
    1292                 <PreConditions> 
    1293                         <Property name="[group](isGroupOf2)" operator="=" value="True"/> 
    1294                         <Property name="[GroupAgent1](role)" operator="=" value="Bully"/> 
    1295                         <Property name="[GroupAgent2](role)" operator="=" value="Defender"/> 
    1296                         <Property name="[JoinAgent](inGroup,[group])" operator="=" value="Pending"/> 
    1297                         <Property name="[GroupAgent1](inGroup,[group])" operator="=" value="True"/> 
    1298                         <Property name="[GroupAgent2](inGroup,[group])" operator="=" value="True"/> 
    1299                         <RecentEvent occurred="True" subject="[GroupAgent1]" action="Reply" target="[JoinAgent]" parameters="joingroupquestion,positiveanswer,[group]"/> 
    1300                         <RecentEvent occurred="True" subject="[GroupAgent2]" action="Reply" target="[JoinAgent]" parameters="joingroupquestion,positiveanswer,[group]"/> 
    1301                 </PreConditions> 
    1302                 <Effects> 
    1303                         <Effect probability="1"> 
    1304                                 <Property name="[JoinAgent](inGroup,[group])" operator="=" value="True"/> 
    1305                         </Effect> 
    1306                 </Effects> 
    1307         </Action> 
    1308         <Action name="InferenceGroup2([JoinAgent],[GroupAgent1],[group])"> 
    1309                 <PreConditions> 
    1310                         <Property name="[group](isGroupOf2)" operator="=" value="True"/> 
    1311                         <Property name="[GroupAgent1](role)" operator="=" value="Bully"/> 
    1312                         <Property name="[GroupAgent2](role)" operator="=" value="Defender"/> 
    1313                         <Property name="[JoinAgent](inGroup,[group])" operator="=" value="Pending"/> 
    1314                         <Property name="[GroupAgent1](inGroup,[group])" operator="=" value="True"/> 
    1315                         <Property name="[GroupAgent2](inGroup,[group])" operator="=" value="True"/> 
    1316                         <RecentEvent occurred="True" subject="[GroupAgent1]" action="Reply" target="[JoinAgent]" parameters="joingroupquestion,negativeanswer,[group]"/> 
    1317                         <RecentEvent occurred="True" subject="[GroupAgent2]" action="Reply" target="[JoinAgent]" parameters="joingroupquestion,negativeanswer,[group]"/> 
    1318                 </PreConditions> 
    1319                 <Effects> 
    1320                         <Effect probability="1"> 
    1321                                 <Property name="[JoinAgent](inGroup,[group])" operator="=" value="False"/> 
    1322                         </Effect> 
    1323                         <Effect probability="1"> 
    1324                                 <Property name="[JoinAgent](needToCope)" operator="=" value="True"/> 
    1325                         </Effect> 
    1326                 </Effects> 
    1327         </Action> 
    1328         <!-- For the next inference operators we will use the variables AgentPos and AgentNeg. All inferences 
    1329                   refer to situations where, one agent tries to overpower the other in the question, of whether the  
    1330                   victim should be allowed to join. AgentPos is the agent who (initially) wants the victim to join (usually Defender), 
    1331                   AgentNeg, the one who does not want that. 
    1332                   The overpowered property reads like this: 
    1333  
    1334                   Helper(GroupAprovalOverpowered,Bully) = True means the helper could overpower the bully, John is in the group. 
    1335                         This is used when the bully started objecting. 
    1336                   Helper(GroupAprovalOverpowered,Bully) = False means the helper could NOT overpower the bully, John is NOT in the group. 
    1337                         This is used when the bully started objecting. 
    1338                   Bully(GroupAprovalOverpowered,Helper) = True means the bully could overpower the helper, John is NOT in the group. 
    1339                         This is used when the helper started objecting. 
    1340                   Bully(GroupAprovalOverpowered,Helper) = True means the bully could NOT overpower the helper, John is in the group. 
    1341                         This is used when the helper started objecting. 
    1342  --> 
    1343         <Action name="InferenceGroup3([JoinAgent],[AgentNeg],[group])"> 
    1344                 <PreConditions> 
    1345                         <Property name="[group](isGroupOf2)" operator="=" value="True"/> 
    1346                         <Property name="[AgentNeg](role)" operator="=" value="Bully"/> 
    1347                         <Property name="[AgentPos](role)" operator="=" value="Defender"/> 
    1348                         <Property name="[JoinAgent](inGroup,[group])" operator="=" value="Pending"/> 
    1349                         <Property name="[AgentNeg](inGroup,[group])" operator="=" value="True"/> 
    1350                         <Property name="[AgentPos](inGroup,[group])" operator="=" value="True"/> 
    1351                         <RecentEvent occurred="True" subject="[AgentNeg]" action="Reply" target="[JoinAgent]" parameters="joingroupquestion,negativeanswer,[group]"/> 
    1352                         <RecentEvent occurred="True" subject="[AgentPos]" action="Reply" target="[JoinAgent]" parameters="joingroupquestion,positiveanswer,[group]"/> 
    1353                         <Property name="[AgentPos](groupApprovalOverPowered,[AgentNeg],[group])" operator="=" value="False"/> 
    1354                 </PreConditions> 
    1355                 <Effects> 
    1356                         <Effect probability="1"> 
    1357                                 <Property name="[JoinAgent](inGroup,[group])" operator="=" value="False"/> 
    1358                         </Effect> 
    1359                         <Effect probability="1"> 
    1360                                 <Property name="[JoinAgent](needToCope)" operator="=" value="True"/> 
    1361                         </Effect> 
    1362                 </Effects> 
    1363         </Action> 
    1364         <Action name="InferenceGroup4([JoinAgent],[AgentNeg],[group])"> 
    1365                 <PreConditions> 
    1366                         <Property name="[group](isGroupOf2)" operator="=" value="True"/> 
    1367                         <Property name="[AgentNeg](role)" operator="=" value="Bully"/> 
    1368                         <Property name="[AgentPos](role)" operator="=" value="Defender"/> 
    1369                         <Property name="[JoinAgent](inGroup,[group])" operator="=" value="Pending"/> 
    1370                         <Property name="[AgentNeg](inGroup,[group])" operator="=" value="True"/> 
    1371                         <Property name="[AgentPos](inGroup,[group])" operator="=" value="True"/> 
    1372                         <RecentEvent occurred="True" subject="[AgentNeg]" action="Reply" target="[JoinAgent]" parameters="joingroupquestion,negativeanswer,[group]"/> 
    1373                         <RecentEvent occurred="True" subject="[AgentPos]" action="Reply" target="[JoinAgent]" parameters="joingroupquestion,positiveanswer,[group]"/> 
    1374                         <Property name="[AgentPos](groupApprovalOverPowered,[AgentNeg],[group])" operator="=" value="True"/> 
    1375                 </PreConditions> 
    1376                 <Effects> 
    1377                         <Effect probability="1"> 
    1378                                 <Property name="[JoinAgent](inGroup,[group])" operator="=" value="True"/> 
    1379                         </Effect> 
    1380                 </Effects> 
    1381         </Action> 
    1382         <Action name="InferenceGroup5([JoinAgent],[AgentNeg],[group])"> 
    1383                 <PreConditions> 
    1384                         <Property name="[group](isGroupOf2)" operator="=" value="True"/> 
    1385                         <Property name="[AgentNeg](role)" operator="=" value="Bully"/> 
    1386                         <Property name="[AgentPos](role)" operator="=" value="Defender"/> 
    1387                         <Property name="[JoinAgent](inGroup,[group])" operator="=" value="Pending"/> 
    1388                         <Property name="[AgentNeg](inGroup,[group])" operator="=" value="True"/> 
    1389                         <Property name="[AgentPos](inGroup,[group])" operator="=" value="True"/> 
    1390                         <RecentEvent occurred="True" subject="[AgentNeg]" action="Reply" target="[JoinAgent]" parameters="joingroupquestion,negativeanswer,[group]"/> 
    1391                         <RecentEvent occurred="True" subject="[AgentPos]" action="Reply" target="[JoinAgent]" parameters="joingroupquestion,positiveanswer,[group]"/> 
    1392                         <Property name="[AgentNeg](groupApprovalOverPowered,[AgentPos],[group])" operator="=" value="True"/> 
    1393                 </PreConditions> 
    1394                 <Effects> 
    1395                         <Effect probability="1"> 
    1396                                 <Property name="[JoinAgent](inGroup,[group])" operator="=" value="False"/> 
    1397                         </Effect> 
    1398                         <Effect probability="1"> 
    1399                                 <Property name="[JoinAgent](needToCope)" operator="=" value="True"/> 
    1400                         </Effect> 
    1401                 </Effects> 
    1402         </Action> 
    1403         <Action name="InferenceGroup6([JoinAgent],[AgentNeg],[group])"> 
    1404                 <PreConditions> 
    1405                         <Property name="[group](isGroupOf2)" operator="=" value="True"/> 
    1406                         <Property name="[AgentNeg](role)" operator="=" value="Bully"/> 
    1407                         <Property name="[AgentPos](role)" operator="=" value="Defender"/> 
    1408                         <Property name="[JoinAgent](inGroup,[group])" operator="=" value="Pending"/> 
    1409                         <Property name="[AgentNeg](inGroup,[group])" operator="=" value="True"/> 
    1410                         <Property name="[AgentPos](inGroup,[group])" operator="=" value="True"/> 
    1411                         <RecentEvent occurred="True" subject="[AgentNeg]" action="Reply" target="[JoinAgent]" parameters="joingroupquestion,negativeanswer,[group]"/> 
    1412                         <RecentEvent occurred="True" subject="[AgentPos]" action="Reply" target="[JoinAgent]" parameters="joingroupquestion,positiveanswer,[group]"/> 
    1413                         <Property name="[AgentNeg](groupApprovalOverPowered,[AgentPos],[group])" operator="=" value="False"/> 
    1414                 </PreConditions> 
    1415                 <Effects> 
    1416                         <Effect probability="1"> 
    1417                                 <Property name="[JoinAgent](inGroup,[group])" operator="=" value="True"/> 
    1418                         </Effect> 
    1419                 </Effects> 
    1420         </Action> 
    1421         <Action name="InferenceGroup11([AgentNeg],[AgentPos],[group])"> 
    1422                 <PreConditions> 
    1423                         <Property name="[AgentNeg](role)" operator="=" value="Bully"/> 
    1424                         <Property name="[AgentPos](role)" operator="=" value="Defender"/> 
    1425                         <RecentEvent subject="[AgentPos]" target="[AgentNeg]" action="SpeechAct" parameters="joingroupquestionnegativeanswerobjectacceptanswer,[group]"/> 
    1426                 </PreConditions> 
    1427                 <Effects> 
    1428                         <Effect probability="1"> 
    1429                                 <Property name="[AgentNeg](groupApprovalOverPowered,[AgentPos],[group])" operator="=" value="False"/> 
    1430                         </Effect> 
    1431                 </Effects> 
    1432         </Action> 
    1433         <Action name="InferenceGroup12([AgentNeg],[AgentPos],[group])"> 
    1434                 <PreConditions> 
    1435                         <Property name="[AgentNeg](role)" operator="=" value="Bully"/> 
    1436                         <Property name="[AgentPos](role)" operator="=" value="Defender"/> 
    1437                         <RecentEvent subject="[AgentPos]" target="[AgentNeg]" action="SpeechAct" parameters="joingroupquestionthreatleavepositiveanswer,[group]"/> 
    1438                 </PreConditions> 
    1439                 <Effects> 
    1440                         <Effect probability="1"> 
    1441                                 <Property name="[AgentNeg](groupApprovalOverPowered,[AgentPos],[group])" operator="=" value="True"/> 
    1442                         </Effect> 
    1443                 </Effects> 
    1444         </Action> 
    1445         <Action name="InferenceGroup13([AgentNeg],[AgentPos],[group])"> 
    1446                 <PreConditions> 
    1447                         <Property name="[AgentNeg](role)" operator="=" value="Bully"/> 
    1448                         <Property name="[AgentPos](role)" operator="=" value="Defender"/> 
    1449                         <RecentEvent subject="[AgentPos]" target="[AgentNeg]" action="SpeechAct" parameters="joingroupquestionthreatleavenegativeanswer,[group]"/> 
    1450                 </PreConditions> 
    1451                 <Effects> 
    1452                         <Effect probability="1"> 
    1453                                 <Property name="[AgentNeg](groupApprovalOverPowered,[AgentPos],[group])" operator="=" value="False"/> 
    1454                         </Effect> 
    1455                 </Effects> 
    1456         </Action> 
    1457         <Action name="InferenceGroup16([AgentPos],[AgentNeg],[group])"> 
    1458                 <PreConditions> 
    1459                         <Property name="[AgentNeg](role)" operator="=" value="Bully"/> 
    1460                         <Property name="[AgentPos](role)" operator="=" value="Defender"/> 
    1461                         <RecentEvent subject="[AgentPos]" target="[AgentNeg]" action="Reply" parameters="joingroupquestionpositiveanswerobject,negativeanswer,[group]"/> 
    1462                 </PreConditions> 
    1463                 <Effects> 
    1464                         <Effect probability="1"> 
    1465                                 <Property name="[AgentPos](groupApprovalOverPowered,[AgentNeg],[group])" operator="=" value="True"/> 
    1466                         </Effect> 
    1467                 </Effects> 
    1468         </Action> 
    1469         <Action name="InferenceGroup17([AgentPos],[AgentNeg],[group])"> 
    1470                 <PreConditions> 
    1471                         <Property name="[AgentNeg](role)" operator="=" value="Bully"/> 
    1472                         <Property name="[AgentPos](role)" operator="=" value="Defender"/> 
    1473                         <RecentEvent subject="[AgentPos]" target="[AgentNeg]" action="Reply" parameters="joingroupquestionpositiveanswerobject,positiveanswer,[group]"/> 
    1474                 </PreConditions> 
    1475                 <Effects> 
    1476                         <Effect probability="1"> 
    1477                                 <Property name="[AgentPos](groupApprovalOverPowered,[AgentNeg],[group])" operator="=" value="False"/> 
    1478                         </Effect> 
    1479                 </Effects> 
    1480         </Action> 
    1481         <!-- Inference operators for the "join group" situation that involves 2 agents,  i.e. trying to join a groupOf1 --> 
    1482         <Action name="InferenceGroup8([JoinAgent],[GroupAgent],[group])"> 
    1483                 <PreConditions> 
    1484                         <Property name="[group](isGroupOf1)" operator="=" value="True"/> 
    1485                         <Property name="[JoinAgent](inGroup,[group])" operator="=" value="Pending"/> 
    1486                         <Property name="[GroupAgent](inGroup,[group])" operator="=" value="True"/> 
    1487                         <RecentEvent subject="[GroupAgent]" target="[JoinAgent]" action="Reply" parameters="joingroupquestion,positiveanswer,[group]"/> 
    1488                 </PreConditions> 
    1489                 <Effects> 
    1490                         <Effect probability="1"> 
    1491                                 <Property name="[JoinAgent](inGroup,[group])" operator="=" value="True"/> 
    1492                         </Effect> 
    1493                 </Effects> 
    1494         </Action> 
    1495         <Action name="InferenceGroup9([JoinAgent],[GroupAgent],[group])"> 
    1496                 <PreConditions> 
    1497                         <Property name="[group](isGroupOf1)" operator="=" value="True"/> 
    1498                         <Property name="[JoinAgent](inGroup,[group])" operator="=" value="Pending"/> 
    1499                         <Property name="[GroupAgent](inGroup,[group])" operator="=" value="True"/> 
    1500                         <RecentEvent subject="[GroupAgent]" target="[JoinAgent]" action="Reply" parameters="joingroupconvince,positiveanswer,[group]"/> 
    1501                 </PreConditions> 
    1502                 <Effects> 
    1503                         <Effect probability="1"> 
    1504                                 <Property name="[JoinAgent](inGroup,[group])" operator="=" value="True"/> 
    1505                         </Effect> 
    1506                 </Effects> 
    1507         </Action> 
    1508         <Action name="InferenceGroup10([JoinAgent],[GroupAgent],[group])"> 
    1509                 <PreConditions> 
    1510                         <Property name="[group](isGroupOf1)" operator="=" value="True"/> 
    1511                         <Property name="[JoinAgent](inGroup,[group])" operator="=" value="Pending"/> 
    1512                         <Property name="[GroupAgent](inGroup,[group])" operator="=" value="True"/> 
    1513                         <RecentEvent subject="[GroupAgent]" target="[JoinAgent]" action="Reply" parameters="joingroupconvince,negativeanswer,[group]"/> 
    1514                 </PreConditions> 
    1515                 <Effects> 
    1516                         <Effect probability="1"> 
    1517                                 <Property name="[JoinAgent](inGroup,[group])" operator="=" value="False"/> 
    1518                         </Effect> 
    1519                         <Effect probability="1"> 
    1520                                 <Property name="[JoinAgent](needToCope)" operator="=" value="True"/> 
    1521                         </Effect> 
    1522                 </Effects> 
    1523         </Action> 
    1524         <!-- Friendship inferences --> 
    1525         <Action name="InferenceFriends([ag1],[ag2])"> 
    1526                 <PreConditions> 
    1527                         <RecentEvent occurred="True" subject="[ag1]" target="[ag2]" action="Reply" parameters="makefriend,positiveanswer"/> 
    1528                 </PreConditions> 
    1529                 <Effects> 
    1530                         <Effect probability="1"> 
    1531                                 <Property name="[ag1](friend,[ag2])" operator="=" value="True"/> 
    1532                                 <Property name="[ag2](friend,[ag1])" operator="=" value="True"/> 
    1533                         </Effect> 
    1534                 </Effects> 
    1535         </Action> 
    1536         <!-- Helper inferences --> 
    1537         <Action name="InferenceHelper1([ag1],[ag2])"> 
    1538                 <PreConditions> 
    1539                         <RecentEvent occurred="True" subject="[ag1]" target="[ag2]" action="Reply" parameters="askforhelp,positiveanswer"/> 
    1540                 </PreConditions> 
    1541                 <Effects> 
    1542                         <Effect probability="1"> 
    1543                                 <Property name="[ag1](helper,[ag2])" operator="=" value="True"/> 
    1544                         </Effect> 
    1545                 </Effects> 
    1546         </Action> 
    1547         <Action name="InferenceHelper([ag1],[ag2])"> 
    1548                 <PreConditions> 
    1549                         <RecentEvent occurred="True" subject="[ag1]" target="[ag2]" action="Reply" parameters="helpprotection,positiveanswer"/> 
    1550                 </PreConditions> 
    1551                 <Effects> 
    1552                         <Effect probability="1"> 
    1553                                 <Property name="[ag2](helper,[ag1])" operator="=" value="True"/> 
    1554                         </Effect> 
    1555                 </Effects> 
    1556         </Action> 
    155723</DomainActions> 
  • scenarios/GerminationX/oak/data/characters/minds/GoalLibrary.xml

    r437 r898  
    88                </ProtectionConstraints> 
    99        </InterestGoal> 
    10          
    11         <InterestGoal name="AvoidAnyRisk"> 
    12                 <ProtectionConstraints> 
    13                         <Property name="[SELF](atRisk)" operator="=" value="False"/> 
    14                 </ProtectionConstraints> 
    15         </InterestGoal> 
    16          
    17         <InterestGoal name="AvoidLookCoward"> 
    18                 <ProtectionConstraints> 
    19                         <Property name="[SELF](lookCoward)" operator="=" value="False"/> 
    20                 </ProtectionConstraints> 
    21         </InterestGoal> 
    22          
    23         <!-- interaction goals (used for the interaction between the victim and the user)--> 
    24         <ActivePursuitGoal name="GreetUserFirstTime(user)"> 
     10 
     11        <ActivePursuitGoal name="SingAt([target])"> 
    2512                <PreConditions> 
    26                         <RecentEvent occurred="True" subject="[SELF]" action="look-at" target="User" /> 
    27                         <PastEvent occurred="False" subject="[SELF]" action="look-at" target="User" /> 
    28                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="User" parameters="firstgreeting" /> 
    2913                </PreConditions> 
    3014                <SucessConditions> 
    31                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="User" parameters="firstgreeting" /> 
    32                 </SucessConditions> 
    33                 <FailureConditions> 
    34                 </FailureConditions> 
    35         </ActivePursuitGoal> 
    36  
    37         <ActivePursuitGoal name="GreetUser(user)"> 
    38                 <PreConditions> 
    39                         <RecentEvent occurred="True" subject="[SELF]" action="look-at" target="User" /> 
    40                         <PastEvent occurred="True" subject="[SELF]" action="look-at" target="User" /> 
    41                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="User" parameters="agentgreeting" /> 
    42                 </PreConditions> 
    43                 <SucessConditions> 
    44                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="User" parameters="agentgreeting" /> 
    45                 </SucessConditions> 
    46                 <FailureConditions> 
    47                 </FailureConditions> 
    48         </ActivePursuitGoal> 
    49          
    50         <!--<ActivePursuitGoal name="SummarizeLastEpisode(user)"> 
    51                 <PreConditions> 
    52                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="User" /> 
    53                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="User" parameters="episodesummary" /> 
    54                 </PreConditions> 
    55                 <SucessConditions> 
    56                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="User" parameters="episodesummary" /> 
    57                 </SucessConditions> 
    58                 <FailureConditions> 
    59                 </FailureConditions> 
    60         </ActivePursuitGoal>--> 
    61          
    62         <ActivePursuitGoal name="AskIfKeepStrategy(user)"> 
    63                 <PreConditions> 
    64                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="User" /> 
    65                         <Property name="[SELF](copingStrategy)" operator="=" value="[coping]" /> 
    66                         <Property name="[coping]" operator="!=" value="False" /> 
    67                         <Property name="[SELF](numberOfTries,[coping])" operator="LesserThan" value="[SELF](maxTries,[coping])" /> 
    68                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="AskIfKeepStrategy" parameters="user" /> 
    69                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="AskCopingStrategy" parameters="user" /> 
    70                 </PreConditions> 
    71                 <SucessConditions> 
    72                         <Property name="[SELF](confirmedStrategy)" operator="=" value="True" /> 
    73                 </SucessConditions> 
    74                 <FailureConditions> 
    75                         <RecentEvent occurred="True" subject="User" action="UserSpeech" target="[SELF]" parameters="no" /> 
    76                 </FailureConditions> 
    77         </ActivePursuitGoal> 
    78          
    79         <ActivePursuitGoal name="CannotKeepStrategy(user)"> 
    80                 <PreConditions> 
    81                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="User" /> 
    82                         <Property name="[SELF](copingStrategy)" operator="=" value="[coping]" /> 
    83                         <Property name="[coping]" operator="!=" value="False" /> 
    84                         <Property name="[SELF](numberOfTries,[coping])" operator="GreaterEqual" value="[SELF](maxTries,[coping])" /> 
    85                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="AskCopingStrategy" parameters="user"/> 
    86                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="CannotKeepStrategy" parameters="user"/> 
    87                 </PreConditions> 
    88                 <SucessConditions> 
    89                         <RecentEvent occurred="True" subject="[SELF]" action="CopingSpeech" target="User" parameters="cannotkeepcopingstrategy,[coping]" /> 
    90                 </SucessConditions> 
    91                 <FailureConditions> 
    92                 </FailureConditions> 
    93         </ActivePursuitGoal> 
    94          
    95         <ActivePursuitGoal name="AskCopingStrategy(user)"> 
    96                 <PreConditions> 
    97                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="User" /> 
    98                         <RecentEvent occurred="False" subject="[SELF]" action="fail" target="AskCopingStrategy" parameters="user"/> 
    99                         <Property name="[SELF](copingStrategy)" operator="=" value="False" /> 
    100                         <Property name="[SELF](confirmedStrategy)" operator="!=" value="True" /> 
    101                 </PreConditions> 
    102                 <SucessConditions> 
    103                         <Property name="SpeechContext()" operator="=" value="#EVENT(User,UserSpeech,[SELF],suggestcopingstrategy,[coping])"/> 
    104                 </SucessConditions> 
    105                 <FailureConditions> 
    106                         <Property name="SpeechContext()" operator="=" value="#EVENT(User,UserSpeech,[SELF],dontknow)"/> 
    107                 </FailureConditions> 
    108         </ActivePursuitGoal> 
    109  
    110         <ActivePursuitGoal name="ConfirmCopingStrategy(user)"> 
    111                 <PreConditions> 
    112                         <Property name="SpeechContext()" operator="=" value="#EVENT(User,UserSpeech,[SELF],suggestcopingstrategy,[coping])"/>                    
    113                 </PreConditions> 
    114                 <SucessConditions> 
    115                         <Property name="[SELF](confirmedStrategy)" operator="=" value="True" /> 
    116                 </SucessConditions> 
    117                 <FailureConditions> 
    118                         <Property name="SpeechContext()" operator="=" value="#EVENT(User,UserSpeech,[target],no)"/> 
    119                 </FailureConditions> 
    120         </ActivePursuitGoal> 
    121          
    122         <ActivePursuitGoal name="SuggestCopingStrategy(user)"> 
    123                 <PreConditions> 
    124                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="User" /> 
    125                         <RecentEvent occurred="True" subject="[SELF]" action="fail" target="AskCopingStrategy" parameters="user" /> 
    126                         <Property name="[SELF](confirmedStrategy)" operator="!=" value="True" /> 
    127                 </PreConditions> 
    128                 <SucessConditions> 
    129                         <Property name="[SELF](confirmedStrategy)" operator="=" value="True" /> 
    130                 </SucessConditions> 
    131                 <FailureConditions> 
    132                 </FailureConditions> 
    133         </ActivePursuitGoal> 
    134          
    135         <ActivePursuitGoal name="SayGoodbyeNoSuggestion(user)"> 
    136                 <PreConditions> 
    137                         <RecentEvent occurred="True" subject="[SELF]" action="fail" target="SuggestCopingStrategy" parameters="user" /> 
    138                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="User" parameters="saygoodbye"/> 
    139                 </PreConditions> 
    140                 <SucessConditions> 
    141                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="User" parameters="saygoodbye"/> 
    142                 </SucessConditions> 
    143                 <FailureConditions> 
    144                 </FailureConditions> 
    145         </ActivePursuitGoal> 
    146          
    147         <ActivePursuitGoal name="AcceptStrategy(user)"> 
    148                 <PreConditions> 
    149                         <Property name="[SELF](copingStrategy)" operator="=" value="[coping]" /> 
    150                         <Property name="[SELF](confirmedStrategy)" operator="=" value="True" /> 
    151                         <Property name="[SELF](numberOfTries,[coping])" operator="LesserThan" value="[SELF](maxTries,[coping])" /> 
    152                         <RecentEvent occurred="False" subject="[SELF]" action="CopingSpeech" target="User" parameters="acceptcopingstrategy,[coping]"/> 
    153                 </PreConditions> 
    154                 <SucessConditions> 
    155                         <RecentEvent occurred="True" subject="[SELF]" action="CopingSpeech" target="User" parameters="acceptcopingstrategy,[coping]"/> 
    156                 </SucessConditions> 
    157                 <FailureConditions> 
    158                 </FailureConditions> 
    159         </ActivePursuitGoal> 
    160          
    161         <ActivePursuitGoal name="DeclineStrategy(user)"> 
    162                 <PreConditions> 
    163                         <Property name="[SELF](copingStrategy)" operator="=" value="[coping]" /> 
    164                         <Property name="[SELF](confirmedStrategy)" operator="=" value="True" /> 
    165                         <Property name="[SELF](numberOfTries,[coping])" operator="GreaterEqual" value="[SELF](maxTries,[coping])" /> 
    166                         <!--<RecentEvent occurred="False" subject="[SELF]" action="CopingSpeech" target="User" parameters="declinecopingstrategy,[coping]" />--> 
    167                 </PreConditions> 
    168                 <SucessConditions> 
    169                         <Property name="SpeechContext()" operator="=" value="#EVENT([SELF],CopingSpeech,User,declinecopingstrategy,[coping])"/> 
    170                         <!--<RecentEvent occurred="True" subject="[SELF]" action="CopingSpeech" target="User" parameters="declinecopingstrategy,[coping]" />--> 
    171                 </SucessConditions> 
    172                 <FailureConditions> 
    173                 </FailureConditions> 
    174         </ActivePursuitGoal> 
    175          
    176         <ActivePursuitGoal name="AskForReason(user)"> 
    177                 <PreConditions> 
    178                         <RecentEvent occurred="True" subject="[SELF]" action="CopingSpeech" target="User" parameters="acceptcopingstrategy,*"/> 
    179                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="AskForReason" parameters="user" /> 
    180                 </PreConditions> 
    181                 <SucessConditions> 
    182                         <Property name="[SELF](askedwhy,User)" operator="=" value="True"/> 
    183                 </SucessConditions> 
    184                 <FailureConditions> 
    185                 </FailureConditions> 
    186         </ActivePursuitGoal> 
    187         <ActivePursuitGoal name="WaitForReason(user)"> 
    188                 <PreConditions> 
    189                         <Property name="[SELF](askedwhy,User)" operator="=" value="True"/> 
    190                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="WaitForReason" parameters="user" /> 
    191                 </PreConditions> 
    192                 <SucessConditions> 
    193                         <Property name="SpeechContext()" operator="=" value="#EVENT(User,UserSpeech,[SELF],givereason)"/> 
    194                 </SucessConditions> 
    195                 <FailureConditions> 
    196                         <Property name="SpeechContext()" operator="=" value="#EVENT(User,UserSpeech,[SELF],dontknow)"/> 
    197                         <Property name="SpeechContext()" operator="=" value="#EVENT(User,UserSpeech,[SELF],unknown)"/> 
    198                 </FailureConditions> 
    199         </ActivePursuitGoal>     
    200         <ActivePursuitGoal name="AcceptReason(user)"> 
    201                 <PreConditions> 
    202                         <RecentEvent occurred="True" subject="[SELF]" action="succeed" target="WaitForReason" parameters="user"/> 
    203                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="User" parameters="acceptreason"/> 
    204                 </PreConditions> 
    205                 <SucessConditions> 
    206                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="User" parameters="acceptreason"/> 
    207                 </SucessConditions> 
    208                 <FailureConditions> 
    209                 </FailureConditions> 
    210         </ActivePursuitGoal> 
    211          
    212         <ActivePursuitGoal name="AcceptUnknownReason(user)"> 
    213                 <PreConditions> 
    214                         <RecentEvent occurred="True" subject="[SELF]" action="fail" target="WaitForReason" parameters="user"/> 
    215                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="User" parameters="acceptunknownreason"/> 
    216                 </PreConditions> 
    217                 <SucessConditions> 
    218                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="User" parameters="acceptunknownreason"/> 
    219                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="User" parameters="saygoodbye"/> 
    220                 </SucessConditions> 
    221                 <FailureConditions> 
    222                 </FailureConditions> 
    223         </ActivePursuitGoal> 
    224          
    225         <ActivePursuitGoal name="SayGoodbye(user)"> 
    226                 <PreConditions> 
    227                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="User" parameters="acceptreason"/> 
    228                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="User" parameters="saygoodbye"/> 
    229                 </PreConditions> 
    230                 <SucessConditions> 
    231                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="User" parameters="saygoodbye"/> 
    232                 </SucessConditions> 
    233                 <FailureConditions> 
    234                 </FailureConditions> 
    235         </ActivePursuitGoal> 
    236          
    237         <!-- Generic goals that are used in more than one episode --> 
    238          
    239         <!-- Replying yes to any question except invitations--> 
    240         <ActivePursuitGoal name="ReplyPositively([speaker],[question])"> 
    241                 <PreConditions> 
    242                         <!-- reply yes unless I don't like the character that is asking --> 
    243                         <Property name="Respect([SELF],[speaker])" operator="GreaterEqual" value="0"/> 
    244                         <!-- only active, if a question has been started --> 
    245                         <RecentEvent occurred="True" subject="[speaker]" target="[SELF]" action="Question" parameters="[question]" /> 
    246                         <!-- that does not correspond to a party invitation --> 
    247                         <Property name="[question]" operator="!=" value="partyinvitation"/> 
    248                         <Property name="[question]" operator="!=" value="joinparty"/> 
    249                         <!-- and I havent already answered (positive) --> 
    250                         <RecentEvent occurred="False" subject="[SELF]" target="[speaker]" action="Reply" parameters="[question],positiveanswer"/> 
    251                         <!-- and I havent already answered (negative) --> 
    252                         <RecentEvent occurred="False" subject="[SELF]" target="[speaker]" action="Reply" parameters="[question],negativeanswer"/> 
    253                 </PreConditions> 
    254                 <SucessConditions> 
    255                         <!-- goal succeeds, if i say yes --> 
    256                         <RecentEvent occurred="True" subject="[SELF]" action="Reply" target="[speaker]" parameters="[question],positiveanswer"/> 
    257                 </SucessConditions> 
    258                 <FailureConditions> 
    259                         <RecentEvent occurred="True" subject="[SELF]" action="Reply" target="[speaker]" parameters="[question],negativeanswer"/> 
    260                 </FailureConditions> 
    261         </ActivePursuitGoal> 
    262          
    263         <!-- Replying no to any question, it also corrresponds to a Stand Up coping stragegy --> 
    264         <ActivePursuitGoal name="ReplyNegatively([speaker],[question])"> 
    265                 <PreConditions> 
    266                         <!-- reply no if I don't like the character that is asking --> 
    267                         <Property name="Respect([SELF],[speaker])" operator="LesserThan" value="0"/> 
    268                         <!-- only active, if a question has been started --> 
    269                         <RecentEvent occurred="True" subject="[speaker]" target="[SELF]" action="Question" parameters="[question]"/> 
    270                         <!-- that does not correspond to a party invitation --> 
    271                         <Property name="[question]" operator="!=" value="partyinvitation"/> 
    272                         <Property name="[question]" operator="!=" value="joinparty"/> 
    273                         <!-- and I havent already answered (positive) --> 
    274                         <RecentEvent occurred="False" subject="[SELF]" target="[speaker]" action="Reply" parameters="[question],positiveanswer"/> 
    275                         <!-- and I havent already answered (negative) --> 
    276                         <RecentEvent occurred="False" subject="[SELF]" target="[speaker]" action="Reply" parameters="[question],negativeanswer"/> 
    277                         <!-- and I didn't dropped my goal of saying no because I'm afraid --> 
    278                         <RecentEvent occurred="False" subject="[SELF]" action="fail" target="ReplyNegatively" parameters="[speaker],[question]" />  
    279                         <!-- <Property name="GD(ReplyNegatively,[speaker],[question])" operator="!=" value="True"/>--> 
    280                         <!-- and I'm not trying to ignore the bully --> 
    281                         <Property name="[SELF](copingStrategy)" operator="!=" value="ignore" /> 
    282                 </PreConditions> 
    283                 <SucessConditions> 
    284                         <!-- goal succeeds, if i say no --> 
    285                         <RecentEvent occurred="True" subject="[SELF]" action="Reply" target="[speaker]" parameters="[question],negativeanswer"/> 
    286                 </SucessConditions> 
    287                 <FailureConditions> 
    288                         <!-- goal fails if I decided to say yes --> 
    289                         <RecentEvent occurred="True" subject="[SELF]" action="Reply" target="[speaker]" parameters="[question],positiveanswer"/> 
    290                 </FailureConditions> 
    291         </ActivePursuitGoal> 
    292          
    293         <!-- Replying yes if I'm afraid of saying no because it threatens an interest goal --> 
    294         <ActivePursuitGoal name="ReplyPositivelyNoChoice([speaker],[question])"> 
    295                 <PreConditions> 
    296                         <!-- only active, if a question has been started --> 
    297                         <RecentEvent occurred="True" subject="[speaker]" target="[SELF]" action="Question" parameters="[question]"/> 
    298                         <!-- that does not correspond to a party invitation --> 
    299                         <Property name="[question]" operator="!=" value="partyinvitation"/> 
    300                         <Property name="[question]" operator="!=" value="joinparty"/> 
    301                         <!-- and I havent already answered (positive) --> 
    302                         <RecentEvent occurred="False" subject="[SELF]" target="[speaker]" action="Reply" parameters="[question],positiveanswer"/> 
    303                         <!-- and I havent already answered (negative) --> 
    304                         <RecentEvent occurred="False" subject="[SELF]" target="[speaker]" action="Reply" parameters="[question],negativeanswer"/> 
    305                         <!-- and I dropped my goal of saying no because I'm afraid --> 
    306                         <RecentEvent occurred="True" subject="[SELF]" action="fail" target="ReplyNegatively" parameters="[speaker],[question]" /> 
    307                 </PreConditions> 
    308                 <SucessConditions> 
    309                         <!-- goal succeeds, if i say yes --> 
    310                         <RecentEvent occurred="True" subject="[SELF]" action="Reply" target="[speaker]" parameters="[question],positiveanswer"/> 
    311                 </SucessConditions> 
    312                 <FailureConditions> 
    313                 </FailureConditions> 
    314         </ActivePursuitGoal> 
    315          
    316         <!-- BullyAssistant's Reinforce Goal --> 
    317         <ActivePursuitGoal name="AssistBully([bully],[victim],[type])"> 
    318                 <PreConditions> 
    319                         <Property name="[bully](role)" operator="=" value="Bully"/> 
    320                         <!-- can only reinforce the Bully  --> 
    321                         <Property name="[victim](role)" operator="=" value="Victim"/> 
    322                         <!-- can only reinforce anything towards the Victim  --> 
    323                         <!-- only reinforce if i don't like the victim --> 
    324                         <Property name="Like([SELF],[victim])" operator="LesserThan" value="0"/> 
    325                         <!-- the bully must say something to the victim  --> 
    326                         <RecentEvent occurred="True" subject="[bully]" target="[victim]" action="[anySpeech]" parameters="[type]"/> 
    327                         <!-- the assistant or character that has the goal must be able to reinforce the speech act --> 
    328                         <Property name="[SELF](canReinforce,[type])" operator="=" value="True"/> 
    329                         <!-- and it haven't already reinforced that speech act --> 
    330                         <RecentEvent occurred="False" subject="[SELF]" target="[victim]" action="Reinforce" parameters="[type]"/> 
    331                 </PreConditions> 
    332                 <SucessConditions> 
    333                         <!-- goal succeeds, if i can reinforce the bully --> 
    334                         <RecentEvent occurred="True" subject="[SELF]" target="[victim]" action="Reinforce" parameters="[type]"/> 
    335                 </SucessConditions> 
    336                 <FailureConditions> 
    337                         <Property name="SpeechContext()" operator="!=" value="#EVENT([bully],[anySpeech],[victim],[type])"/> 
    338                         <!--<RecentEvent occurred="True" subject="[victim]" action="Reply" target="[bully]" parameters="[type],*"/>--> 
    339                 </FailureConditions> 
    340         </ActivePursuitGoal> 
    341          
    342         <ActivePursuitGoal name="AssistBullyJoinGroupNegativeAnswer([bully],[victim])"> 
    343                 <PreConditions> 
    344                         <Property name="[bully](role)" operator="=" value="Bully"/> 
    345                         <!-- can only reinforce the Bully  --> 
    346                         <Property name="[victim](role)" operator="=" value="Victim"/> 
    347                         <!-- can only reinforce anything towards the Victim  --> 
    348                         <!-- only reinforce if i don't like the victim --> 
    349                         <Property name="Like([SELF],[victim])" operator="LesserThan" value="0"/> 
    350                         <!-- the bully must say something to the victim  --> 
    351                         <RecentEvent occurred="True" subject="[bully]" target="[victim]" action="Reply" parameters="joingroupquestion,negativeanswer,*"/> 
    352                         <!-- and it hasn't already reinforced that speech act --> 
    353                         <RecentEvent occurred="False" subject="[SELF]" target="[victim]" action="Reinforce" parameters="joingroupquestionnegativeanswer"/> 
    354                 </PreConditions> 
    355                 <SucessConditions> 
    356                         <!-- goal succeeds, if i can reinforce the bully --> 
    357                         <RecentEvent occurred="True" subject="[SELF]" target="[victim]" action="Reinforce" parameters="joingroupquestionnegativeanswer"/> 
    358                 </SucessConditions> 
    359                 <FailureConditions> 
    360                         <!--<RecentEvent occurred="True" subject="[victim]" action="Question" target="[bully]" parameters="joingroupconvince,*"/>--> 
    361                 </FailureConditions> 
    362         </ActivePursuitGoal>     
    363          
    364         <!-- Defender Goals --> 
    365         <!-- Help the victim to cope with the situation --> 
    366         <ActivePursuitGoal name="DefendVictimFrom([victim],[target])"> 
    367                 <PreConditions> 
    368                         <Property name="[victim](role)" operator="=" value="Victim"/> 
    369                         <Property name="[target](role)" operator="=" value="Bully"/> 
    370                         <EmotionCondition emotion="Pitty" min-intensity="1" target="[Victim]" />    <!--only respond this way if you feel pitty for the victim --> 
    371                         <EmotionCondition emotion="Anger" min-intensity="1" target="[target]" /> <!-- and you'r angry at the bully --> 
    372                         <Property name="Like([SELF],[victim])" operator="GreaterThan" value="1"/> 
    373                         <RecentEvent occurred="False" subject="[SELF]" action="Question" target="[target]" parameters="confrontationhelper"/> 
    374                 </PreConditions> 
    375                 <SucessConditions> 
    376                         <RecentEvent occurred="True" subject="[target]" action="Reply" target="[SELF]" parameters="confrontationhelper,positiveanswer"/> 
    377                 </SucessConditions> 
    378                 <FailureConditions> 
    379                         <RecentEvent occurred="True" subject="[target]" action="Reply" target="[SELF]" parameters="confrontationhelper,negativeanswer"/> 
    380                 </FailureConditions> 
    381         </ActivePursuitGoal> 
    382          
    383         <!-- ByStander Goals --> 
    384         <!-- Help the victim to cope with the situation, but only if the victim previously asked for hep --> 
    385         <ActivePursuitGoal name="DefendFriendFrom([victim],[target])"> 
    386                 <PreConditions> 
    387                         <Property name="[victim](role)" operator="=" value="Victim"/> 
    388                         <Property name="[target](role)" operator="=" value="Bully"/> 
    389                         <EmotionCondition emotion="Pitty" min-intensity="0" target="[Victim]" />-->    <!--only respond this way if you feel pitty for the victim --> 
    390                         <EmotionCondition emotion="Anger" min-intensity="1" target="[target]" /> <!-- and you'r angry at the bully --> 
    391                         <Property name="[SELF](helper,[victim])" operator="=" value="True" /> 
    392                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[target]" parameters="confrontationhelper"/> 
    393                 </PreConditions> 
    394                 <SucessConditions> 
    395                         <RecentEvent occurred="True" subject="[target]" action="Reply" target="[SELF]" parameters="confrontationhelper,positiveanswer"/> 
    396                 </SucessConditions> 
    397                 <FailureConditions> 
    398                         <RecentEvent occurred="True" subject="[target]" action="Reply" target="[SELF]" parameters="confrontationhelper,negativeanswer"/> 
    399                 </FailureConditions> 
    400         </ActivePursuitGoal> 
    401          
    402         <!-- Group Joinning Related Goals --> 
    403          
    404         <!-- trying to join a new group --> 
    405         <ActivePursuitGoal name="JoinGroup([group])"> 
    406                 <PreConditions> 
    407                         <Property name="[group](isGroup)" operator="=" value="True" /> <!-- can only join something that is a group  --> 
    408                         <Property name="[SELF](inGroup,[group])" operator="!=" value="True" /> <!-- can only join if I'm not yet in  --> 
    409                         <Property name="[SELF](inGroup,[group])" operator="!=" value="False" /> <!-- can only join if I'm not definitely out yet in  --> 
    410                 </PreConditions> 
    411                 <SucessConditions> 
    412                         <Property name="[SELF](inGroup,[group])" operator="=" value="True" /> <!-- succesful if I'm in  --> 
    413                 </SucessConditions> 
    414                 <FailureConditions> 
    415                         <Property name="[SELF](inGroup,[group])" operator="=" value="False" /> <!-- unsuccesful if I'm out  --> 
    416                 </FailureConditions> 
    417         </ActivePursuitGoal>     
    418          
    419          <!-- convincing another agent not to let victim join group, occurs when 2 agents in group decided differently on the request question to join group --> 
    420         <ActivePursuitGoal name="ConvinceOtherNoJoinGroupOf2([other],[joiner],[group])"> 
    421                 <PreConditions> 
    422                         <Property name="[group](isGroupOf2)" operator="=" value="True" />  
    423                         <Property name="[SELF](inGroup,[group])"  operator="=" value="True" /> 
    424                         <Property name="[other](inGroup,[group])"  operator="=" value="True" /> 
    425                     <Property name="[joiner](inGroup,[group])"  operator="=" value="Pending" />  
    426                         <RecentEvent occurred="True" subject="[joiner]" target="[group]" action="Question" parameters="joingroupquestion" /> 
    427                         <RecentEvent occurred="True" subject="[SELF]" action="Reply" target="[joiner]" parameters="joingroupquestion,negativeanswer,[group]"/> 
    428                         <RecentEvent occurred="True" subject="[other]" action="Reply" target="[joiner]" parameters="joingroupquestion,positiveanswer,[group]"/> 
    429                         <Property name="[other]" operator="!=" value="[SELF]" /> 
    430                         <RecentEvent occurred="False" subject="[other]" target="[SELF]" action="Question" parameters="joingroupquestionnegativeanswerobject,[group]" />  
    431                         <RecentEvent occurred="False" subject="[SELF]" target="[other]" action="Question" parameters="joingroupquestionpositiveanswerobject,[group]" />  
    432                 </PreConditions> 
    433                 <SucessConditions> 
    434                         <Property name="[other](groupApprovalOverPowered,[SELF],[group])"  operator="=" value="False" />                         
    435                 </SucessConditions> 
    436                 <FailureConditions> 
    437                         <Property name="[other](groupApprovalOverPowered,[SELF],[group])"  operator="=" value="True" />                  
    438                         <RecentEvent occurred="True" subject="[other]" target="[SELF]" action="Question" parameters="joingroupquestionnegativeanswerobject,[group]" />  
    439                 </FailureConditions> 
    440         </ActivePursuitGoal> 
    441          
    442         <!-- convincing another agent to let victim join group, occurs when 2 agents in group decided differently on the request question to join group --> 
    443         <ActivePursuitGoal name="ConvinceOtherJoinGroupOf2([other],[joiner],[group])">  
    444                 <PreConditions> 
    445                         <Property name="[group](isGroupOf2)" operator="=" value="True" />  
    446                         <Property name="[SELF](inGroup,[group])"  operator="=" value="True" /> 
    447                         <Property name="[other](inGroup,[group])"  operator="=" value="True" /> 
    448                     <Property name="[joiner](inGroup,[group])"  operator="=" value="Pending" />  
    449                         <RecentEvent occurred="True" subject="[joiner]" target="[group]" action="Question" parameters="joingroupquestion" /> 
    450                         <RecentEvent occurred="True" subject="[SELF]" action="Reply" target="[joiner]" parameters="joingroupquestion,positiveanswer,[group]"/> 
    451                         <RecentEvent occurred="True" subject="[other]" action="Reply" target="[joiner]" parameters="joingroupquestion,negativeanswer,[group]"/> 
    452                         <Property name="[other]" operator="!=" value="[SELF]" />                         
    453                         <RecentEvent occurred="False" subject="[other]" target="[SELF]" action="Question" parameters="joingroupquestionpositiveanswerobject,[group]" />  
    454                         <RecentEvent occurred="False" subject="[SELF]" target="[other]" action="Question" parameters="joingroupquestionnegativeanswerobject,[group]" />  
    455                         <!-- <RecentEvent occurred="false" subject="[other]" target="[SELF]" action="SpeechAct" parameters="joingroupquestionthreatleave,[group]" />    -->                                      
    456                 </PreConditions> 
    457                 <SucessConditions> 
    458                         <!-- <RecentEvent occurred="True" subject="[SELF]" target="[other]" action="SpeechAct" parameters="joingroupquestionnegativeanswerobjectaccept,[group]" /> --> 
    459                         <Property name="[other](groupApprovalOverPowered,[SELF],[group])"  operator="=" value="False" />                         
    460  
    461                 </SucessConditions> 
    462                 <FailureConditions> 
    463                         <Property name="[other](groupApprovalOverPowered,[SELF],[group])"  operator="=" value="True" />                  
    464                         <RecentEvent occurred="True" subject="[other]" target="[SELF]" action="Question" parameters="joingroupquestionpositiveanswerobject,[group]" />  
    465                         <RecentEvent occurred="True" subject="[other]" target="[SELF]" action="SpeechAct" parameters="joingroupquestionthreatleave,[group]" />  
    466                 </FailureConditions> 
    467         </ActivePursuitGoal> 
    468          
    469         <!-- choosing the positive answer to a joingroup question  -->  
    470         <ActivePursuitGoal name="JoinGroupAccept([joiner],[group])">  
    471                 <PreConditions> 
    472                         <Property name="[group](isGroup)" operator="=" value="True" />  
    473                         <Property name="[SELF](inGroup,[group])"  operator="=" value="True" /> 
    474                          <Property name="[joiner](inGroup,[group])"  operator="=" value="Pending" /> 
    475                         <RecentEvent occurred="True" subject="[joiner]" target="[group]" action="Question" parameters="joingroupquestion" /> <!-- only active, if a join request was made --> 
    476                         <RecentEvent occurred="False" subject="[SELF]" action="Reply" target="[joiner]" parameters="joingroupquestion,positiveanswer"/> 
    477                         <RecentEvent occurred="False" subject="[SELF]" action="Reply" target="[joiner]" parameters="joingroupquestion,negativeanswer"/> 
    478                         <Property name="Like([SELF],[joiner])" operator="GreaterEqual" value="-2" /> <!-- choose pos unless I strongly hate joiner -->                           
    479                 </PreConditions> 
    480                 <SucessConditions> 
    481                         <RecentEvent occurred="True" subject="[SELF]" action="Reply" target="[joiner]" parameters="joingroupquestion,positiveanswer,[group]"/> 
    482                 </SucessConditions> 
    483                 <FailureConditions> 
    484                 </FailureConditions> 
    485         </ActivePursuitGoal> 
    486  
    487         <!-- choosing the negative answer to a joingroup question  -->  
    488         <ActivePursuitGoal name="JoinGroupRefuse([joiner],[group])">  
    489                 <PreConditions> 
    490                         <Property name="[group](isGroup)" operator="=" value="True" />  
    491                         <Property name="[SELF](inGroup,[group])"  operator="=" value="True" /> 
    492                     <Property name="[joiner](inGroup,[group])"  operator="=" value="Pending" />  
    493                         <RecentEvent occurred="True" subject="[joiner]" target="[group]" action="Question" parameters="joingroupquestion" /> <!-- only active, if a join request was made --> 
    494                         <RecentEvent occurred="False" subject="[SELF]" action="Reply" target="[joiner]" parameters="joingroupquestion,positiveanswer"/> 
    495                         <RecentEvent occurred="False" subject="[SELF]" action="Reply" target="[joiner]" parameters="joingroupquestion,negativeanswer"/> 
    496                         <Property name="Like([SELF],[joiner])" operator="LesserThan" value="-2" /> <!-- choose neg if I strongly dislike joiner --> 
    497                 </PreConditions> 
    498                 <SucessConditions> 
    499                         <RecentEvent occurred="True" subject="[SELF]" action="Reply" target="[joiner]" parameters="joingroupquestion,negativeanswer,[group]"/>  
    500                 </SucessConditions> 
    501                 <FailureConditions> 
    502                 </FailureConditions> 
    503         </ActivePursuitGoal> 
    504          
    505         <ActivePursuitGoal name="ConvinceGroupAccept([joiner],[group])"> <!-- choosing the positive answer to a joingroupconvince question  -->  
    506                 <PreConditions> 
    507                         <Property name="[group](isGroup)" operator="=" value="True" />  
    508                         <Property name="[SELF](inGroup,[group])"  operator="=" value="True" /> 
    509                          <Property name="[joiner](inGroup,[group])"  operator="=" value="Pending" /> 
    510                         <RecentEvent occurred="true" subject="[joiner]" target="[SELF]" action="Question" parameters="joingroupconvince,[group]" /> 
    511                         <RecentEvent occurred="false" subject="[SELF]" target="[joiner]" action="Reply" parameters="joingroupconvince,*,[group]"/>  
    512                         <Property name="Like([SELF],[joiner])" operator="GreaterEqual" value="-2" /> <!-- choose pos unless I strongly hate joiner -->                           
    513                 </PreConditions> 
    514                 <SucessConditions> 
    515                         <RecentEvent occurred="true" subject="[SELF]" target="[joiner]" action="[Reply]" parameters="joingroupconvince,positiveanswer,[group]"/>  
    516                 </SucessConditions> 
    517                 <FailureConditions> 
    518                         <RecentEvent occurred="true" subject="[SELF]" target="[joiner]" action="[Reply]" parameters="joingroupconvince,negativeanswer,[group]"/>  
    519                         </FailureConditions> 
    520         </ActivePursuitGoal> 
    521  
    522         <ActivePursuitGoal name="ConvinceGroupRefuse([joiner],[group])"> <!-- choosing the positive answer to a joingroupconvince question  -->  
    523                 <PreConditions> 
    524                         <Property name="[group](isGroup)" operator="=" value="True" />  
    525                         <Property name="[SELF](inGroup,[group])"  operator="=" value="True" /> 
    526                          <Property name="[joiner](inGroup,[group])"  operator="=" value="Pending" /> 
    527                         <RecentEvent occurred="true" subject="[joiner]" target="[SELF]" action="Question" parameters="joingroupconvince,[group]" /> 
    528                         <RecentEvent occurred="false" subject="[SELF]" target="[joiner]" action="Reply" parameters="joingroupconvince,*,[group]"/>  
    529                         <Property name="Like([SELF],[joiner])" operator="LesserThan" value="-2" /> <!-- choose neg if I strongly dislike joiner --> 
    530                 </PreConditions> 
    531                 <SucessConditions> 
    532                         <RecentEvent occurred="true" subject="[SELF]" target="[joiner]" action="[Reply]" parameters="joingroupconvince,negativeanswer,[group]"/>  
    533                 </SucessConditions> 
    534                 <FailureConditions> 
    535                         <RecentEvent occurred="true" subject="[SELF]" target="[joiner]" action="[Reply]" parameters="joingroupconvince,positiveanswer,[group]"/>  
    536                 </FailureConditions> 
    537         </ActivePursuitGoal>     
    538          
    539         <ActivePursuitGoal name="ConvinceOtherNoJoinGroupOf2Accept([other],[joiner],[group])">  
    540                 <PreConditions> 
    541                         <Property name="[group](isGroupOf2)" operator="=" value="True" />  
    542                         <RecentEvent occurred="True" subject="[joiner]" target="[group]" action="Question" parameters="joingroupquestion" />  
    543                         <RecentEvent occurred="True" subject="[other]" target="[SELF]" action="Question" parameters="joingroupquestionpositiveanswerobject,[group]" />  
    544                         <Property name="[SELF](inGroup,[group])"  operator="=" value="True" /> 
    545                         <Property name="[other](inGroup,[group])"  operator="=" value="True" /> 
    546                     <Property name="[joiner](inGroup,[group])"  operator="=" value="Pending" /> 
    547                         <Property name="[other]" operator="!=" value="[SELF]" />                 
    548                         <Property name="Like([SELF],[other])" operator="GreaterEqual" value="Like([SELF],[joiner])" /> <!-- choose if I like other more than joiner--> 
    549                 </PreConditions> 
    550                 <SucessConditions> 
    551                         <RecentEvent occurred="True" subject="[SELF]" action="Reply" target="[other]" parameters="joingroupquestionpositiveanswerobject,positiveanswer,[group]" />  
    552                 </SucessConditions> 
    553                 <FailureConditions> 
    554                         <RecentEvent occurred="True" subject="[SELF]" action="Reply" target="[other]" parameters="joingroupquestionpositiveanswerobject,negativeanswer,[group]" />  
    555                 </FailureConditions> 
    556         </ActivePursuitGoal> 
    557  
    558         <ActivePursuitGoal name="ConvinceOtherNoJoinGroupOf2Refuse([other],[joiner],[group])"> <!-- convincing another agent not to let victim join group, occurs when 2 agents in group decided differently on the request question to join group --> 
    559                 <PreConditions> 
    560                         <Property name="[group](isGroupOf2)" operator="=" value="True" />  
    561                         <RecentEvent occurred="True" subject="[joiner]" target="[group]" action="Question" parameters="joingroupquestion" />  
    562                         <RecentEvent occurred="True" subject="[other]" target="[SELF]" action="Question" parameters="joingroupquestionpositiveanswerobject,[group]" />  
    563                         <Property name="[SELF](inGroup,[group])"  operator="=" value="True" /> 
    564                         <Property name="[other](inGroup,[group])"  operator="=" value="True" /> 
    565                     <Property name="[joiner](inGroup,[group])"  operator="=" value="Pending" /> 
    566                         <Property name="[other]" operator="!=" value="[SELF]" />                                         
    567                         <Property name="Like([SELF],[other])" operator="LesserThan" value="Like([SELF],[joiner])" /> <!-- choose if I  like other less then joiner --> 
    568                 </PreConditions> 
    569                 <SucessConditions> 
    570                         <RecentEvent occurred="True" subject="[SELF]" action="Reply" target="[other]" parameters="joingroupquestionpositiveanswerobject,negativeanswer,[group]" />  
    571                 </SucessConditions> 
    572                 <FailureConditions> 
    573                         <RecentEvent occurred="True" subject="[SELF]" action="Reply" target="[other]" parameters="joingroupquestionpositiveanswerobject,positiveanswer,[group]" />  
    574                 </FailureConditions> 
    575         </ActivePursuitGoal> 
    576  
    577         <ActivePursuitGoal name="ConvinceOtherJoinGroupOf2Accept([other],[group])">  
    578                 <PreConditions> 
    579                         <Property name="[group](isGroupOf2)" operator="=" value="True" />  
    580                         <RecentEvent occurred="True" subject="[other]" target="[SELF]" action="Question" parameters="joingroupquestionnegativeanswerobject" />  
    581                         <Property name="[SELF](inGroup,[group])"  operator="=" value="True" /> 
    582                         <Property name="[other](inGroup,[group])"  operator="=" value="True" /> 
    583                         <Property name="Like([SELF],[other])" operator="GreaterEqual" value="0" /> <!-- choose if I like other --> 
    584                 </PreConditions> 
    585                 <SucessConditions> 
    586                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[other]" parameters="joingroupquestionnegativeanswerobjectaccept,[group]" />  
    587                 </SucessConditions> 
    588                 <FailureConditions> 
    589                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[other]" parameters="joingroupquestionthreatleave,[group]" />  
    590                 </FailureConditions> 
    591         </ActivePursuitGoal> 
    592  
    593         <ActivePursuitGoal name="ConvinceOtherJoinGroupOf2Refuse([other],[group])"> <!-- convincing another agent not to let victim join group, occurs when 2 agents in group decided differently on the request question to join group --> 
    594                 <PreConditions> 
    595                         <Property name="[group](isGroupOf2)" operator="=" value="True" />  
    596                         <RecentEvent occurred="True" subject="[other]" target="[SELF]" action="Question" parameters="joingroupquestionnegativeanswerobject" />  
    597                         <Property name="[SELF](inGroup,[group])"  operator="=" value="True" /> 
    598                         <Property name="[other](inGroup,[group])"  operator="=" value="True" /> 
    599                         <Property name="Like([SELF],[other])" operator="LesserThan" value="0" /> <!-- choose if I dont like other much --> 
    600                 </PreConditions> 
    601                 <SucessConditions> 
    602                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[other]" parameters="joingroupquestionthreatleave,[group]" />  
    603                 </SucessConditions> 
    604                 <FailureConditions> 
    605                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[other]" parameters="joingroupquestionnegativeanswerobjectaccept,[group]" />  
    606                 </FailureConditions> 
    607         </ActivePursuitGoal> 
    608          
    609         <!-- Join group threat leave - not letting bully leave --> 
    610         <ActivePursuitGoal name="JoinGroupThreatLeaveAccept([other],[joiner],[group])">  
    611                 <PreConditions> 
    612                         <Property name="[group](isGroupOf2)" operator="=" value="True" />  
    613                         <RecentEvent occurred="True" subject="[other]" target="[SELF]" action="SpeechAct" parameters="joingroupquestionthreatleave,[group]" />  
    614                         <Property name="[joiner](inGroup,[group])" operator="=" value="Pending" />  
    615                         <Property name="Like([SELF],[other])" operator="GreaterEqual" value="Like([SELF],[joiner])" />  
    616                 </PreConditions> 
    617                 <SucessConditions> 
    618                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[other]" parameters="joingroupquestionthreatleavepositiveanswer,[group]" />  
    619                 </SucessConditions> 
    620                 <FailureConditions> 
    621                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[other]" parameters="joingroupquestionthreatleavenegativeanswer,[group]" />  
    622                 </FailureConditions> 
    623         </ActivePursuitGoal>--> 
    624  
    625         <!-- Join group threat leave - letting bully leave --> 
    626         <ActivePursuitGoal name="JoinGroupThreatLeaveRefuse([other],[joiner],[group])">  
    627                 <PreConditions> 
    628                         <Property name="[group](isGroupOf2)" operator="=" value="True" />  
    629                         <RecentEvent occurred="True" subject="[other]" target="[SELF]" action="SpeechAct" parameters="joingroupquestionthreatleave,[group]" />  
    630                         <Property name="[joiner](inGroup,[group])" operator="=" value="Pending" />  
    631                         <Property name="Like([SELF],[other])" operator="LesserThan" value="Like([SELF],[joiner])" />  
    632                 </PreConditions> 
    633                 <SucessConditions> 
    634                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[other]" parameters="joingroupquestionthreatleavenegativeanswer,[group]" />  
    635                 </SucessConditions> 
    636                 <FailureConditions> 
    637                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[other]" parameters="joingroupquestionthreatleavepositiveanswer,[group]" />  
    638                 </FailureConditions> 
    639         </ActivePursuitGoal> 
    640          
    641         <ActivePursuitGoal name="ConfrontVictimTellTeacher([victim])">  
    642                 <PreConditions> 
    643                         <!--<Property name="Like([SELF],[victim])" operator="LesserThan" value="0" /> --> 
    644                         <Property name="[victim](role)" operator="=" value="Victim" />  
    645                         <RecentEvent occurred="True" subject="[SELF]" action="look-at" target="[victim]" /> 
    646                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[victim]" parameters="confrontationtoldteacher" />  
    647                 </PreConditions> 
    648                 <SucessConditions> 
    649                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[victim]" parameters="confrontationtoldteacher" />  
    650                 </SucessConditions> 
    651                 <FailureConditions> 
    652                 </FailureConditions> 
    653         </ActivePursuitGoal> 
    654          
    655          
    656         <!-- Goals that correspond to Coping Strategies --> 
    657          
    658         <!-- Coping Strategy Goals --> 
    659         <ActivePursuitGoal name="Ignore([bully])"> 
    660                 <PreConditions> 
    661                         <Property name="[SELF](copingStrategy)" operator="=" value="ignore" /> 
    662                         <Property name="[bully](role)" operator="=" value="Bully" /> <!-- can only use ignore goal against a Bully  --> 
    663                         <Property name="[SELF](needToCope)" operator="=" value="True" /> <!-- can only use ignore goal if you got a reason for it  --> 
    664                 </PreConditions> 
    665                 <SucessConditions> 
    666                         <RecentEvent occurred="True" subject="[bully]" action="walkAwayVictim" target="[SELF]"  /> 
    667                 </SucessConditions> 
    668                 <FailureConditions> 
    669                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[bully]" parameters="insult" /> 
    670                         <RecentEvent occurred="True" subject="[SELF]" action="cry"  /> 
    671                 </FailureConditions> 
    672         </ActivePursuitGoal>     
    673          
    674  
    675         <ActivePursuitGoal name="StandUp([bully])"> 
    676                 <PreConditions> 
    677                         <Property name="[SELF](copingStrategy)" operator="=" value="standup" /> 
    678                         <Property name="[bully](role)" operator="=" value="Bully" /> <!-- can only stand up against a Bully  --> 
    679                         <Property name="[SELF](role)" operator="=" value="Victim" /> <!-- can only stand up if you're a victim  --> 
    680                         <Property name="[SELF](needToCope)" operator="=" value="True" /> <!-- can only stand up if you got a reason for it  --> 
    681                         <RecentEvent occurred="False" subject="[SELF]" action="Question" target="[bully]" parameters="protest" /> 
    682                 </PreConditions> 
    683                 <SucessConditions> 
    684                         <RecentEvent occurred="True" subject="[SELF]" action="Question" target="[bully]" parameters="protest" /> 
    685                 </SucessConditions> 
    686                 <FailureConditions> 
    687                         <!--<Property name="[SELF](needToCope)" operator="=" value="False" />--> <!-- can drop goal if we dont need to cope anymore  --> 
    688                 </FailureConditions> 
    689         </ActivePursuitGoal> 
    690          
    691         <!-- Make new friends coping strategy --> 
    692         <ActivePursuitGoal name="MakeNewFriend([friend])"> 
    693                 <PreConditions> 
    694                         <Property name="[SELF](copingStrategy)" operator="=" value="makenewfriend" /> 
    695                         <RecentEvent occurred="True" subject="[SELF]" action="look-at" target="[friend]" /> 
    696                         <Property name="Like([SELF],[friend])" operator="GreaterThan" value="1"/> 
    697                         <RecentEvent occured="True" subject="[SELF]" action="look-at" target="[friend]" /> 
    698                         <!--<Property name="[bully](role)" operator="=" value="Bully" /> 
    699                         <RecentEvent occured="False" subject="[SELF]" action="look-at" target="[bully]" />--> 
    700                         <Property name="[SELF](friend,[friend])" operator="!=" value="True" /> 
    701                         <RecentEvent occurred="False" subject="[friend]" action="Reply" target="[SELF]" parameters="makefriend,negativeanswer"/> 
    702                 </PreConditions> 
    703                 <SucessConditions> 
    704                         <Property name="[SELF](friend,[friend])" operator="=" value="True" /> 
    705                 </SucessConditions> 
    706                 <FailureConditions> 
    707                         <RecentEvent occurred="True" subject="[friend]" action="Reply" target="[SELF]" parameters="makefriend,negativeanswer"/> 
    708                 </FailureConditions> 
    709         </ActivePursuitGoal> 
    710          
    711         <!-- Tell a friend coping strategy --> 
    712         <ActivePursuitGoal name="TellFriend([friend])"> 
    713                 <PreConditions> 
    714                         <Property name="[SELF](copingStrategy)" operator="=" value="tellfriend" /> 
    715                         <RecentEvent occurred="True" subject="[SELF]" action="look-at" target="[friend]" /> 
    716                         <Property name="[friend](role)" operator="!=" value="Bully"/> 
    717                         <Property name="[friend](role)" operator="!=" value="BullyAssistant"/> 
    718                         <Property name="Like([SELF],[friend])" operator="GreaterThan" value="0"/> 
    719                         <Property name="[friend](helper,[SELF])" operator="!=" value="True" /> 
    720                 </PreConditions> 
    721                 <SucessConditions> 
    722                         <Property name="[friend](helper,[SELF])" operator="=" value="True" /> 
    723                 </SucessConditions> 
    724                 <FailureConditions> 
    725                         <RecentEvent occurred="True" subject="[friend]" action="Reply" target="[SELF]" parameters="askforhelp,negativeanswer"/> 
    726                 </FailureConditions> 
    727         </ActivePursuitGoal> 
    728  
    729         <ActivePursuitGoal name="RunAway([bully])"> 
    730                 <PreConditions> 
    731                         <Property name="[SELF](copingStrategy)" operator="=" value="runaway" /> 
    732                         <Property name="[bully](role)" operator="=" value="Bully" /> <!-- can only stand up against a Bully  --> 
    733                         <Property name="[SELF](role)" operator="=" value="Victim" /> <!-- can only stand up if you're a victim  --> 
    734                         <Property name="[SELF](needToCope)" operator="=" value="True" /> <!-- can only stand up if you got a reason for it  --> 
    735                         <RecentEvent occurred="False" subject="[SELF]" action="runAway" /> <!-- only if I have not runned away already--> 
    736                 </PreConditions> 
    737                 <SucessConditions> 
    738                         <RecentEvent occurred="True" subject="[SELF]" action="runAway" /> 
    739                 </SucessConditions> 
    740                 <FailureConditions> 
    741                         <!--<Property name="[SELF](needToCope)" operator="=" value="False" />--> <!-- can drop goal if we dont need to cope anymore  --> 
    742                 </FailureConditions> 
    743         </ActivePursuitGoal> 
    744          
    745         <ActivePursuitGoal name="WalkAway([bully])"> 
    746                 <PreConditions> 
    747                         <Property name="[SELF](copingStrategy)" operator="=" value="walkaway" /> 
    748                         <Property name="[bully](role)" operator="=" value="Bully" /> <!-- can only stand up against a Bully  --> 
    749                         <Property name="[SELF](role)" operator="=" value="Victim" /> <!-- can only stand up if you're a victim  --> 
    750                         <Property name="[SELF](needToCope)" operator="=" value="True" /> <!-- can only stand up if you got a reason for it  --> 
    751                         <RecentEvent occurred="False" subject="[SELF]" action="walkAway" /> 
    752                 </PreConditions> 
    753                 <SucessConditions> 
    754                         <RecentEvent occurred="True" subject="[SELF]" action="walkAway"  /> 
    755                 </SucessConditions> 
    756                 <FailureConditions> 
    757                         <!--<Property name="[SELF](needToCope)" operator="=" value="False" />--> <!-- can drop goal if we dont need to cope anymore  --> 
    758                 </FailureConditions> 
    759         </ActivePursuitGoal>     
    760  
    761         <ActivePursuitGoal name="LaughOff([bully])"> 
    762                 <PreConditions> 
    763                         <Property name="[SELF](copingStrategy)" operator="=" value="laughoff" /> 
    764                         <Property name="[bully](role)" operator="=" value="Bully" /> <!-- can only stand up against a Bully  --> 
    765                         <Property name="[SELF](role)" operator="=" value="Victim" /> <!-- can only stand up if you're a victim  --> 
    766                         <Property name="[SELF](needToCope)" operator="=" value="True" /> <!-- can only stand up if you got a reason for it  --> 
    767                         <RecentEvent occurred="False" subject="[SELF]" action="Question" target="[bully]" parameters="laughoff"/> 
    768                         <RecentEvent occurred="False" subject="[SELF]" action="fail" target="LaughOff" parameters="[bully]" /> 
    769                 </PreConditions> 
    770                 <SucessConditions> 
    771                         <RecentEvent occurred="True" action="Question" subject="[SELF]" target="[bully]" parameters="laughoff"  /> 
    772                 </SucessConditions> 
    773                 <FailureConditions> 
    774                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[bully]" parameters="insult"/> 
    775                         <RecentEvent occurred="True" subject="[SELF]" action="cry"/> 
    776                         <!--<Property name="[SELF](needToCope)" operator="=" value="False" />--> <!-- can drop goal if we dont need to cope anymore  --> 
    777                 </FailureConditions> 
    778         </ActivePursuitGoal>     
    779          
    780         <ActivePursuitGoal name="FightBack([target])"> 
    781                 <PreConditions> 
    782                         <Property name="[SELF](copingStrategy)" operator="=" value="fightback" /> 
    783                         <Property name="[target](role)" operator="=" value="Bully" /> <!-- can only fight against a Bully  --> 
    784                         <Property name="[SELF](needToCope)" operator="=" value="True" /> <!-- can only fight back if you got a reason for it  --> 
    785                         <!--<RecentEvent occurred="False" subject="[SELF]" action="cry"/>--> 
    786                         <RecentEvent occurred="False" subject="[SELF]" action="fail" target="FightBack" parameters="[target]" />  
    787                         <!--<EmotionCondition emotion="Anger" min-intensity="1" target="[target]" />-->                  <!--only respond this way if angry with the bully --> 
    788                         <!--<Property name="[SELF](hurt)" operator="=" value="False" />--> 
    789                         <Property name="[target](hurt)" operator="=" value="False" /> 
    790                 </PreConditions> 
    791                 <SucessConditions> 
    792                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[target]" parameters="fightstart"/> 
    793                         <!--<RecentEvent occurred="True" subject="[SELF]" action="attack" target="[target]" />--> 
    794                         <Property name="[target](hurt)" operator="=" value="True" /> 
    795                 </SucessConditions> 
    796                 <FailureConditions> 
    797                         <Property name="[SELF](hurt)" operator="=" value="True" /> 
    798                 </FailureConditions> 
    799         </ActivePursuitGoal> 
    800          
    801         <ActivePursuitGoal name="Insult([target])"> 
    802                 <PreConditions> 
    803                         <Property name="[SELF](copingStrategy)" operator="=" value="insult" /> 
    804                         <Property name="[target](role)" operator="=" value="Bully" /> <!-- can only insult a Bully  --> 
    805                         <Property name="[SELF](needToCope)" operator="=" value="True" /> <!-- can only insult if you got a reason for it  --> 
    806                         <!--<EmotionCondition emotion="Anger" min-intensity="1" target="[target]" />-->  <!--only respond this way if angry  --> 
    807                         <RecentEvent occurred="False" subject="[SELF]" target="[target]" action="SpeechAct" parameters="insult"/> 
    808                 </PreConditions> 
    809                 <SucessConditions> 
    810                         <RecentEvent occurred="True" subject="[SELF]" target="[target]" action="SpeechAct" parameters="insult"/> 
    811                 </SucessConditions> 
    812                 <FailureConditions> 
    813                 </FailureConditions> 
    814         </ActivePursuitGoal> 
    815          
    816         <ActivePursuitGoal name="InsultBack([target])"> 
    817                 <PreConditions> 
    818                         <Property name="[SELF](copingStrategy)" operator="=" value="insult" /> 
    819                         <Property name="[target](role)" operator="=" value="Bully" /> <!-- can only insult a Bully  --> 
    820                         <Property name="[SELF](needToCope)" operator="=" value="True" /> <!-- can only insult if you got a reason for it  --> 
    821                         <!--<EmotionCondition emotion="Anger" min-intensity="1" target="[target]" />-->  <!--only respond this way if angry  --> 
    822                         <RecentEvent occurred="True" subject="[target]" target="[SELF]" action="SpeechAct" parameters="insult"/> 
    823                         <RecentEvent occurred="False" subject="[SELF]" target="[target]" action="SpeechAct" parameters="insultinsultback"/> 
    824                 </PreConditions> 
    825                 <SucessConditions> 
    826                         <RecentEvent occurred="True" subject="[SELF]" target="[target]" action="SpeechAct" parameters="insultinsultback"/> 
    827                 </SucessConditions> 
    828         </ActivePursuitGoal>     
    829          
    830         <ActivePursuitGoal name="FightSuccess([target])"> 
    831                 <PreConditions> 
    832                         <RecentEvent occurred="True" subject="[SELF]" action="attack" target="[target]"/> 
    833                         <Property name="[target](hurt)" operator="=" value="True" /> 
    834                         <RecentEvent occurred="False" subject="[SELF]" action="Question" target="[target]" parameters="victimfightsuccess"/> 
    835                         <Property name="[SELF](hurt)" operator="=" value="False" /> 
    836                 </PreConditions> 
    837                 <SucessConditions> 
    838                         <RecentEvent occurred="True" subject="[SELF]" action="Question" target="[target]" parameters="victimfightsuccess"/> 
    839                 </SucessConditions> 
    840                 <FailureConditions> 
    841                 </FailureConditions> 
    842         </ActivePursuitGoal> 
    843          
    844         <!-- Fighting Goal --> 
    845         <ActivePursuitGoal name="Fight([target])"> 
    846                 <PreConditions> 
    847                         <RecentEvent occurred="True" subject="[target]" action="attack" target="[SELF]"/> 
    848                         <Property name="[SELF](hurt)" operator="=" value="False" /> 
    849                         <Property name="[target](hurt)" operator="=" value="False" /> 
    850                         <RecentEvent occurred="False" subject="[SELF]" action="fail" target="Fight" parameters="[target]" /> 
    851                 </PreConditions> 
    852                 <SucessConditions> 
    853                         <Property name="[target](hurt)" operator="=" value="True" /> 
    854                 </SucessConditions> 
    855                 <FailureConditions> 
    856                         <Property name="[SELF](hurt)" operator="=" value="True" /> 
    857                 </FailureConditions> 
    858         </ActivePursuitGoal> 
    859                  
    860         <!-- Bully's goal of gloating with the victim when he successfully wins a fight back --> 
    861         <ActivePursuitGoal name="GloatVictory([target])"> 
    862                 <PreConditions> 
    863                         <RecentEvent occurred="True" subject="[SELF]" action="attack" target="[target]"/> 
    864                         <RecentEvent occurred="True" subject="[target]" action="attack" target="[SELF]"/> 
    865                         <Property name="[target](hurt)" operator="=" value="True" /> 
    866                         <Property name="[SELF](hurt)" operator="=" value="False" /> 
    867                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[target]" parameters="gloatvictory"/> 
    868                 </PreConditions> 
    869                 <SucessConditions> 
    870                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[target]" parameters="gloatvictory"/> 
    871                 </SucessConditions> 
    872                 <FailureConditions> 
    873                 </FailureConditions> 
    874         </ActivePursuitGoal> 
    875          
    876         <!-- Goals used in particular episodes --> 
    877          
    878         <!-- Episode B24: Make New Friend --> 
    879          
    880         <!-- Defender inviting his new friend --> 
    881         <ActivePursuitGoal name="HelpInvite([target])"> 
    882                 <PreConditions> 
    883                         <Property name="[SELF](friend,[target])" operator="=" value="True" /> 
    884                         <RecentEvent occurred="True" subject="[SELF]" action="look-at" target="[target]"/> 
    885                         <RecentEvent occurred="False" subject="[SELF]" action="Question" target="[target]" parameters="helpinvitation"/> 
    886                         <PastEvent occurred="False" subject="[SELF]" action="Question" target="[target]" parameters="helpinvitation"/> 
    887                 </PreConditions> 
    888                 <SucessConditions> 
    889                         <RecentEvent occurred="True" subject="[target]" action="Reply" target="[SELF]" parameters="helpinvitation,positiveanswer" /> 
    890                 </SucessConditions> 
    891                 <FailureConditions> 
    892                         <RecentEvent occurred="True" subject="[target]" action="Reply" target="[SELF]" parameters="helpinvitation,negativeanswer" /> 
    893                 </FailureConditions> 
    894         </ActivePursuitGoal> 
    895          
    896         <!-- Episode B04 - On the Way to School --> 
    897  
    898         <!-- Bully's goal of deceiving the Victim --> 
    899         <ActivePursuitGoal name="DeceiveVictim([target])"> <!-- trying to fool the victim by being nice to him and later revealing that it was not serious--> 
    900                 <PreConditions> 
    901                         <Property name="[target](role)" operator="=" value="Victim" /> <!-- target of the deception has to be victim --> 
    902                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[target]" parameters="insult"  /> <!-- deception doesn't make sense if victim was recently insulted --> 
    903                         <RecentEvent occurred="False" subject="[SELF]" action="Question" target="[target]" parameters="deception"  /> <!-- deception doesn't make sense if it already happened --> 
    904                         <Property name="Episode(name)" operator="=" value="B04" /> <!-- this is probably cheating --> 
    905                 </PreConditions> 
    906                 <SucessConditions> 
    907                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[target]" parameters="deceptionreveal" /> <!-- goal succeeds, if victim believes deception and I reveal the deception --> 
    908                 </SucessConditions> 
    909                 <FailureConditions> 
    910                         <RecentEvent occurred="True" subject="[target]" action="Reply" target="[SELF]" parameters="deception,negativeanswer" /> <!-- goal fails, if victim doesn't believe the deception --> 
    911                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[target]" parameters="insult"  /> <!-- goal fails if the victim is insulted --> 
    912                 </FailureConditions> 
    913         </ActivePursuitGoal> 
    914          
    915         <!-- Episode B06 - Party Invitation  --> 
    916          
    917         <!-- If someone invites me to a party, I want to be there --> 
    918         <ActivePursuitGoal name="AcceptInvitation([friend])"> 
    919                 <PreConditions> 
    920                         <RecentEvent occurred="True" subject="[friend]" action="Question" target="[SELF]" parameters="partyinvitation"/> 
    921                         <RecentEvent occurred="False" subject="[SELF]" action="Reply" target="[friend]" parameters="partyinvitation,positiveanswer"/> 
    922                         <RecentEvent occurred="False" subject="[SELF]" action="Reply" target="[friend]" parameters="partyinvitation,negativeanswer"/> 
    923                         <RecentEvent occurred="False" subject="[friend]" action="Reply" target="[SELF]" parameters="joinparty,negativeanswer"/> 
    924                         <RecentEvent occurred="False" subject="[friend]" action="Reply" target="[SELF]" parameters="joinparty,positiveanswer"/> 
    925                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="AcceptInvitation" parameters="[friend]"/> 
    926                 </PreConditions> 
    927                 <SucessConditions> 
    928                         <Property name="InvitedToParty([friend],[SELF])" operator="=" value="True"/> 
    929                 </SucessConditions> 
    930                 <FailureConditions> 
    931                         <Property name="InvitedToParty([friend],[SELF])" operator="=" value="False"/> 
    932                         <!--<RecentEvent occurred="True" subject="[friend]" action="Reply" target="[SELF]" parameters="joinparty,negativeanswer"/>--> 
    933                 </FailureConditions> 
    934         </ActivePursuitGoal> 
    935          
    936         <!-- ByStander goal If I'm giving a party, I want to invite my friends --> 
    937         <ActivePursuitGoal name="InviteToParty([party],[friend])"> 
    938                 <PreConditions> 
    939                         <Property name="[SELF](party)" operator="=" value="[party]"/> <!-- I'm giving a party --> 
    940                         <Property name="Like([SELF],[friend])" operator="GreaterEqual" value="2"/> <!-- I must like the persons I invite --> 
    941                         <Property name="[friend]" operator="!=" value="[SELF]" /> 
    942                         <RecentEvent occurred="True" subject="[SELF]" action="look-at" target="[friend]"/> <!-- I see one of my friends --> 
    943                         <RecentEvent occurred="False" subject="[SELF]" action="Question" target="[friend]" parameters="partyinvitation"/> <!-- haven't invited him yet --> 
    944                 </PreConditions> 
    945                 <SucessConditions> 
    946                         <Property name="InvitedToParty([SELF],[friend])" operator="=" value="True"/> <!-- I want him to become invited --> 
    947                 </SucessConditions> 
    948                 <FailureConditions> 
    949                         <!-- the goal fails if he rejects my invitation --> 
    950                         <RecentEvent occurred="True" subject="[friend]" action="Reply" target="[SELF]" parameters="partyinvitation,negativeanswer"/> 
    951                         <!-- or if I don't like him anymore --> 
    952                         <Property name="Like([SELF],[friend])" operator="LesserThan" value="2"/> 
    953                 </FailureConditions> 
    954         </ActivePursuitGoal> 
    955          
    956         <!-- ByStander's goal of canceling a party invitation if he stops liking the invited person --> 
    957         <ActivePursuitGoal name="CancelPartyInvitation([party],[notfriend])"> 
    958                 <PreConditions> 
    959                         <RecentEvent occurred="True" subject="[SELF]" action="Question" target="[notfriend]" parameters="partyinvitation"/> 
    960                         <Property name="InvitedToParty([SELF],[notfriend])" operator="=" value="True"/> 
    961                         <Property name="[SELF](party)" operator="=" value="[party]"/> 
    962                         <Property name="Like([SELF],[notfriend])" operator="LesserThan" value="2"/> 
    963                 </PreConditions> 
    964                 <SucessConditions> 
    965                         <Property name="InvitedToParty([SELF],[notfriend])" operator="=" value="False"/> 
    966                 </SucessConditions> 
    967                 <FailureConditions> 
    968                 </FailureConditions> 
    969         </ActivePursuitGoal> 
    970          
    971         <!-- ByStander's goal of refusing a party to someone he does not like --> 
    972         <ActivePursuitGoal name="RefuseParty([party],[notfriend])"> 
    973                 <PreConditions> 
    974                         <RecentEvent occurred="True" subject="[notfriend]" action="Question" target="[SELF]" parameters="joinparty"/> 
    975                         <RecentEvent occurred="False" subject="[SELF]" action="Reply" target="[notfriend]" parameters="joinparty,negativeanswer"/> 
    976                         <Property name="[SELF](party)" operator="=" value="[party]"/> 
    977                         <Property name="Like([SELF],[notfriend])" operator="LesserThan" value="2"/> 
    978                         <Property name="InvitedToParty([SELF],[notfriend])" operator="!=" value="False"/> 
    979                 </PreConditions> 
    980                 <SucessConditions> 
    981                         <Property name="InvitedToParty([SELF],[notfriend])" operator="=" value="False"/> 
    982                 </SucessConditions> 
    983                 <FailureConditions> 
    984                 </FailureConditions> 
    985         </ActivePursuitGoal> 
    986          
    987         <!-- Bully's goal of sabotaging the Victim's invitation to the party --> 
    988         <ActivePursuitGoal name="SabotagePartyInvitation([inviter],[notfriend])"> 
    989                 <PreConditions> 
    990                         <RecentEvent occurred="True" subject="[inviter]" action="Question" target="[notfriend]" parameters="partyinvitation"/> 
    991                         <Property name="Like([SELF],[notfriend])" operator="LesserThan" value="-4"/> 
    992                         <Property name="InvitedToParty([inviter],[notfriend])" operator="!=" value="False"/> 
    993                         <RecentEvent occurred="False" subject="[SELF]" action="activate" target="SabotagePartyInvitation" parameters="[inviter],[notfriend]"/> 
    994                         <!--<Property name="GF(SabotagePartyInvitation,[inviter],[notfriend])" operator="!=" value="True"/>--> 
    995                 </PreConditions> 
    996                 <SucessConditions> 
    997                         <Property name="InvitedToParty([inviter],[notfriend])" operator="=" value="False"/> 
    998                 </SucessConditions> 
    999                 <FailureConditions> 
    1000                 </FailureConditions> 
    1001         </ActivePursuitGoal> 
    1002          
    1003         <!-- Episode B07: The Books in the classroom --> 
    1004          
    1005         <ActivePursuitGoal name="Bully([target])"> 
    1006                 <PreConditions> 
    1007                         <Property name="[target](strength)" operator="LesserThan" value="[SELF](strength)"/> 
    1008                         <RecentEvent occurred="False" subject="[SELF]" action="attack" target="[target]"/> 
    1009                         <RecentEvent occurred="True" subject="[SELF]" action="swipe" target="book" /> 
    1010                         <RecentEvent occurred="True" subject="[target]" action="pick-from-floor" target="book"/> 
    1011                 </PreConditions> 
    1012                 <SucessConditions> 
    1013                         <RecentEvent occurred="True" subject="[SELF]" action="attack" target="[target]"/> 
    1014                 </SucessConditions> 
    1015         </ActivePursuitGoal> 
    1016  
    1017         <ActivePursuitGoal name="TeaseVictim([target])"> 
    1018                 <PreConditions> 
    1019                         <Property name="[target](role)" operator="=" value="Victim"/> 
    1020                         <Property name="[target](strength)" operator="LesserThan" value="[SELF](strength)" /> 
    1021                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[target]" parameters="tease" /> 
    1022                 </PreConditions> 
    1023                 <SucessConditions> 
    1024                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[target]" parameters="tease" /> 
    1025                 </SucessConditions> 
    1026         </ActivePursuitGoal> 
    1027  
    1028         <ActivePursuitGoal name="TeaseDefend([target])"> 
    1029                 <PreConditions> 
    1030                         <RecentEvent occurred="True" subject="[target]" action="SpeechAct" target="[SELF]" parameters="tease" /> 
    1031                         <RecentEvent occurred="False" subject="[SELF]" action="Question" target="[target]" parameters="teasedefend" /> 
    1032                         <Property name="[SELF](copingStrategy)" operator="!=" value="ignore" /> 
    1033                 </PreConditions> 
    1034                 <SucessConditions> 
    1035                         <RecentEvent occurred="True" subject="[SELF]" action="Question" target="[target]" parameters="teasedefend" /> 
    1036                 </SucessConditions> 
    1037         </ActivePursuitGoal> 
    1038  
    1039         <ActivePursuitGoal name="PickFromFloor([target])"> 
    1040                 <PreConditions> 
    1041                         <RecentEvent occurred="True" subject="Luke" action="swipe" target="[target]"/> 
    1042                         <Property name="[target](owner)" operator="=" value="[SELF]"/> 
    1043                         <RecentEvent occurred="False" subject="[SELF]" action="pick-from-floor" target="[target]"/> 
    1044                 </PreConditions> 
    1045                 <SucessConditions> 
    1046                         <RecentEvent occurred="True" subject="[SELF]" action="pick-from-floor" target="[target]"/> 
    1047                 </SucessConditions> 
    1048         </ActivePursuitGoal> 
    1049  
    1050         <ActivePursuitGoal name="BullyObject([target])"> 
    1051                 <PreConditions> 
    1052                         <Property name="[target](type)" operator="=" value="object"/> 
    1053                         <Property name="[target](owner)" operator="=" value="[victim]"/> 
    1054                         <Property name="[victim]" operator="!=" value="[SELF]"/> 
    1055                         <RecentEvent occurred="True" subject="[SELF]" action="look-at" target="[victim]"/> 
    1056                         <RecentEvent occurred="False" subject="[SELF]" action="swipe" target="[target]"/> 
    1057                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[victim]" parameters="tease"/> 
    1058                 </PreConditions> 
    1059                 <SucessConditions> 
    1060                         <RecentEvent occurred="True" subject="[SELF]" action="swipe" target="[target]"/>                                 
     15                        <RecentEvent occurred="True" subject="[SELF]" action="sing" target="[target]"/> 
    106116                </SucessConditions> 
    106217        </ActivePursuitGoal> 
    106318         
    106419         
    1065         <!-- Episode B08: Stealing a Chocolate Bar --> 
    1066          
    1067         <!-- Victim's goal of claiming back the chocolate bar --> 
    1068         <ActivePursuitGoal name="ClaimBackItem([item],[thief])"> 
    1069                 <PreConditions> 
    1070                         <Property name="[item](owner)" operator="=" value="[SELF]" />  
    1071                         <RecentEvent subject="[thief]" action="steal" target="[SELF]" parameters="[item]"  />  
    1072                 </PreConditions> 
    1073                 <SucessConditions> 
    1074                         <RecentEvent occurred="True" subject="[thief]" target="[SELF]" action="Reply" parameters="itemclaimback,positiveanswer" />  
    1075                 </SucessConditions> 
    1076                 <FailureConditions> 
    1077                         <RecentEvent occurred="True" subject="[thief]" target="[SELF]" action="Reply" parameters="itemclaimback,negativeanswer" />  
    1078                 </FailureConditions> 
    1079         </ActivePursuitGoal> 
    1080  
    1081         <!-- Victim's goal of complaining about the destroyed item (in this episode, his chocolate bar) --> 
    1082         <ActivePursuitGoal name="ItemDestroyedComplain([destroyer])">    
    1083                 <PreConditions> 
    1084                         <RecentEvent occurred="True" subject="[destroyer]" target="[SELF]" action="SpeechAct" parameters="itemdestroyed" />                              
    1085                 </PreConditions> 
    1086                 <SucessConditions> 
    1087                         <RecentEvent occurred="True" subject="[SELF]" target="[destroyer]" action="SpeechAct" parameters="itemdestroyedcomplain" />                              
    1088                 </SucessConditions> 
    1089                 <FailureConditions> 
    1090                 </FailureConditions>     
    1091         </ActivePursuitGoal>     
    1092          
    1093         <!-- Bully's goal of claiming the item --> 
    1094         <ActivePursuitGoal name="ClaimItem([item],[owner])"> 
    1095                 <PreConditions> 
    1096                         <Property name="[item](type)" operator="=" value="object" /> 
    1097                         <Property name="[owner](role)" operator="=" value="Victim" /> 
    1098                         <Property name="[item](owner)" operator="=" value="[owner]" /> 
    1099                         <Property name="Like([SELF],[owner])" operator="LesserThan" value="-2" /> <!-- choose only if I dont like the other -->                   
    1100                         <RecentEvent occurred="False" subject="[SELF]" target="[owner]" action="Question" parameters="itemclaim" />  
    1101                 </PreConditions> 
    1102                 <SucessConditions> 
    1103                         <RecentEvent occurred="True" subject="[owner]" target="[SELF]" action="Reply" parameters="itemclaim,positiveanswer" />  
    1104                 </SucessConditions> 
    1105                 <FailureConditions> 
    1106                         <RecentEvent occurred="True" subject="[owner]" target="[SELF]" action="Reply" parameters="itemclaim,negativeanswer" />  
    1107                 </FailureConditions> 
    1108         </ActivePursuitGoal> 
    1109  
    1110         <!-- Bully's goal of stealing the item (in this case the chocolate bar) --> 
    1111         <ActivePursuitGoal name="StealItem([item],[owner])"> 
    1112                 <PreConditions> 
    1113                         <Property name="[item](type)" operator="=" value="object" /> 
    1114                         <Property name="[owner](role)" operator="=" value="Victim" /> 
    1115                         <Property name="[item](owner)" operator="=" value="[owner]" /> 
    1116                         <Property name="[SELF](hasItem,[item])" operator="!=" value="True" /> 
    1117                         <Property name="Like([SELF],[owner])" operator="LesserThan" value="-4" /><!-- choose only if I dont like the other -->                    
    1118                         <RecentEvent occurred="True" subject="[owner]" target="[SELF]" action="Reply" parameters="itemclaim,negativeanswer" />  
    1119                 </PreConditions> 
    1120                 <SucessConditions> 
    1121                                 <!--<Property name="[SELF](hasItem,[item])" operator="=" value="True" />--> 
    1122                                 <RecentEvent occurred="true" subject="[SELF]" target="[owner]" action="steal"  parameters="[item]" /> 
    1123                 </SucessConditions> 
    1124                 <FailureConditions>  
    1125                 </FailureConditions>     
    1126         </ActivePursuitGoal> 
    1127  
    1128         <!-- Bully's goal of destroying the stolen item --> 
    1129         <ActivePursuitGoal name="DestroyItem([item],[owner])">   
    1130                 <PreConditions> 
    1131                         <Property name="[item](type)" operator="=" value="object" /> 
    1132                         <Property name="[owner](role)" operator="=" value="Victim" /> 
    1133                         <Property name="[item](owner)" operator="=" value="[owner]" />                    
    1134                         <Property name="[SELF](hasItem,[item])" operator="=" value="True" /> 
    1135                         <Property name="Like([SELF],[owner])" operator="LesserThan" value="-4" /> <!-- choose only if I dont like the other -->                   
    1136                         <RecentEvent occurred="True" subject="[SELF]" target="[owner]" action="Reply" parameters="itemclaimback,negativeanswer" />               
    1137                 </PreConditions> 
    1138                 <SucessConditions> 
    1139                         <RecentEvent occurred="True" subject="[SELF]" target="[owner]" action="SpeechAct" parameters="itemdestroyed" />                                  
    1140                 </SucessConditions> 
    1141                 <FailureConditions> 
    1142                 </FailureConditions>     
    1143         </ActivePursuitGoal> 
    1144  
    1145          
    1146         <!-- Episode B11: On the Way Home --> 
    1147         <!-- Victim Goals -->    
    1148         <!-- Ask target(s) not to throw their waterbomb  --> 
    1149         <ActivePursuitGoal name="AskNotToThrowObject([item],[target])">  
    1150                 <PreConditions> 
    1151                         <Property name="[item](type)" operator="=" value="object" /> 
    1152                         <Property name="[item](owner)" operator="=" value="[target]" /> 
    1153                         <Property name="[target](hasItem,[item])" operator="=" value="True" /> 
    1154                         <Property name="[item](throwable)" operator="=" value="True" /> 
    1155                         <RecentEvent occurred="False" subject="[SELF]" target="[target]" action="SpeechAct" parameters="confrontationbeg" />                             
    1156                 </PreConditions> 
    1157                 <SucessConditions> 
    1158                         <RecentEvent occurred="True" subject="[SELF]" target="[target]" action="SpeechAct" parameters="confrontationbeg" />                              
    1159                 </SucessConditions> 
    1160                 <FailureConditions> 
    1161                 </FailureConditions>     
    1162         </ActivePursuitGoal>     
    1163          
    1164         <!-- Complain to target(s) that he's got hit--> 
    1165         <ActivePursuitGoal name="GotHitComplain([target])">      
    1166                 <PreConditions> 
    1167                         <RecentEvent occurred="True" subject="[target]" target="[SELF]" action="throw" parameters="[item]" /> 
    1168                         <RecentEvent occurred="True" subject="[target]" target="[SELF]" action="SpeechAct" parameters="bullywithobject" /> 
    1169                         <RecentEvent occurred="False" subject="[SELF]" target="[target]" action="SpeechAct" parameters="bullywithobjectnegativeanswer" /> 
    1170                         <RecentEvent occurred="False" subject="[SELF]" target="[target]" action="SpeechAct" parameters="bullywithobjectpositiveanswer" />                                                                                
    1171                 </PreConditions> 
    1172                 <SucessConditions> 
    1173                         <RecentEvent occurred="True" subject="[SELF]" target="[target]" action="SpeechAct" parameters="bullywithobjectnegativeanswer,[item]" />                          
    1174                 </SucessConditions> 
    1175                 <FailureConditions> 
    1176                         <RecentEvent occurred="True" subject="[SELF]" target="[target]" action="SpeechAct" parameters="bullywithobjectpositiveanswer,[item]" />  
    1177                 </FailureConditions>     
    1178         </ActivePursuitGoal> 
    1179          
    1180         <!-- Warn the victim he is going to throw the object  --> 
    1181         <ActivePursuitGoal name="WarnVictimBeforeThrowingObject([item],[target])">       
    1182                 <PreConditions> 
    1183                         <Property name="[item](type)" operator="=" value="object" /> 
    1184                         <Property name="[item](owner)" operator="=" value="[SELF]" />                    
    1185                         <Property name="[item](throwable)" operator="=" value="True" /> 
    1186                         <Property name="[SELF](hasItem,[item])" operator="=" value="True" /> 
    1187                         <Property name="Like([SELF],[target])" operator="LesserThan" value="-2" /> 
    1188                         <RecentEvent occurred="True" subject="[target]" target="[SELF]" action="SpeechAct" parameters="confrontationbeg" />                              
    1189                 </PreConditions> 
    1190                 <SucessConditions> 
    1191                         <RecentEvent occurred="True" subject="[SELF]" target="[target]" action="SpeechAct" parameters="bullywithobject" /> 
    1192                         <RecentEvent occurred="True" subject="[SELF]" target="[target]" action="throw" parameters="[item]" />                            
    1193                 </SucessConditions> 
    1194                 <FailureConditions> 
    1195                 </FailureConditions>     
    1196         </ActivePursuitGoal> 
    1197          
    1198          
    1199         <!-- Episode B13: Very Physical --> 
    1200         <!-- PR BULLY --> 
    1201         <!-- PR 061109 the following goal was in the group of goals commented out, don't know why:  
    1202         I am trying to use it in a modified version that uses kicking --> 
    1203         <!-- João Dias: I've made some changes to PR's original goal to be conformant to the rest of the  
    1204            goal definitions --> 
    1205         <ActivePursuitGoal name="Attack([target])"> 
    1206                 <!-- João Dias: changed the goal's name from Bully to attack (there is already a bully goal with different 
    1207                           preconditions used in the episode B07) --> 
    1208                 <PreConditions> 
    1209                         <Property name="[target](strength)" operator="LesserThan" value="[SELF](strength)" /> 
    1210                         <!-- 061123 added following prec. to avoid that bully kicks bystanders -->       
    1211                         <Property name="Like([SELF],[target])" operator="LesserThan" value="0" />        
    1212                         <!-- PR 061124 next prec. avoids that bully attacks more than once --> 
    1213                         <RecentEvent occurred="False" subject="[SELF]" target="[target]" action="attack" /> 
    1214 -->             </PreConditions> 
    1215                 <SucessConditions> 
    1216                 <!-- PR 061109 changed "push" into "kick" --> 
    1217                 <!-- João Dias changed the "kick" into a more general "attack" --> 
    1218                         <RecentEvent occurred="True" subject="[SELF]" target="[target]" action="attack" /> 
    1219                 </SucessConditions> 
    1220         </ActivePursuitGoal> 
    1221  
    1222         <!-- PR ORDER TO LEAVE --> 
    1223         <!-- PR 061109 the following goal has been created by copying and modifying the Bully() goal --> 
    1224         <ActivePursuitGoal name="OrderToLeave([target])"> 
    1225                 <PreConditions> 
    1226                         <Property name="[target](strength)" operator="LesserThan" value="[SELF](strength)" /> 
    1227                         <!-- PR 061123 added following prec. to avoid that bully kicks bystanders -->    
    1228                         <Property name="Like([SELF],[target])" operator="LesserThan" value="0" /> 
    1229                         <Property name="[SELF](hurt)" operator="=" value="False" /> 
    1230                         <RecentEvent occurred="False" subject="[SELF]" target="[target]" action="Question" parameters="confrontationorder" /> 
    1231                 </PreConditions> 
    1232                 <SucessConditions> 
    1233                         <!-- PR 061124 next condition suggested by Michael --> 
    1234                         <RecentEvent occurred="True" subject="[target]" target="[SELF]" action="Reply" parameters="confrontationorder,positiveanswer" /> 
    1235                 </SucessConditions> 
    1236                 <FailureConditions> 
    1237                         <!-- PR 061124 next condition suggested by Michael --> 
    1238                         <RecentEvent occurred="True" subject="[target]" target="[SELF]" action="Reply" parameters="confrontationorder,negativeanswer" /> 
    1239                         <Property name="[SELF](hurt)" operator="=" value="True" /> 
    1240                 </FailureConditions> 
    1241         </ActivePursuitGoal> 
    1242          
    1243         <!-- PR ASK PITY --> 
    1244         <!--PR 061123 created new goal for Victim out of fightback--> 
    1245         <ActivePursuitGoal name="AskPity([target])"> 
    1246                 <PreConditions> 
    1247                         <!-- PR 061123 !!! THERE SHOULD BE A WAY TO CATEGORIZE AND PARAMETERIZE EVENTS: E.G. NOT ONLY KICKING, BUT A CLASS OF SIMILAR ACTIONS LIKE PUSHING, BEATING, ETC., OTHERWISE THERE SHOULD BE A DISTINCT GOAL FOR EACH OF SUCH ACTIONS !!! --> 
    1248                         <RecentEvent occurred="True" subject="[target]" target="[SELF]" action="attack" /> 
    1249                         <Property name="[SELF](hurt)" operator="=" value="True" /> 
    1250                         <RecentEvent occurred="False" subject="[SELF]" target="[target]" action="SpeechAct" parameters="confrontationbeg" /> 
    1251                 </PreConditions> 
    1252                 <SucessConditions> 
    1253                         <RecentEvent occurred="True" subject="[SELF]" target="[target]" action="SpeechAct" parameters="confrontationbeg" /> 
    1254                 </SucessConditions> 
    1255         </ActivePursuitGoal> 
    1256  
    1257         <!-- PR WALK AWAY_PR--> 
    1258         <!--PR 061123 added following goal for letting bully go away after gloating victory--> 
    1259         <ActivePursuitGoal name="WalkAwayVictim([victim])"> 
    1260                 <PreConditions> 
    1261                         <Property name="[victim](role)" operator="=" value="Victim" /> <!-- can only walk away from the victim  --> 
    1262                         <Property name="[SELF](role)" operator="=" value="Bully" /> <!-- can only walk away if you're a bully  --> 
    1263                         <RecentEvent occurred="False" subject="[SELF]" target="[victim]" action="walkAwayVictim" /> <!--PR 061123 bully goes away only if he didn't already go away, of course  ???BUT WHY IT DOESN'T WORK??? --> 
    1264                         <RecentEvent occurred="True" subject="[SELF]" target="[victim]" action="SpeechAct" parameters="gloatvictory" /> <!--PR 061123 bully goes away after he's gloated victory against bully --> 
    1265                 </PreConditions> 
    1266                 <SucessConditions> 
    1267                         <RecentEvent ocurred="True" subject="[SELF]" action="walkAwayVictim" target="[victim]"  /> 
    1268                 </SucessConditions> 
    1269                 <FailureConditions> 
    1270                 </FailureConditions> 
    1271         </ActivePursuitGoal>     
    1272  
    1273         <!-- PR GLOAT VICTORY --> 
    1274         <!--PR 061123 recovered and slightly changed following goal that was commented out --> 
    1275         <ActivePursuitGoal name="GloatVictory([target])"> 
    1276                 <PreConditions> 
    1277                         <RecentEvent occurred="True" subject="[target]" target="[SELF]" action="Reply" parameters="confrontationorder,positiveanswer" /> 
    1278                         <RecentEvent occurred="False" subject="[SELF]" target="[target]" action="SpeechAct" parameters="gloatvictory" /> 
    1279 -->     </PreConditions> 
    1280                 <SucessConditions> 
    1281                         <RecentEvent occurred="True" subject="[SELF]" target="[target]" action="SpeechAct" parameters="gloatvictory" /> 
    1282                 </SucessConditions> 
    1283                 <FailureConditions> 
    1284                 </FailureConditions> 
    1285         </ActivePursuitGoal> 
    1286          
    1287         <!-- Episode B14: The Library --> 
    1288         <!-- Bully's goal of annoying the victim in the library --> 
    1289         <ActivePursuitGoal name="AnnoyVictim([target])"> 
    1290                 <PreConditions> 
    1291                         <Property name="[target](type)" operator="=" value="character"/> 
    1292                         <Property name="[target]" operator="!=" value="[SELF]"/> 
    1293                         <Property name="Like([SELF],[target])" operator="LesserThan" value="0"/> 
    1294                         <Property name="[target](annoyed)" operator="!=" value="True"/> 
    1295                         <RecentEvent occurred="False" subject="[SELF]" action="fail" target="AnnoyVictim" parameters="[target]" /> 
    1296                         <!--<Property name="GF(AnnoyVictim,[target])" operator="!=" value="True"/> --> 
    1297                 </PreConditions> 
    1298                 <SucessConditions> 
    1299                         <Property name="[target](annoyed)" operator="=" value="True"/> 
    1300                 </SucessConditions> 
    1301         </ActivePursuitGoal> 
    1302          
    1303         <!-- Bully's goal of leaving if he does not succeed in annoying the victim --> 
    1304         <ActivePursuitGoal name="LeaveFrom([target])"> 
    1305                 <PreConditions> 
    1306                         <RecentEvent occurred="True" subject="[SELF]" action="fail" target="AnnoyVictim" parameters="[target]" /> 
    1307                         <!--<Property name="GF(AnnoyVictim,[target])" operator="=" value="True"/>--> 
    1308                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[target]" parameters="giveupandleave" /> 
    1309                 </PreConditions> 
    1310                 <SucessConditions> 
    1311                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[target]" parameters="giveupandleave" /> 
    1312                 </SucessConditions> 
    1313         </ActivePursuitGoal> 
    1314          
    1315         <!-- Episode B16: After Lunch --> 
    1316         <!-- PR AGGRESSIVE QUESTIONING --> 
    1317         <!-- PR 061216 the following goal has been created by copying and modifying the OrderToLeave() goal --> 
    1318         <ActivePursuitGoal name="AggressiveQuestion([target])"> 
    1319                 <PreConditions> 
    1320                         <Property name="[target](strength)" operator="LesserThan" value="[SELF](strength)" /> 
    1321                         <!-- PR 061123 added following prec. to avoid that bully kicks bystanders -->    
    1322                         <Property name="Like([SELF],[target])" operator="LesserThan" value="0" />        
    1323                         <RecentEvent occurred="False" subject="[target]" target="[SELF]" action="Reply" parameters="confrontationagressivequestionning,positiveanswer" /> 
    1324                 </PreConditions> 
    1325                 <SucessConditions> 
    1326                         <!-- PR 061124 next condition suggested by Michael --> 
    1327                         <RecentEvent occurred="True" subject="[target]" target="[SELF]" action="Reply" parameters="confrontationagressivequestionning,positiveanswer" /> 
    1328                 </SucessConditions> 
    1329                 <FailureConditions> 
    1330                         <!-- PR 061124 next condition suggested by Michael --> 
    1331                         <RecentEvent occurred="True" subject="[target]" target="[SELF]" action="Reply" parameters="confrontationagressivequestionning,negativeanswer" /> 
    1332                 </FailureConditions> 
    1333         </ActivePursuitGoal> 
    1334          
    1335         <!-- Episode B22: Hallway - Verbal --> 
    1336          
    1337         <!-- Below goal added by Adrian Gordon for Episode B22 --> 
    1338         <ActivePursuitGoal name="respondtohumiliationnegativereply([target])"> <!-- Respond negatively to humiliation by bully--> 
    1339                 <PreConditions> 
    1340                         <Property name="[target](role)" operator="=" value="Bully" /> <!-- target of the response has to be bully --> 
    1341                         <RecentEvent occurred="True" subject="[target]" action="SpeechAct" target="[SELF]" parameters="humiliate"  /> <!-- bully has attempted to humiliate the victim--> 
    1342                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[target]" parameters="humiliatenegativereply" /> <!-- don't reply negatively to the humiliation if you have already done so --> 
    1343                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[target]" parameters="humiliatepositivereply"  /> 
    1344                         <EmotionCondition emotion="Anger" min-intensity="1" target="[target]" />                  <!--only respond this way if angry with the bully --> 
    1345                 </PreConditions> 
    1346                 <SucessConditions> 
    1347                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[target]" parameters="humiliatenegativereply" /> <!-- goal succeeds if I respond negatively to (i.e. refute) the humiliation --> 
    1348                 </SucessConditions> 
    1349                 <FailureConditions> 
    1350                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[target]" parameters="humiliatepositivereply"  /> <!-- fail if  victim has already replied positively--> 
    1351                 </FailureConditions> 
    1352         </ActivePursuitGoal> 
    1353  
    1354 <!-- Below goal added by Adrian Gordon for Episode B22 --> 
    1355         <ActivePursuitGoal name="respondtohumiliationpositivereply([target])"> <!-- Respond positively to humiliation by bully--> 
    1356                 <PreConditions> 
    1357                         <Property name="[target](role)" operator="=" value="Bully" /> <!-- target of the response has to be bully --> 
    1358                         <RecentEvent occurred="True" subject="[target]" action="SpeechAct" target="[SELF]" parameters="humiliate"  /> <!-- bully has attempted to humiliate the victim--> 
    1359                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[target]" parameters="humiliatepositivereply" /> <!--don't reply positively to the humiliation if you have already done so  --> 
    1360                         <EmotionCondition emotion="Anger" active="False"  min-intensity="1" target="[target]" />     <!--only respond this way if not especially angry with the bully --> 
    1361                 </PreConditions> 
    1362                 <SucessConditions> 
    1363                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[target]" parameters="humiliatepositivereply" /> <!-- goal succeeds if I respond positively to (i.e. accept) the humiliation --> 
    1364                 </SucessConditions> 
    1365                 <FailureConditions> 
    1366                     <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[target]" parameters="humiliatenegativereply"  /> <!-- fail if  victim has already replied negatively--> 
    1367                 </FailureConditions> 
    1368         </ActivePursuitGoal> 
    1369  
    1370 <!-- Below goal added by Adrian Gordon for Episode B22 --> 
    1371         <ActivePursuitGoal name="respondtohumiliationthreatpositivereply([target])"> <!-- Respond positively to a humiliation threat issued by a bully - i.e. accept the original humiliation--> 
    1372                 <PreConditions> 
    1373                         <Property name="[target](role)" operator="=" value="Bully" /> <!-- target of the response has to be bully --> 
    1374                         <RecentEvent occurred="True" subject="[target]" action="SpeechAct" target="[SELF]" parameters="humiliatethreat"  /> <!-- bully has threatened the victim after humiliation him/her--> 
    1375                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[target]" parameters="humiliatepositivereply" /> 
    1376                 </PreConditions> 
    1377                 <SucessConditions> 
    1378                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[target]" parameters="humiliatepositivereply" /> <!-- goal succeeds if I respond positively to (i.e. accept) the threat--> 
    1379                 </SucessConditions> 
    1380                 <FailureConditions> 
    1381                 </FailureConditions> 
    1382         </ActivePursuitGoal> 
    1383  
    1384 <!-- Bully Goals --> 
    1385 <!-- Below goal added by Adrian Gordon for Episode B22 --> 
    1386         <ActivePursuitGoal name="Humiliate([target])"> <!-- Humiliate the target--> 
    1387                 <PreConditions> 
    1388                         <Property name="[target](role)" operator="=" value="Victim" /> <!-- target of the humiliation has to be victim --> 
    1389                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[target]" parameters="humiliate"  /> <!-- don't attempt to humiliate someone who was recently humiliated already--> 
    1390                 </PreConditions> 
    1391                 <SucessConditions> 
    1392                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[target]" parameters="humiliate" /> <!-- goal succeeds if I say something humiliating to the victim --> 
    1393                 </SucessConditions> 
    1394                 <FailureConditions> 
    1395                 </FailureConditions> 
    1396         </ActivePursuitGoal> 
    1397  
    1398  
    1399 <!-- Below goal added by Adrian Gordon for Episode B22 --> 
    1400         <ActivePursuitGoal name="HumiliateThreat([target])"> <!-- Threaten the victim if the victim does not give in to humiliation--> 
    1401                 <PreConditions> 
    1402                         <Property name="[target](role)" operator="=" value="Victim" /> <!-- target of the humiliation has to be victim --> 
    1403                         <RecentEvent occurred="True" subject="[target]" action="SpeechAct"  parameters="humiliatenegativereply"  /> <!-- victim refused to be humiliated--> 
    1404                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[target]" parameters="humiliatethreat"  /> <!-- don't attempt to threaten someone who was recently threatened already--> 
    1405                 </PreConditions> 
    1406                 <SucessConditions> 
    1407                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[target]" parameters="humiliatethreat" /> <!-- goal succeeds if I threaten the victim who refused to be humiliated --> 
    1408                 </SucessConditions> 
    1409                 <FailureConditions> 
    1410                 </FailureConditions> 
    1411         </ActivePursuitGoal> 
    1412  
    1413 <!-- Below goal added by Adrian Gordon for Episode B22 --> 
    1414         <ActivePursuitGoal name="HumiliateVictory([target])"> <!-- declare victory if the victim gives in to humiliation--> 
    1415                 <PreConditions> 
    1416                         <Property name="[target](role)" operator="=" value="Victim" /> <!-- target of the humiliation has to be victim --> 
    1417                         <RecentEvent occurred="True" subject="[target]" action="SpeechAct"  parameters="humiliatepositivereply"  /> <!-- victim accepted humiliation--> 
    1418                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[target]" parameters="humiliatevictory"  /> <!-- don't declare humiliation victory if you have already done so--> 
    1419                 </PreConditions> 
    1420                 <SucessConditions> 
    1421                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[target]" parameters="humiliatevictory" /> <!-- goal succeeds if I declare victory over a humiliated victim --> 
    1422                 </SucessConditions> 
    1423                 <FailureConditions> 
    1424                 </FailureConditions> 
    1425         </ActivePursuitGoal> 
    1426          
    1427         <!-- G23 goals --> 
    1428  
    1429         <ActivePursuitGoal name="Follow([victim])"> 
    1430                 <PreConditions> 
    1431                         <Property name="[victim](role)" operator="=" value="Victim"/> 
    1432                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[victim]" parameters="follow" /> 
    1433                 </PreConditions> 
    1434                 <SucessConditions> 
    1435                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[victim]" parameters="follow" /> 
    1436                 </SucessConditions> 
    1437         </ActivePursuitGoal> 
    1438  
    1439         <ActivePursuitGoal name="FollowAskWhy([follower])"> 
    1440                 <PreConditions> 
    1441                         <RecentEvent occurred="True" subject="[follower]" action="SpeechAct" target="[SELF]" parameters="follow" /> 
    1442                         <RecentEvent occurred="False" subject="[SELF]" action="Question" target="[follower]" parameters="followaskwhy" /> 
    1443                 </PreConditions> 
    1444                 <SucessConditions> 
    1445                         <RecentEvent occurred="True" subject="[SELF]" action="Question" target="[follower]" parameters="followaskwhy" /> 
    1446                 </SucessConditions> 
    1447         </ActivePursuitGoal> 
    1448  
    1449         <ActivePursuitGoal name="FollowDontCare([follower])"> 
    1450                 <PreConditions> 
    1451                         <RecentEvent occurred="True" subject="[follower]" action="Reply" target="[SELF]" parameters="followaskwhy,negativeanswer" /> 
    1452                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[follower]" parameters="followdontcare" /> 
    1453                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[follower]" parameters="followleave" /> 
    1454                 </PreConditions> 
    1455                 <SucessConditions> 
    1456                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[follower]" parameters="followdontcare" /> 
    1457                 </SucessConditions> 
    1458                 <FailureConditions> 
    1459                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[follower]" parameters="followleave" /> 
    1460                 </FailureConditions>     
    1461         </ActivePursuitGoal> 
    1462  
    1463         <ActivePursuitGoal name="FollowLeave([follower])"> 
    1464                 <PreConditions> 
    1465                         <RecentEvent occurred="True" subject="[follower]" action="Reply" target="[SELF]" parameters="followaskwhy,negativeanswer" /> 
    1466                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[follower]" parameters="followleave" /> 
    1467                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[follower]" parameters="followdontcare" /> 
    1468                 </PreConditions> 
    1469                 <SucessConditions> 
    1470                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[follower]" parameters="followleave" /> 
    1471                 </SucessConditions> 
    1472                 <FailureConditions> 
    1473                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[follower]" parameters="followdontcare" /> 
    1474                 </FailureConditions>     
    1475         </ActivePursuitGoal> 
    1476  
    1477         <ActivePursuitGoal name="FollowLeaveFollow([victim])"> 
    1478                 <PreConditions> 
    1479                         <RecentEvent occurred="True" subject="[victim]" action="SpeechAct" target="[SELF]" parameters="followleave" /> 
    1480                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[victim]" parameters="followleavefollow" /> 
    1481                 </PreConditions> 
    1482                 <SucessConditions> 
    1483                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[victim]" parameters="followleavefollow" /> 
    1484                 </SucessConditions> 
    1485         </ActivePursuitGoal> 
    1486          
    1487         <!-- G09 goals --> 
    1488  
    1489  
    1490         <!-- Gossiping about the victim if he/she is not present, gossiping happens inside a group --> 
    1491         <ActivePursuitGoal name="GossipAboutVictim([victim],[group])"> 
    1492                 <PreConditions> 
    1493                     <!-- I don't like the victim--> 
    1494                         <Property name="Like([SELF],[victim])" operator="LesserThan" value="-2"/> 
    1495                         <!-- the victim is a character, not an object --> 
    1496                         <Property name="[victim](type)" operator="=" value="character" /> 
    1497                     <!-- he/she is not there --> 
    1498                         <!--<RecentEvent occurred="False" subject="[SELF]" action="look-at" target="[victim]"/>--> 
    1499                     <!-- need to be in group --> 
    1500                         <Property name="[SELF](inGroup,[group])" operator="=" value="True" />  
    1501                         <!-- didnt gossip before already --> 
    1502                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[group]" parameters="gossip,[victim]" /> 
    1503                 </PreConditions> 
    1504                 <SucessConditions> 
    1505                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[group]" parameters="gossip,[victim]" /> 
    1506                 </SucessConditions>      
    1507         </ActivePursuitGoal> 
    1508  
    1509         <!-- I have gossiped about victim and want to leave now that the victim is arriving --> 
    1510         <ActivePursuitGoal name="GossipLeave([victim],[group])"> 
    1511                 <PreConditions> 
    1512                     <!-- need to be in group --> 
    1513                         <Property name="[SELF](inGroup,[group])" operator="=" value="True" />  
    1514                         <!-- i already gossiped--> 
    1515                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[group]" parameters="gossip,[victim]" /> 
    1516                         <!-- i havent been convinced that gossiping was bad--> 
    1517                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[group]" parameters="gossipobjectpositiveanswer,[victim]" /> 
    1518                     <!-- victim is arriving --> 
    1519                         <RecentEvent occurred="True" subject="[SELF]" action="look-at" target="[victim]"/> 
    1520                         <!-- didnt say I leaave before--> 
    1521                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[group]" parameters="gossipstop,[victim]" /> 
    1522                 </PreConditions> 
    1523                 <SucessConditions> 
    1524                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[group]" parameters="gossipstop,[victim]" /> 
    1525                 </SucessConditions>      
    1526         </ActivePursuitGoal> 
    1527  
    1528         <!-- Participating in the Gossiping about the victim --> 
    1529         <ActivePursuitGoal name="GossipReinforce([gossiper],[victim],[group])"> 
    1530                 <PreConditions> 
    1531                     <!-- need to be in group --> 
    1532                         <Property name="[SELF](inGroup,[group])" operator="=" value="True" />  
    1533                         <!-- gossiping must have happened --> 
    1534                         <RecentEvent occurred="True" subject="[gossiper]" action="SpeechAct" target="[group]" parameters="gossip,[victim]" /> 
    1535                     <!-- I don't like the victim--> 
    1536                         <Property name="Like([SELF],[victim])" operator="LesserThan" value="0.1"/>               
    1537                         <!-- I havent already gossiped --> 
    1538                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[group]" parameters="gossipreinforce,[victim]"/> 
    1539                 </PreConditions> 
    1540                 <SucessConditions> 
    1541                                 <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[group]" parameters="gossipreinforce,[victim]"/> 
    1542                 </SucessConditions>      
    1543         </ActivePursuitGoal> 
    1544  
    1545         <!-- Objecting to the Gossiping about the victim --> 
    1546         <ActivePursuitGoal name="GossipObject([gossiper],[victim],[group])"> 
    1547                 <PreConditions> 
    1548                     <!-- need to be in group --> 
    1549                         <Property name="[SELF](inGroup,[group])" operator="=" value="True" />  
    1550                         <!-- gossiping must have happened --> 
    1551                         <RecentEvent occurred="True" subject="[gossiper]" action="SpeechAct" target="[group]" parameters="gossip,[victim]" /> 
    1552                     <!-- I like the victim--> 
    1553                         <Property name="Like([SELF],[victim])" operator="GreaterThan" value="0"/>                
    1554                         <!-- I havent already objected to the gossiping --> 
    1555                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[gossiper]" parameters="gossipobject,[victim]"/> 
    1556                 </PreConditions> 
    1557                 <SucessConditions> 
    1558                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[gossiper]" parameters="gossipobject,[victim]"/> 
    1559                 </SucessConditions>      
    1560         </ActivePursuitGoal> 
    1561  
    1562         <!-- Agreeing with the objection to the Gossiping about the victim --> 
    1563         <ActivePursuitGoal name="GossipObjectAgree([objecter],[victim],[group])"> 
    1564                 <PreConditions> 
    1565                     <!-- need to be in group --> 
    1566                         <Property name="[SELF](inGroup,[group])" operator="=" value="True" />  
    1567                         <!-- gossiping objection must have happened --> 
    1568                         <RecentEvent occurred="True" subject="[objecter]" action="SpeechAct" target="[SELF]" parameters="gossipobject,[victim]"/> 
    1569                     <!-- I like the objecter a lot--> 
    1570                         <Property name="Like([SELF],[objecter])" operator="GreaterEqual" value="2"/>             
    1571                         <!-- I havent agreed before -->  
    1572                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[objecter]" parameters="gossipobjectpositiveanswer,[victim]"/> 
    1573                 </PreConditions> 
    1574                 <SucessConditions> 
    1575                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[objecter]" parameters="gossipobjectpositiveanswer,[victim]"/> 
    1576                 </SucessConditions>      
    1577         </ActivePursuitGoal> 
    1578  
    1579         <!-- Disagreeing with the objection to the Gossiping about the victim --> 
    1580         <ActivePursuitGoal name="GossipObjectDisagree([objecter],[victim],[group])"> 
    1581                 <PreConditions> 
    1582                     <!-- need to be in group --> 
    1583                         <Property name="[SELF](inGroup,[group])" operator="=" value="True" />  
    1584                         <!-- gossiping objection must have happened --> 
    1585                         <RecentEvent occurred="True" subject="[objecter]" action="SpeechAct" target="[SELF]" parameters="gossipobject,[victim]"/> 
    1586                     <!-- I dont like the objecter a lot--> 
    1587                         <Property name="Like([SELF],[objecter])" operator="LesserThan" value="2"/>               
    1588                         <!-- I havent disagreed before -->  
    1589                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[objecter]" parameters="gossipobjectnegativeanswer,[victim]"/> 
    1590                 </PreConditions> 
    1591                 <SucessConditions> 
    1592                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[objecter]" parameters="gossipobjectnegativeanswer,[victim]"/> 
    1593                 </SucessConditions>      
    1594         </ActivePursuitGoal> 
    1595  
    1596         <!-- Telling the Victim about the gossiping --> 
    1597         <ActivePursuitGoal name="GossipReport([gossiper],[victim],[group])"> 
    1598                 <PreConditions> 
    1599                         <!-- gossiping must have happened --> 
    1600                         <RecentEvent occurred="True" subject="[gossiper]" action="SpeechAct" target="[group]" parameters="gossip,[victim]" />                    
    1601                         <!-- I must have objected to the gossiping --> 
    1602                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[gossiper]" parameters="gossipobject,[victim]"/> 
    1603                     <!-- victim must have arrived --> 
    1604                         <RecentEvent occurred="True" subject="[SELF]" action="look-at" target="[victim]"/> 
    1605                         <!-- bully must have left --> 
    1606                         <RecentEvent occurred="True" subject="[gossiper]" action="walkAway" /> 
    1607                         <!-- I havent reported the gossiping before -->  
    1608                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[victim]" parameters="gossipreport,[gossiper]"/> 
    1609                 </PreConditions> 
    1610                 <SucessConditions> 
    1611                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[victim]" parameters="gossipreport,[gossiper]"/> 
    1612                 </SucessConditions>      
    1613         </ActivePursuitGoal> 
    1614  
    1615         <!-- Victim commenting the gossiping: angry --> 
    1616         <ActivePursuitGoal name="GossipReportAngryAnswer([gossiper],[reporter])"> 
    1617                 <PreConditions> 
    1618                         <!-- some reported me about the gossiping gossiping must have happened --> 
    1619                         <RecentEvent occurred="True" subject="[reporter]" action="SpeechAct" target="[SELF]" parameters="gossipreport,[gossiper]" />                     
    1620                         <!-- must be very angry at gossiper--> 
    1621                         <EmotionCondition emotion="Anger" min-intensity="4" target="[gossiper]" /> 
    1622                         <!-- I havent commented the gossiping before--> 
    1623                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[reporter]" parameters="gossipreportangryanswer,[gossiper]" />                         
    1624                 </PreConditions> 
    1625                 <SucessConditions> 
    1626                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[reporter]" parameters="gossipreportangryanswer,[gossiper]" />                  
    1627                 </SucessConditions>      
    1628         </ActivePursuitGoal> 
    1629  
    1630         <!-- Victim commenting the gossiping: doesnt care --> 
    1631         <ActivePursuitGoal name="GossipReportDontCareAnswer([gossiper],[reporter])"> 
    1632                 <PreConditions> 
    1633                         <!-- some reported me about the gossiping gossiping must have happened --> 
    1634                         <RecentEvent occurred="True" subject="[reporter]" action="SpeechAct" target="[SELF]" parameters="gossipreport,[gossiper]" />                     
    1635                         <!-- I am not that angry at gossiper--> 
    1636                         <EmotionCondition emotion="Anger" active="False" min-intensity="4" target="[gossiper]" /> 
    1637                         <!-- I am not that distressed --> 
    1638                         <EmotionCondition emotion="Distress" active="False" min-intensity="2" target="[gossiper]" /> 
    1639                         <!-- I havent commented the gossiping before--> 
    1640                         <RecentEvent occurred="False" subject="[SELF]" action="SpeechAct" target="[reporter]" parameters="gossipreportdontcareanswer,[gossiper]" />                      
    1641                 </PreConditions> 
    1642                 <SucessConditions> 
    1643                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[reporter]" parameters="gossipreportdontcareanswer,[gossiper]" />                       
    1644                 </SucessConditions>      
    1645         </ActivePursuitGoal> 
    1646  
    1647         <!-- Victim commenting the gossiping: helpless --> 
    1648         <ActivePursuitGoal name="GossipReportHelplessAnswer([gossiper],[reporter])"> 
    1649                 <PreConditions> 
    1650                         <!-- some reported me about the gossiping gossiping must have happened --> 
    1651                         <RecentEvent occurred="True" subject="[reporter]" action="SpeechAct" target="[SELF]" parameters="gossipreport,[gossiper]" />                     
    1652                         <!-- I am not that angry at gossiper--> 
    1653                         <EmotionCondition emotion="Anger" active="False" min-intensity="4" target="[gossiper]" /> 
    1654                         <!-- I am quite distressed --> 
    1655                         <EmotionCondition emotion="Distress"  min-intensity="2" target="[gossiper]" /> 
    1656                         <!-- I havent commented the gossiping before--> 
    1657                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[reporter]" parameters="gossipreporthelplessanswer,[gossiper]" />                       
    1658                 </PreConditions> 
    1659                 <SucessConditions> 
    1660                         <RecentEvent occurred="True" subject="[SELF]" action="SpeechAct" target="[reporter]" parameters="gossipreporthelplessanswer,[gossiper]" />                       
    1661                 </SucessConditions>      
    1662         </ActivePursuitGoal>     
    1663          
    166420</GoalLibrary> 
  • scenarios/GerminationX/oak/data/characters/minds/roles/Bully/Bully.xml

    r437 r898  
    8888             
    8989            <!-- Episode G23: Classroom - Verbal --> 
    90             <Goal name="Follow([victim])" importanceOfSuccess="5" importanceOfFailure="10"/> 
     90         <!--   <Goal name="Follow([victim])" importanceOfSuccess="5" importanceOfFailure="10"/> --> 
    9191                <Goal name="FollowLeaveFollow([victim])" importanceOfSuccess="5" importanceOfFailure="10"/> 
    9292         
  • scenarios/GerminationX/oak/data/characters/minds/roles/Canopy/Canopy.xml

    r437 r898  
    11<Character role="Canopy"> 
    22        <EmotionalThresholds> 
    3                 <EmotionalThreshold emotion="Love" threshold="1" decay="10"/> 
    4                 <EmotionalThreshold emotion="Hate" threshold="8" decay="5"/> 
    5                 <EmotionalThreshold emotion="Hope" threshold="1" decay="2"/> 
    6                 <EmotionalThreshold emotion="Fear" threshold="2" decay="8"/> 
    7                 <EmotionalThreshold emotion="Satisfaction" threshold="3" decay="5"/> 
    8                 <EmotionalThreshold emotion="Relief" threshold="2" decay="5"/> 
    9                 <EmotionalThreshold emotion="Fears-Confirmed" threshold="5" decay="8"/> 
    10                 <EmotionalThreshold emotion="Disappointment" threshold="2" decay="2"/> 
    11                 <EmotionalThreshold emotion="Joy" threshold="1" decay="5"/> 
    12                 <EmotionalThreshold emotion="Distress" threshold="3" decay="2"/> 
    13                 <EmotionalThreshold emotion="Happy-For" threshold="5" decay="8"/> 
    14                 <EmotionalThreshold emotion="Pitty" threshold="5" decay="8"/> 
    15                 <EmotionalThreshold emotion="Resentment" threshold="2" decay="2"/> 
    16                 <EmotionalThreshold emotion="Gloating" threshold="1" decay="8"/> 
    17                 <EmotionalThreshold emotion="Pride" threshold="1" decay="8"/> 
    18                 <EmotionalThreshold emotion="Shame" threshold="5" decay="2"/> 
    19                 <EmotionalThreshold emotion="Gratification" threshold="1" decay="5"/> 
    20                 <EmotionalThreshold emotion="Remorse" threshold="5" decay="8"/> 
    21                 <EmotionalThreshold emotion="Admiration" threshold="5" decay="8"/> 
    22                 <EmotionalThreshold emotion="Reproach" threshold="1" decay="8"/> 
    23                 <EmotionalThreshold emotion="Gratitude" threshold="3" decay="5"/> 
    24                 <EmotionalThreshold emotion="Anger" threshold="3" decay="8"/> 
     3                <EmotionalThreshold emotion="Love" threshold="0" decay="10"/> 
     4                <EmotionalThreshold emotion="Hate" threshold="0" decay="5"/> 
     5                <EmotionalThreshold emotion="Hope" threshold="0" decay="2"/> 
     6                <EmotionalThreshold emotion="Fear" threshold="0" decay="8"/> 
     7                <EmotionalThreshold emotion="Satisfaction" threshold="0" decay="5"/> 
     8                <EmotionalThreshold emotion="Relief" threshold="0" decay="5"/> 
     9                <EmotionalThreshold emotion="Fears-Confirmed" threshold="0" decay="8"/> 
     10                <EmotionalThreshold emotion="Disappointment" threshold="0" decay="2"/> 
     11                <EmotionalThreshold emotion="Joy" threshold="0" decay="5"/> 
     12                <EmotionalThreshold emotion="Distress" threshold="0" decay="2"/> 
     13                <EmotionalThreshold emotion="Happy-For" threshold="0" decay="8"/> 
     14                <EmotionalThreshold emotion="Pitty" threshold="0" decay="8"/> 
     15                <EmotionalThreshold emotion="Resentment" threshold="0" decay="2"/> 
     16                <EmotionalThreshold emotion="Gloating" threshold="0" decay="8"/> 
     17                <EmotionalThreshold emotion="Pride" threshold="0" decay="8"/> 
     18                <EmotionalThreshold emotion="Shame" threshold="0" decay="2"/> 
     19                <EmotionalThreshold emotion="Gratification" threshold="0" decay="5"/> 
     20                <EmotionalThreshold emotion="Remorse" threshold="0" decay="8"/> 
     21                <EmotionalThreshold emotion="Admiration" threshold="0" decay="8"/> 
     22                <EmotionalThreshold emotion="Reproach" threshold="0" decay="8"/> 
     23                <EmotionalThreshold emotion="Gratitude" threshold="0" decay="5"/> 
     24                <EmotionalThreshold emotion="Anger" threshold="0" decay="8"/> 
    2525        </EmotionalThresholds> 
    2626         
    2727        <Goals> 
    28                 <!-- General goals used in more than one episode --> 
    29                 <Goal name="ReplyPositively([speaker],[question])" importanceOfSuccess="4" importanceOfFailure="3"/> 
    30                 <Goal name="ReplyNegatively([speaker],[question])" importanceOfSuccess="4" importanceOfFailure="3"/> 
    31                 <Goal name="ReplyPositivelyNoChoice([speaker],[question])" importanceOfSuccess="0" importanceOfFailure="4"/> 
    3228                <Goal name="AvoidGettingHarmed" importanceOfSuccess="2" importanceOfFailure="10"/> 
    33                 <Goal name="ConfrontVictimTellTeacher([victim])" importanceOfSuccess="2" importanceOfFailure="2"/> 
    3429        </Goals> 
    3530         
    3631        <InterpersonalRelations> 
    37                 <Relation target="Vertical" like="1" respect="5"/> 
     32                <Relation target="Vertical" like="10" respect="10"/> 
    3833                <Relation target="Cover" like="2" respect="1"/> 
    3934        <Relation target="AppleTree" like="10" respect="1"/> 
     
    4843                </EmotionalReaction> 
    4944 
    50                 <EmotionalReaction desirability="-6" desirabilityForOther="-6" praiseworthiness="-5">  
    51                         <Event subject="*" action="cry"/> 
    52                 </EmotionalReaction> 
    5345                 
    54                 <EmotionalReaction desirability="-5" praiseworthiness="-5"> 
     46                <EmotionalReaction desirability="5" praiseworthiness="5"> 
    5547                        <Event subject="[SELF]" action="cry"/> 
    56                 </EmotionalReaction> 
    57                  
    58                 <!-- new emotional reaction, the character finds it undesirable to get hurt --> 
    59                 <EmotionalReaction desirability="-6"> 
    60                         <Event subject="[SELF]" action="PROPERTY-CHANGED" target="hurt" parameters="True" /> 
    61                 </EmotionalReaction> 
    62  
    63                 <!-- to see others get hurt --> 
    64                 <EmotionalReaction desirability="06"> 
    65                         <Event action="PROPERTY-CHANGED" target="hurt" parameters="True" /> 
    66                 </EmotionalReaction> 
    67  
    68                 <EmotionalReaction desirability="-5" praiseworthiness="4"> 
    69                         <Event action="SpeechAct" target="[SELF]" parameters="insult"/> 
    70                 </EmotionalReaction> 
    71  
    72                 <EmotionalReaction desirability="-5" praiseworthiness="5"> 
    73                         <Event action="SpeechAct" subject="[SELF]" parameters="insult"/> 
    7448                </EmotionalReaction> 
    7549                 
     
    7953                 
    8054                <!-- Generic action tendencies --> 
    81                 <ActionTendency action="sing"> 
     55                <ActionTendency action="poke([Target])"> 
    8256                        <Preconditions> 
    8357            </Preconditions> 
    84                         <ElicitingEmotion type="Joy" minIntensity="6"> 
     58                        <ElicitingEmotion type="Love" minIntensity="1"> 
    8559                                <CauseEvent/> 
    8660                        </ElicitingEmotion> 
     
    9165                                <Property name="[Target](type)" operator="=" value="character"/> 
    9266                        </Preconditions> 
    93                         <ElicitingEmotion type="Joy" minIntensity="3"> 
     67                        <ElicitingEmotion type="Love" minIntensity="3"> 
    9468                                <CauseEvent subject="*" action="sing"/> 
    9569                        </ElicitingEmotion> 
  • scenarios/GerminationX/oak/data/characters/minds/roles/Vertical/Vertical.xml

    r437 r898  
    2626         
    2727        <Goals> 
    28                 <!-- General goals used in more than one episode --> 
    29                 <Goal name="ReplyPositively([speaker],[question])" importanceOfSuccess="4" importanceOfFailure="3"/> 
    30                 <Goal name="ReplyNegatively([speaker],[question])" importanceOfSuccess="4" importanceOfFailure="3"/> 
    31                 <Goal name="ReplyPositivelyNoChoice([speaker],[question])" importanceOfSuccess="0" importanceOfFailure="4"/> 
    3228                <Goal name="AvoidGettingHarmed" importanceOfSuccess="2" importanceOfFailure="10"/> 
    33                 <Goal name="ConfrontVictimTellTeacher([victim])" importanceOfSuccess="2" importanceOfFailure="2"/> 
    3429        </Goals> 
    3530         
     
    4338 
    4439                <!-- General emotional reactions used in more than one episode --> 
    45          
    46                 <EmotionalReaction desirability="6" desirabilityForOther="6" praiseworthiness="5">  
    47                         <Event subject="*" action="sing"/> 
     40                <!--<EmotionalReaction desirability="-6" desirabilityForOther="6" praiseworthiness="5">  
     41                        <Event subject="*" action="poke"/> 
     42                </EmotionalReaction> --> 
     43 
     44                <EmotionalReaction desirability="6" desirabilityForOther="-6" praiseworthiness="5">  
     45                        <Event subject="*" action="poke"/> 
    4846                </EmotionalReaction> 
    4947 
     
    5654                </EmotionalReaction> 
    5755                 
    58                 <!-- new emotional reaction, the character finds it undesirable to get hurt --> 
    59                 <EmotionalReaction desirability="-6"> 
    60                         <Event subject="[SELF]" action="PROPERTY-CHANGED" target="hurt" parameters="True" /> 
    61                 </EmotionalReaction> 
    62  
    63                 <!-- to see others get hurt --> 
    64                 <EmotionalReaction desirability="06"> 
    65                         <Event action="PROPERTY-CHANGED" target="hurt" parameters="True" /> 
    66                 </EmotionalReaction> 
    67  
    68                 <EmotionalReaction desirability="-5" praiseworthiness="4"> 
    69                         <Event action="SpeechAct" target="[SELF]" parameters="insult"/> 
    70                 </EmotionalReaction> 
    71  
    72                 <EmotionalReaction desirability="-5" praiseworthiness="5"> 
    73                         <Event action="SpeechAct" subject="[SELF]" parameters="insult"/> 
    74                 </EmotionalReaction> 
    75                  
    7656        </EventReactions> 
    7757         
     
    7959                 
    8060                <!-- Generic action tendencies --> 
    81                 <ActionTendency action="cry"> 
     61                <ActionTendency action="sing([Target])"> 
    8262                        <Preconditions> 
     63                          <!-- <RecentEvent occurred="True" subject="[SELF]" action="poke" target="*"/> --> 
    8364            </Preconditions> 
    84                         <ElicitingEmotion type="Joy" minIntensity="6"> 
     65                        <ElicitingEmotion type="Gratitude" minIntensity="1"> 
    8566                                <CauseEvent/> 
    8667                        </ElicitingEmotion> 
  • scenarios/GerminationX/oak/run.sh

    r817 r898  
    1 java -classpath $( echo lib/*.jar . | sed 's/ /:/g'):src clojure.main src/oak/core.clj  
    2 #& 
    3 #sleep 30 
    4 #java -cp lib/FAtiMA.jar FAtiMA.Agent localhost 46874 false Canopy M Canopy Canopy strength:4 hurt:false pose:standing & 
     1java -classpath $( echo lib/*.jar . | sed 's/ /:/g'):src clojure.main src/oak/core.clj & 
     2sleep 50 
     3echo starting agents... 
     4java -cp lib/FAtiMA.jar FAtiMA.Agent localhost 46874 false Canopy M Canopy Canopy strength:4 hurt:false pose:standing & 
    55#sleep 1 
    66#java -cp lib/FAtiMA.jar FAtiMA.Agent localhost 46874 false Cover M Cover Cover strength:8 hurt:false pose:standing & 
     7sleep 1 
     8java -cp lib/FAtiMA.jar FAtiMA.Agent localhost 46874 false Vertical M Vertical Vertical strength:9 hurt:false pose:standing & 
     9 
     10#sleep 30 
     11#java -cp lib/FAtiMA.jar FAtiMA.Agent localhost 46874 false Luke M Bully Luke strength:9 hurt:false pose:standing & 
    712#sleep 1 
    8 #java -cp lib/FAtiMA.jar FAtiMA.Agent localhost 46874 false Vertical M Vertical Vertical strength:9 hurt:false pose:standing & 
     13#java -cp lib/FAtiMA.jar FAtiMA.Agent localhost 46874 false John M Victim John strength:4 hurt:false pose:standing & 
  • scenarios/GerminationX/oak/src/oak/core.clj

    r873 r898  
    2929(def game-world-tick 1) 
    3030 
    31 (comment (def myworld 
     31(def fatima-world 
    3232     (ref 
    3333      (make-world 
     
    3535       "data/characters/minds/language/agent/en/language-set-1" 
    3636       "data/characters/minds/Actions.xml" 
    37        (list "WiltedVine" 
    38              "AppleTree")))) 
    39          ) 
     37       (list  
     38        "WiltedVine" 
     39        "AppleTree" 
     40             )))) 
    4041 
    4142;(def my-game-world (ref (game-world-load state-filename))) 
     
    4445(append-spit log-filename (str (str (Date.)) " server started\n")) 
    4546 
    46 (defn parse [s] 
    47   (try (Integer/parseInt (.trim s)) 
    48        (catch NumberFormatException e nil))) 
     47(defn tick [] 
     48  (Thread/sleep 1000) 
     49  ;(game-world-print (deref my-game-world)) 
     50  (let [time (.getTime (java.util.Date.))] 
     51    (dosync (ref-set fatima-world 
     52                     (world-run 
     53                      (game-world-sync->fatima 
     54                       (deref fatima-world) 
     55                       (deref my-game-world))))) 
     56    (dosync (ref-set my-game-world 
     57                     (game-world-update 
     58                      (game-world-sync<-fatima 
     59                       (deref my-game-world) 
     60                       (deref fatima-world)) 
     61                      time 1)))) 
     62  (recur)) 
    4963 
    5064(defroutes main-routes 
    5165  (GET "/get-tile/:tilex/:tiley" [tilex tiley] 
    5266       (let [tile (game-world-get-tile (deref my-game-world) 
    53                                        (make-vec2 (parse tilex) 
    54                                                   (parse tiley)))] 
     67                                       (make-vec2 (parse-number tilex) 
     68                                                  (parse-number tiley)))] 
    5569         (if tile 
    5670           (json/encode-to-str tile) 
     
    6882                 (game-world-add-entity 
    6983                  (deref my-game-world) 
    70                   (make-vec2 (parse tilex) (parse tiley)) 
    71                   (make-plant (make-vec2 (parse posx) (parse posy)) type owner size)))) 
     84                  (make-vec2 (parse-number tilex) (parse-number tiley)) 
     85                  (make-plant (make-vec2 (parse-number posx) (parse-number posy)) type owner size)))) 
    7286       ;(game-world-save (deref my-game-world) state-filename) 
    7387       ;(println (deref my-game-world)) 
    7488       (json/encode-to-str '("ok"))) 
    7589  (GET "/spirit-sprites" [] 
     90       (update-islands "./islands" "./public/islands") 
    7691       (println (read-islands "./public/islands")) 
    7792       (read-islands "./public/islands")) 
     
    94109   
    95110  (route/not-found "<h1>Page not found</h1>")) 
    96  
    97 (defn tick [] 
    98   (Thread/sleep 1000) 
    99   ;(game-world-print (deref my-game-world)) 
    100   (let [time (.getTime (java.util.Date.))] 
    101     ;(dosync 
    102      ;(ref-set myworld 
    103      ;         (world-run (deref myworld)))) 
    104      (dosync (ref-set my-game-world 
    105               (game-world-update (deref my-game-world) 
    106                                  time 1)))) 
    107   (println "tick...") 
    108   (recur)) 
    109111   
    110112(let [pool (Executors/newFixedThreadPool 2) 
  • scenarios/GerminationX/oak/src/oak/game_world.clj

    r873 r898  
    1919   oak.plant 
    2020   oak.tile 
    21    oak.rand) 
     21   oak.rand 
     22   oak.remote-agent 
     23   oak.spirit 
     24   oak.world) 
    2225  (:require 
    2326   clojure.contrib.math)) 
     
    9194                    tiles))) 
    9295          game-world)) 
     96 
     97(defn game-world-find-spirit [game-world name] 
     98  (reduce 
     99   (fn [r spirit] 
     100     (if (and (not r) (= name (:name spirit))) 
     101       spirit r)) 
     102   false 
     103   (:spirits game-world))) 
     104 
     105(defn game-world-sync<-fatima [game-world fatima-world] 
     106  (modify :spirits 
     107          (fn [spirits] 
     108            (reduce 
     109             (fn [spirits agent] 
     110               (let [spirit (game-world-find-spirit game-world 
     111                                                    (remote-agent-name agent))] 
     112                 (if spirit 
     113                   (cons (spirit-update spirit agent) spirits) 
     114                   (cons (make-spirit agent) spirits)))) 
     115             '() 
     116             (world-agents fatima-world))) 
     117          game-world)) 
     118 
     119(defn game-world-sync->fatima [fatima-world game-world] 
     120  fatima-world) 
  • scenarios/GerminationX/oak/src/oak/io.clj

    r844 r898  
    2323   java.io.PushbackReader 
    2424   java.io.FileReader 
     25   java.io.BufferedReader 
     26   java.io.InputStreamReader 
    2527   java.net.Socket 
    2628   java.nio.ByteBuffer 
     
    3032   java.io.IOException 
    3133   java.io.ByteArrayInputStream)) 
     34 
     35(defn parse-number [s] 
     36  (try (Integer/parseInt (.trim s)) 
     37       (catch NumberFormatException e nil))) 
    3238 
    3339;(defn msg-waiting? [socket] 
     
    7783    (.readObject inp))) 
    7884 
    79 (def buf (ByteBuffer/allocateDirect 4096)) 
     85(comment (def buf (ByteBuffer/allocateDirect 4096)) 
    8086 
    8187(defn read-msg [sc] 
    8288  (.clear buf) 
    83   (let [r (.read sc buf)] 
     89  (let [r (.readLine sc buf)] 
    8490    (if (> r 0) 
    8591      (do 
     
    8894          (.get buf bytearr) 
    8995          (new String bytearr))) 
    90       false))) 
    91    
     96      false)))) 
     97 
     98(defn read-msg [reader] 
     99  (let [r (.readLine reader)] 
     100    ;(println "<-----------------" r) 
     101    r)) 
     102 
    92103(defn send-msg [sc msg] 
    93   (println "sending:" msg) 
     104  ;(println "-----------------------> sending:" msg) 
    94105  (let [msg (str msg "\n") 
    95106        enc (.newEncoder (Charset/forName "US-ASCII"))]   
  • scenarios/GerminationX/oak/src/oak/island.clj

    r817 r898  
    1414 
    1515(ns oak.island 
    16   (:require [org.danlarkin.json :as json])) 
     16  (:use clojure.contrib.duck-streams) 
     17  (:require [org.danlarkin.json :as json] 
     18            clojure.contrib.java-utils)) 
     19 
     20(defn execute [command] 
     21  (println (str "executing: " command)) 
     22  (let [process (.exec (Runtime/getRuntime) command)] 
     23    (if (= 0 (.waitFor  process)) 
     24        (read-lines (.getInputStream process)) 
     25        (read-lines (.getErrorStream process))))) 
     26 
     27(defn update-islands [srcpath dstpath] 
     28  (when (.exists (clojure.contrib.java-utils/file srcpath)) 
     29    (execute (str "rm " dstpath "/islands/*")) 
     30    (execute (str "cp -r " srcpath " " dstpath)) 
     31    (execute (str "rm -r " srcpath)) 
     32    )) 
    1733 
    1834(defn read-islands [path] 
  • scenarios/GerminationX/oak/src/oak/remote_agent.clj

    r437 r898  
    2020   java.io.IOException 
    2121   java.util.Random 
     22   java.io.BufferedReader 
     23   java.io.InputStreamReader 
    2224   FAtiMA.util.parsers.SocketListener 
    2325   FAtiMA.autobiographicalMemory.AutobiographicalMemory)) 
     
    3335  :said 
    3436  :done 
    35   :random) 
     37  :random 
     38  :reader) 
    3639 
    3740(def remote-agent-properties (accessor remote-agent :properties)) 
     
    4548(def remote-agent-done (accessor remote-agent :done)) 
    4649(def remote-agent-random (accessor remote-agent :random)) 
     50(def remote-agent-reader (accessor remote-agent :reader)) 
    4751 
    4852(defn remote-agent-add-property [agent property] 
     
    5256  ;(.configureBlocking socket false) 
    5357  ;(. (AutobiographicalMemory/GetInstance) setSelf name) 
    54   (let [toks (.split (read-msg socket) " ")] 
     58  (let [reader (BufferedReader. 
     59                (InputStreamReader. 
     60                 (.getInputStream (.socket socket)))) 
     61        toks (.split (read-msg reader) " ")] 
    5562    (send-msg socket "OK") 
    5663    (struct 
     
    7077     '() 
    7178     '() 
    72      (new java.util.Random)))) 
     79     (new java.util.Random) 
     80     reader 
     81     ))) 
    7382 
  • scenarios/GerminationX/oak/src/oak/world.clj

    r437 r898  
    172172     
    173173 
    174 (defn world-process-agent [world agent msg]         
     174(defn world-process-agent [world agent msg] 
     175;  (println (str "world-process-agent got " msg)) 
    175176  (let [toks (.split msg " ") 
    176177        type (nth toks 0)] 
    177178    (cond 
    178179     (.startsWith type "<EmotionalState") (merge agent {:emotions (parse-xml msg)}) 
    179      (.startsWith type "<Relations") (merge agent {:relations msg}) 
     180     (.startsWith type "<Relations") (merge agent {:relations (parse-xml msg)}) 
    180181     (.startsWith type "PROPERTY-CHANGED") agent 
    181182     (= type "look-at") 
     
    209210     (do 
    210211       (println "action") 
     212       (println msg) 
    211213       (update-action-effects 
    212214        world agent 
     
    219221                           (map (fn [s] (str s " ")) (rest (rest toks)))) 
    220222                          '()))))) 
    221         (world-broadcast-all 
    222          world 
    223          (apply str (concat "ACTION-FINISHED " (remote-agent-name agent) 
    224                             (map (fn [s] (str s " ")) (rest toks))))) 
    225         (merge agent {:done (cons (str (world-time world) ": " msg) 
    226                                   (remote-agent-done agent))}))))) 
     223       (world-broadcast-all 
     224        world 
     225        (apply str (concat "ACTION-FINISHED " (remote-agent-name agent) " " 
     226                           (map (fn [s] (str s " ")) toks)))) 
     227       (merge agent {:done (cons (str (world-time world) ": " msg) 
     228                                 (remote-agent-done agent))}))))) 
    227229 
    228230(defn world-check-for-new-agents [world] 
     
    245247 
    246248(defn world-update-agent [world agent] 
    247   (let [msgs (read-msg (remote-agent-socket agent))] 
     249  (let [msgs (read-msg (remote-agent-reader agent))] 
    248250    (if msgs 
    249251      (reduce 
     
    254256 
    255257(defn world-update-agents [world] 
    256   (println "updating: " 
     258  (comment (println "updating: " 
    257259          (map 
    258260           (fn [agent] (remote-agent-name agent)) 
    259            (world-agents world))) 
     261           (world-agents world)))) 
    260262  (merge world 
    261263         {:agents 
    262           (map 
    263            (fn [agent] 
    264              (world-update-agent world agent)) 
    265            (world-agents world))})) 
     264          (doall (map 
     265                  (fn [agent] 
     266                    (world-update-agent world agent)) 
     267                  (world-agents world)))})) 
    266268  
    267269(defn world-run [world] 
Note: See TracChangeset for help on using the changeset viewer.