1. -- 
  2. -- Jan & Uwe R. Zimmer, Australia, 2013 
  3. -- 
  4.  
  5. with Real_Type;          use Real_Type; 
  6. with Generic_Protected;                            pragma Elaborate_All (Generic_Protected); 
  7. with Graphics_Structures; use Graphics_Structures; 
  8. with Vectors_3D;          use Vectors_3D; 
  9.  
  10. package Swarm_Structures_Base is 
  11.  
  12.    subtype Distances  is Real; 
  13.    subtype Acc_Scalar is Real; 
  14.  
  15.    subtype Positions     is Point_3D; 
  16.    subtype Velocities    is Vector_3D; 
  17.    subtype Accelerations is Vector_3D; 
  18.  
  19.    subtype Swarm_Element_Index is Positive; 
  20.    subtype Throttle_T          is Real range 0.0 .. 1.0; 
  21.  
  22.    Idle_Throttle : constant Throttle_T := 0.0; 
  23.    Full_Throttle : constant Throttle_T := 1.0; 
  24.  
  25.    type Vehicle_Charges is new Real range 0.0 .. 1.0; 
  26.  
  27.    Empty_Charge : constant Vehicle_Charges := 0.0; 
  28.    Half_Charge  : constant Vehicle_Charges := 0.5; 
  29.    Full_Charge  : constant Vehicle_Charges := 1.0; 
  30.  
  31.    type Energy_Globe is record 
  32.       Position : Positions; 
  33.       Velocity : Velocities; -- in delta-position per second 
  34.    end record; 
  35.  
  36.    type Energy_Globes is array (Positive range <>) of Energy_Globe; 
  37.  
  38.    package Protected_Point_3D  is new Generic_Protected (Point_3D,  Zero_Vector_3D); 
  39.    package Protected_Vector_3D is new Generic_Protected (Vector_3D, Zero_Vector_3D); 
  40.  
  41.    type Energy_Globe_Protected is record 
  42.       Position : Protected_Point_3D.Monitor_Ptr; 
  43.       Velocity : Protected_Vector_3D.Monitor_Ptr; 
  44.    end record; 
  45.  
  46.    type Energy_Globes_Protected is array (Positive range <>) of Energy_Globe_Protected; 
  47.  
  48. end Swarm_Structures_Base;