added smaller version of directo for something in between tiny and full tests of...
[IRC.git] / Robust / src / Benchmarks / mlp / directto / mlp-small-for-testing / 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   public ReadWrite rw;
9
10   private Static                singletonStatic               ; public Static                getStatic               () { return singletonStatic               ; }
11   private AircraftList          singletonAircraftList         ; public AircraftList          getAircraftList         () { return singletonAircraftList         ; }   
12   private Algorithm             singletonAlgorithm            ; public Algorithm             getAlgorithm            () { return singletonAlgorithm            ; }
13   private FixList               singletonFixList              ; public FixList               getFixList              () { return singletonFixList              ; }
14   private Flight                singletonFlight               ; public Flight                getFlight               () { return singletonFlight               ; }
15   private FlightList            singletonFlightList           ; public FlightList            getFlightList           () { return singletonFlightList           ; }
16   private MessageList           singletonMessageList          ; public MessageList           getMessageList          () { return singletonMessageList          ; }
17   private TrajectorySynthesizer singletonTrajectorySynthesizer; public TrajectorySynthesizer getTrajectorySynthesizer() { return singletonTrajectorySynthesizer; }
18
19   public D2() {
20     singletonStatic                = new Static               ();
21     singletonAircraftList          = new AircraftList         ();
22     singletonFixList               = new FixList              ();
23     singletonAlgorithm             = new Algorithm            ();
24     singletonFlight                = new Flight               ( "" );
25     singletonFlightList            = new FlightList           (); 
26     singletonMessageList           = new MessageList          ();
27     singletonTrajectorySynthesizer = new TrajectorySynthesizer();
28   }
29
30   public static void main(String arg[]) {
31     System.out.println("D2 - Application started");
32
33     D2 d2 = new D2();
34
35     
36     d2.rw=new ReadWrite();
37     d2.rw.read(d2);
38     
39
40     d2.getMessageList().executeAll(d2);
41     
42     int count = 0;
43     while( d2.getFlightList().anyPlanesAlive() ) {
44       d2.getAlgorithm().doIteration(d2);
45       
46       count++;
47       if( count % 10000 == 0 ) {
48         //System.out.println( "iteration "+count );
49       }
50
51       if( count == 1000 ) {
52         break;
53       }
54     }
55
56     d2.rw.write(d2);
57   }
58 }