ATTITUDE message handling:
~~~~~~~~~~~~~~~~~~~~~~~~~~

* I-X activity and issue messages are treated as goals to be
  satisfied.  When report-back="yes" attribute is set, ATTITUDE
  sends a report back with the substituted goal used in the 
  text.  Thus, if the activity/issue
    (example-goal param1 ?var1  param2 ?var2)
  is sent to ATTITUDE, it will send back a report on success/failure
  with the substituted values for ?var1 and ?var2 (value1 and value2).
  Eg.
    (example-goal param1 value1 param2 value2)

* When ATTITUDE agents send I-X activity & issue messages they will
  expect a report (if report-back ="yes") back to contain information
  in the same format - eg. if we send an activity/issue:
    (example-goal param1 ?var1  param2 ?var2)
  we expect a report with text
    (example-goal param1 value1 param2 value2)

* I-X unsolicited reports are just added to ATTITUDE agents' knowledge 
  base as an expression/fact that the agent can reference or not.

Goals used for interface to HMAS-Coonawarra-Scenario agent are:
(all <time> parameters assume 24hr format (Binni time) - eg 1730. and
the outer layer of brackets can be ignored for IX-panels)

Things we might receive...

  (start-scenario <mode> <time>)  
       - configures the scenario agent and starts it running. This
         is only used for testing, where <mode> is an expression like 
         (simulate all) that tells the ship scenario how to run.  Any 
         expression can be used in here... only used for testing.

  (set-scenario-time <time>)
       - sets the time in the scenario to <time>
 
  (report-status <time> ?status)
       - is used to request the current ship status.  When ?status is 
         an unbound variable a report is generated with ?status 
         bound to a list of all ship systems and their current status.

eg.  (report-status 1745 ((casualties ((T3 6 2945) (T2 4 2345))) (propulsion ((auxillary OK) (engine-room (flooding partial controlled)) (main-engines (time-to-repair 4145)))) (flight-deck ((hanger NA) (helipad (time-to-repair 2000)))) (helicopters ((squirrel NA) (seahawk NA))) (sensors ((SPS-49 OK) (SPS-55 OK) (SPG-60 OK) (Sperry-Mk92 OK) (AIMS-MkXII OK) (URN-25 OK) (TMS-4530 OK) (TMS-4131 NA) (TMS-4424 NA))) (EW ((SLQ-32C OK) (EA-2118 OK) (C-Pearl OK))) (decoys ((SRBOC-Mk36 2) (Nulka 4) (SLQ-25 NA))) (weapons ((SM-1 OK) (Harpoon 8) (ESSM 8) (Torpedoes-Mk46 3) (OTO-Mk75 NA) (GDC-Mk15 NA)))))       

       - when ?status has the form (system ?sys-status) then a report
       is generated and returned about the state of the particular subsystem.

eg. (report-status 1745 (flight-deck ((hanger NA) (helipad (time-to-repair 2000)))))

       - autonomously generated status messages are also reported by the
       ship as issues using this (top) format.  

  (update-casualties <time> <casualties>)
       - is used to update the casualties onboard, where <casualties>
       has the format:
         (casualties ((T1 <number1> <before1>) (T2 <number2> <before2>) (T3 <number3> <before3>)))
       and
        <before1>, <before2>, <before3> are times to evac in elapsed
        time (minutes) since <time>. (elapsed time is used here only
        because we dont handle 24 hr rollover well - times continue to
        increase monotonically, ie.  2600 is 0200 the next day.)


  (create-medevac-plan <time> ?url)
  (create-medevac-plan <time> <casualties> ?url)
  (create-medevac-plan <time> <facilities> <helicopters> <casualties> ?url)
 
       - are all goals that can be used to invoke medevac planning,
         with ?url returned with the substituted value giving the url
         of the medevac plan generated.  Here:

         <casualties> := (casualties ((T1 <number1> <before1>) (T2 <number2> <before2>) (T3 <number3> <before3>)))
         with  <before1>, <before2>, <before3> are times to evac in
         24hr format (oh well - these are supposed to be invoked
         internally anyway :))

         <facilities>  := (medical-facilities ((<facility-id> <country> <level> <distance> <helipads> <ready>)+ ))
         <helicopters> := (helicopters ((<heli-id> <type> <current-location> <distance> <ready>)+ ))
          
         where <level> is level of medical facility
               <distance> is distance away in nautical miles
               <helipads> is number of helipads available
               <ready>    is time (in 24hr format) that facility/helicopters are ready (to depart).
               <type>     is small, med (eg. seahawk), large (eg. Stallion)
               <current-location> is symbol for current location (eg USS-H-Clinton)

       - when (create-medevac-plan <time> ?url) is invoked, the
         medevac agent searches of casualties (onboard) & resources to
         use (offboard).

       - when (create-medevac-plan <time> <casualties> ?url) is
         invoked, then it only plans for the casualties listed.

       - when (create-medevac-plan <time> <facilities> <helicopters> <casualties> ?url) 
         ia invoked, it only plans for casualties listed using
         resources provided.

       - when the scenario autonomously generates a medevac plan, it
         is transmitted as an issue using the format:

         (create-medevac-plan <time> <casualties> <url>)


Things we might send (autonomously):

  (report-status <time> <status>) as an issue - see above.

  (create-medevac-plan <time> <casualties> <url>) as an issue - see above.

  (report-available-medevac-resources <time> <level> ?facilities ?helicopters)

       - is the activity message sent out by the scenario agent to
         attempt to find medevac resources available. It waits for a
         report to be sent back with the substituted goal, where
         ?facilities and ?helicopters use the format given above. 


  (request-medical-support <time> <agent-id> <level> monitor ?mobile-id)

       - is the activity we send out to find the MMA.  We wait for the
         substituted goal to be reported back.

       - where <agent-id> is name of our agent
               <level>    is level of medical support needed
               ?mobile-id is name of MMA responding.



ATTITUDE can accept (or send) these goals using KQML or FIPA-ACL (or a
variant anyway). 

Phew, that's about all I think - have I left anything out?

Steve Wark, DSTO.  26-AUG-2002











