experimenting with directto benchmark
[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 MessageList           singletonMessageList          ; public MessageList           getMessageList          () { return singletonMessageList          ; }
11   public Static                singletonStatic               ; public Static                getStatic               () { return singletonStatic               ; }
12   public AircraftList          singletonAircraftList         ; public AircraftList          getAircraftList         () { return singletonAircraftList         ; }   
13   public FlightList            singletonFlightList           ; public FlightList            getFlightList           () { return singletonFlightList           ; }
14   public FixList               singletonFixList              ; public FixList               getFixList              () { return singletonFixList              ; }
15   public Algorithm             singletonAlgorithm            ; public Algorithm             getAlgorithm            () { return singletonAlgorithm            ; }
16   public TrajectorySynthesizer singletonTrajectorySynthesizer; public TrajectorySynthesizer getTrajectorySynthesizer() { return singletonTrajectorySynthesizer; }
17
18   public D2() {
19     singletonReadWrite             = disjoint rw new ReadWrite            ();
20     singletonMessageList           = disjoint ml new MessageList          ();
21     singletonStatic                = disjoint st new Static               ();
22     singletonAircraftList          = disjoint al new AircraftList         ();
23     singletonFlightList            = disjoint fl new FlightList           (); 
24     singletonFixList               = disjoint xl new FixList              ();
25     singletonAlgorithm             = disjoint ag new Algorithm            ();
26     singletonTrajectorySynthesizer = disjoint ts new TrajectorySynthesizer();
27   }
28
29   public static void main(String arg[]) {
30     System.out.println("D2 - Application started");
31
32     D2 d2 = new D2();
33     
34     d2.getReadWrite().read(d2);
35     
36     d2.getMessageList().executeAll(d2);
37     
38     while( d2.getFlightList().anyPlanesAlive() ) {
39       d2.getAlgorithm().doIteration(d2);
40     }
41
42     d2.getReadWrite().write(d2);
43
44     System.out.println("D2 - Application finished");
45   }
46 }