-- with Ada.Real_Time; use Ada.Real_Time; -- with Ada.Text_IO; use Ada.Text_IO; with Exceptions; use Exceptions;
-- with Real_Type; use Real_Type; -- with Generic_Sliding_Statistics; -- with Rotations; use Rotations; -- with Vectors_3D; use Vectors_3D; with Vehicle_Interface; use Vehicle_Interface;
-- with Vehicle_Message_Type; use Vehicle_Message_Type; with Swarm_Structures; use Swarm_Structures;
package body Vehicle_Task_Type is
task body Vehicle_Task is
Vehicle_No : Positive;
begin -- You need to react to this call and provide your task_id. -- You can e.g. employ the assigned vehicle number (Vehicle_No) -- in communications with other vehicles. accept Identify (Set_Vehicle_No : Positive; Local_Task_Id : out Task_Id) do
Vehicle_No := Set_Vehicle_No;
Local_Task_Id := Current_Task; end Identify;
-- You will want to take this out, once you actually use the "Vehicle_No": pragma Unreferenced (Vehicle_No);
-- Replace the rest of this task with your own code. -- Maybe synchronizing on an external event clock like "Wait_For_Next_Physics_Update", -- yet you can synchronize on e.g. the real-time clock as well. -- Don't use busy-waiting here, as this task is not alone on the CPU. -- Without control this vehicle will go for its natural swarming instinct. select Flight_Termination.Stop; then abort
Outer_task_loop : loop Wait_For_Next_Physics_Update; -- Maybe we do something, look around, listen or talk to somebody? end loop Outer_task_loop;
end select;
exception when E : others => Show_Exception (E);
end Vehicle_Task;
end Vehicle_Task_Type;