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