1. --  with Ada.Real_Time;              use Ada.Real_Time; 
  2. --  with Ada.Text_IO;                use Ada.Text_IO; 
  3. with Exceptions;                 use Exceptions; 
  4. --  with Real_Type;                  use Real_Type; 
  5. --  with Generic_Sliding_Statistics; 
  6. --  with Rotations;                  use Rotations; 
  7. --  with Vectors_3D;                 use Vectors_3D; 
  8. with Vehicle_Interface;          use Vehicle_Interface; 
  9. --  with Vehicle_Message_Type;       use Vehicle_Message_Type; 
  10. with Swarm_Structures; use Swarm_Structures; 
  11.  
  12. package body Vehicle_Task_Type is 
  13.  
  14.    task body Vehicle_Task is 
  15.  
  16.       Vehicle_No : Positive; 
  17.  
  18.    begin 
  19.  
  20.       -- You need to react to this call and provide your task_id. 
  21.       -- You can e.g. employ the assigned vehicle number (Vehicle_No) 
  22.       -- in communications with other vehicles. 
  23.  
  24.       accept Identify (Set_Vehicle_No : Positive; Local_Task_Id : out Task_Id) do 
  25.          Vehicle_No     := Set_Vehicle_No; 
  26.          Local_Task_Id  := Current_Task; 
  27.       end Identify; 
  28.  
  29.       -- You will want to take this out, once you actually use the "Vehicle_No": 
  30.       pragma Unreferenced (Vehicle_No); 
  31.  
  32.       -- Replace the rest of this task with your own code. 
  33.       -- Maybe synchronizing on an external event clock like "Wait_For_Next_Physics_Update", 
  34.       -- yet you can synchronize on e.g. the real-time clock as well. 
  35.       -- Don't use busy-waiting here, as this task is not alone on the CPU. 
  36.  
  37.       -- Without control this vehicle will go for its natural swarming instinct. 
  38.  
  39.       select 
  40.  
  41.          Flight_Termination.Stop; 
  42.  
  43.       then abort 
  44.  
  45.          Outer_task_loop : loop 
  46.  
  47.             Wait_For_Next_Physics_Update; 
  48.  
  49.             -- Maybe we do something, look around, listen or talk to somebody? 
  50.  
  51.          end loop Outer_task_loop; 
  52.  
  53.       end select; 
  54.  
  55.    exception 
  56.       when E : others => Show_Exception (E); 
  57.  
  58.    end Vehicle_Task; 
  59.  
  60. end Vehicle_Task_Type;