Pass around pointer to D2 as an argument to everything, rather than stash the pointer...
[IRC.git] / Robust / src / Benchmarks / mlp / directto / mlp-java / D2.java
index 42a9257aeb7f56b76e6d477789c4d1c0a32dfec2..724f09d95430fe80ff0786cb22e0192688904c1e 100755 (executable)
@@ -20,11 +20,11 @@ public class D2 {
     singletonStatic                = new Static               ();
     singletonAircraftList         = new AircraftList         ();
     singletonFixList              = new FixList              ();
-    singletonAlgorithm            = new Algorithm            ( this );
-    singletonFlight                = new Flight               ( this, "" );
-    singletonFlightList                   = new FlightList           ( this ); 
-    singletonMessageList          = new MessageList          ( this );
-    singletonTrajectorySynthesizer = new TrajectorySynthesizer( this );
+    singletonAlgorithm            = new Algorithm            ();
+    singletonFlight                = new Flight               ( "" );
+    singletonFlightList                   = new FlightList           (); 
+    singletonMessageList          = new MessageList          ();
+    singletonTrajectorySynthesizer = new TrajectorySynthesizer();
   }
 
   public static void main(String arg[]) {
@@ -32,14 +32,14 @@ public class D2 {
 
     D2 d2 = new D2();
 
-    d2.rw=new ReadWrite( d2 );
-    d2.rw.read();
+    d2.rw=new ReadWrite();
+    d2.rw.read(d2);
 
-    d2.getMessageList().executeAll();
+    d2.getMessageList().executeAll(d2);
        
     int count = 0;
     while( d2.getFlightList().anyPlanesAlive() ) {
-      d2.getAlgorithm().doIteration();
+      d2.getAlgorithm().doIteration(d2);
       
       count++;
       if( count % 10000 == 0 ) {
@@ -51,6 +51,6 @@ public class D2 {
       }
     }
 
-    d2.rw.write();
+    d2.rw.write(d2);
   }
 }