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
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; }
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();
29 public static void main(String arg[]) {
30 System.out.println("D2 - Application started");
34 d2.getReadWrite().read(d2);
36 d2.getMessageList().executeAll(d2);
38 while( d2.getFlightList().anyPlanesAlive() ) {
39 d2.getAlgorithm().doIteration(d2);
42 d2.getReadWrite().write(d2);
44 System.out.println("D2 - Application finished");