investigating OOPSLA benchmarks further
[IRC.git] / Robust / src / Benchmarks / mlp / directto / mlp-java / D2.java
1 // This class contains the the main method of this project. 
2 // All it does is to initialize the input and output threads
3 // and kick off the algorithm
4
5 //import java.io.*;
6
7 public class D2 {
8
9   public ReadWrite             singletonReadWrite            ; public ReadWrite             getReadWrite            () { return singletonReadWrite            ; }
10   public Static                singletonStatic               ; public Static                getStatic               () { return singletonStatic               ; }
11   public AircraftList          singletonAircraftList         ; public AircraftList          getAircraftList         () { return singletonAircraftList         ; }   
12   public Algorithm             singletonAlgorithm            ; public Algorithm             getAlgorithm            () { return singletonAlgorithm            ; }
13   public FixList               singletonFixList              ; public FixList               getFixList              () { return singletonFixList              ; }
14   public Flight                singletonFlight               ; public Flight                getFlight               () { return singletonFlight               ; }
15   public FlightList            singletonFlightList           ; public FlightList            getFlightList           () { return singletonFlightList           ; }
16   public MessageList           singletonMessageList          ; public MessageList           getMessageList          () { return singletonMessageList          ; }
17   public TrajectorySynthesizer singletonTrajectorySynthesizer; public TrajectorySynthesizer getTrajectorySynthesizer() { return singletonTrajectorySynthesizer; }
18
19   public D2() {
20     singletonReadWrite             = new ReadWrite            ();
21     singletonStatic                = new Static               ();
22     singletonAircraftList          = new AircraftList         ();
23     singletonFixList               = new FixList              ();
24     singletonAlgorithm             = new Algorithm            ();
25     singletonFlight                = new Flight               ("");
26     singletonFlightList            = new FlightList           (); 
27     singletonMessageList           = new MessageList          ();
28     singletonTrajectorySynthesizer = new TrajectorySynthesizer();
29   }
30
31   public static void main(String arg[]) {
32     System.out.println("D2 - Application started");
33
34     D2 d2 = new D2();
35     
36     d2.getReadWrite().read(d2);
37     
38     d2.getMessageList().executeAll(d2);
39     
40     while( d2.getFlightList().anyPlanesAlive() ) {
41       d2.getAlgorithm().doIteration(d2);
42     }
43
44     d2.getReadWrite().write(d2);
45
46     System.out.println("D2 - Application finished");
47   }
48 }