stable mlp version
authorjjenista <jjenista>
Tue, 24 Feb 2009 19:44:59 +0000 (19:44 +0000)
committerjjenista <jjenista>
Tue, 24 Feb 2009 19:44:59 +0000 (19:44 +0000)
22 files changed:
Robust/src/Benchmarks/mlp/directto/mlp-java/Aircraft.java
Robust/src/Benchmarks/mlp/directto/mlp-java/AircraftList.java
Robust/src/Benchmarks/mlp/directto/mlp-java/Algorithm.java
Robust/src/Benchmarks/mlp/directto/mlp-java/Conflict.java
Robust/src/Benchmarks/mlp/directto/mlp-java/ConflictList.java
Robust/src/Benchmarks/mlp/directto/mlp-java/D2.java
Robust/src/Benchmarks/mlp/directto/mlp-java/Fix.java
Robust/src/Benchmarks/mlp/directto/mlp-java/FixList.java
Robust/src/Benchmarks/mlp/directto/mlp-java/FlightList.java
Robust/src/Benchmarks/mlp/directto/mlp-java/FlightPlan.java
Robust/src/Benchmarks/mlp/directto/mlp-java/Message.java
Robust/src/Benchmarks/mlp/directto/mlp-java/MessageList.java
Robust/src/Benchmarks/mlp/directto/mlp-java/Point2d.java
Robust/src/Benchmarks/mlp/directto/mlp-java/Point4d.java
Robust/src/Benchmarks/mlp/directto/mlp-java/ReadWrite.java
Robust/src/Benchmarks/mlp/directto/mlp-java/Route.java
Robust/src/Benchmarks/mlp/directto/mlp-java/Static.java
Robust/src/Benchmarks/mlp/directto/mlp-java/Track.java
Robust/src/Benchmarks/mlp/directto/mlp-java/Trajectory.java
Robust/src/Benchmarks/mlp/directto/mlp-java/TrajectorySynthesizer.java
Robust/src/Benchmarks/mlp/directto/mlp-java/TrialFlight.java
Robust/src/Benchmarks/mlp/directto/mlp-java/Velocity.java

index 66d15695fec57dc44655e5e546ef5614b4bf441c..79ce05be0b602fc6006edb401e9ed931710d30e0 100755 (executable)
@@ -1,6 +1,6 @@
 // class that implements types of aircrafts
 
-class Aircraft {    
+public class Aircraft {    
   String type;
   double maxLift, maxThrust;
 
index 2a48ca8cc7c90dc1e3b023e9359d6f837723ba18..766e391b6c297d655f09e3c6f56f2cf259918764 100755 (executable)
@@ -2,7 +2,7 @@
 
 //import java.util.*;
 
-class AircraftList {
+public class AircraftList {
   public int noAircrafts;
   private Vector aircrafts;
 
@@ -39,11 +39,11 @@ class AircraftList {
   }
 
   public void printInfo() {
-    System.out.println("\n\nThe number of aircrafts:"+noAircrafts);
-    System.out.println("The aircrafts are:");
+    //System.out.println("\n\nThe number of aircrafts:"+noAircrafts);
+    //System.out.println("The aircrafts are:");
     for( int i = 0; i < aircrafts.size(); ++i ) {
       Aircraft aAux=(Aircraft) aircrafts.elementAt(i);
-      System.out.println(aAux);
+      //System.out.println(aAux);
     }
   }
 
index e61d949ec8b3fd58fc1c2aafada65bcb6f0ade56..e8682b077ca730b6ffd7d058d01ae11d310412e8 100755 (executable)
@@ -1,16 +1,16 @@
 //import java.util.*;
 //import java.io.*;
 
-class Algorithm {
+public class Algorithm {
   private D2 d2;
   
-  public /*static*/ double initialTime,time;
-  public /*static*/ double currIteration;
-  public /*static*/ ConflictList cList;
+  public double initialTime,time;
+  public double currIteration;
+  public ConflictList cList;
 
   public Algorithm( D2 d2 ) {
     this.d2 = d2;
-    ConflictList cList=new ConflictList();
+    cList=new ConflictList();    
   }
   
   public /*static*/ void setInitialTime(double time) {
@@ -44,7 +44,7 @@ class Algorithm {
        Point4d point1=(Point4d) p1.elementAt(pos);
        Point4d point2=(Point4d) p2.elementAt(pos);
        if (isConflict(point1,point2)) {              
-         System.out.println(point1+" "+point2);
+         //System.out.println(point1+" "+point2);
          found=true;
          conflictPoint=point1;
        }
@@ -81,10 +81,11 @@ class Algorithm {
   public /*static*/ void doIteration() {
     time=initialTime+currIteration*d2.getStatic().iterationStep();
     currIteration++;
-    System.out.println("In doIteration!");
-    System.out.println("Time:"+time);
+    //System.out.println("In doIteration!");
+    //System.out.println("Time:"+time);
     
     cList.clear();
+    
     Vector flights=d2.getFlightList().f;
     int n=d2.getFlightList().noFlights;
     int i,j;
@@ -94,7 +95,7 @@ class Algorithm {
       d2.getTrajectorySynthesizer().updateTrajectory(time,aAux);
     }
     
-    System.out.println("Does it get here? (after the trajectory update)");
+    //System.out.println("Does it get here? (after the trajectory update)");
 
     for (i=0;i<n;i++)
       for (j=i+1;j<n;j++) {
index 5b5f55073d14ca3e21dc1297df50453885d25eec..e257db6c7c1a8e3d85cdf64ac01c116f7c9109e2 100755 (executable)
@@ -1,6 +1,6 @@
 // This class memorizes a conflict
 
-class Conflict {
+public class Conflict {
   public Point4d coordinates; // its position
   public Flight flight1, flight2; // the two flights involved in the conflict
 
index 041d3c0f6e670833fc59fd2d4e8a9daeabaf5de4..9a8ec7dd5ae2c1171a2f1c1d070bd4b1623f7ebc 100755 (executable)
@@ -4,7 +4,7 @@
 
 //import java.util.*;
 
-/*final*/ class ConflictList 
+public class ConflictList 
 {   
   public int noConflicts; // the number of conflicts
   private Vector conflicts; // the conflicts
@@ -16,7 +16,7 @@
     
   public void clear() {                
     noConflicts=0;
-    conflicts.clear();      
+    conflicts.clear();
   }
 
   public Conflict conflictAt(int index) {
index 2992022f76bd645a60a20ce7bdc5f2653a472653..531cbe32e578f399c4268236fcf9af5e2a988084 100755 (executable)
@@ -4,23 +4,23 @@
 
 //import java.io.*;
 
-class D2 {
+public class D2 {
   public ReadWrite rw;
 
   private Static                singletonStatic               ; public Static                getStatic               () { return singletonStatic               ; }
-  private AircraftList         singletonAircraftList         ; public AircraftList          getAircraftList         () { return singletonAircraftList   ; }   
-  private Algorithm            singletonAlgorithm            ; public Algorithm             getAlgorithm            () { return singletonAlgorithm              ; }
-  private FixList              singletonFixList              ; public FixList               getFixList              () { return singletonFixList                ; }
-  private Flight               singletonFlight               ; public Flight                getFlight               () { return singletonFlight                 ; }
-  private FlightList           singletonFlightList           ; public FlightList            getFlightList           () { return singletonFlightList             ; }
-  private MessageList          singletonMessageList          ; public MessageList           getMessageList          () { return singletonMessageList            ; }
+  private AircraftList         singletonAircraftList         ; public AircraftList          getAircraftList         () { return singletonAircraftList         ; }   
+  private Algorithm            singletonAlgorithm            ; public Algorithm             getAlgorithm            () { return singletonAlgorithm            ; }
+  private FixList              singletonFixList              ; public FixList               getFixList              () { return singletonFixList              ; }
+  private Flight               singletonFlight               ; public Flight                getFlight               () { return singletonFlight               ; }
+  private FlightList           singletonFlightList           ; public FlightList            getFlightList           () { return singletonFlightList           ; }
+  private MessageList          singletonMessageList          ; public MessageList           getMessageList          () { return singletonMessageList          ; }
   private TrajectorySynthesizer singletonTrajectorySynthesizer; public TrajectorySynthesizer getTrajectorySynthesizer() { return singletonTrajectorySynthesizer; }
 
   public D2() {
     singletonStatic                = new Static               ();
     singletonAircraftList         = new AircraftList         ();
     singletonFixList              = new FixList              ();
-    singletonAlgorithm            = new Algorithm            ( this ); 
+    singletonAlgorithm            = new Algorithm            ( this );
     singletonFlight                = new Flight               ( this, "" );
     singletonFlightList                   = new FlightList           ( this ); 
     singletonMessageList          = new MessageList          ( this );
@@ -28,8 +28,6 @@ class D2 {
   }
 
   public static void main(String arg[]) {
-    System.out.println("D2 - Application started");
-
     D2 d2 = new D2();
 
     d2.rw=new ReadWrite( d2 );
@@ -37,8 +35,18 @@ class D2 {
 
     d2.getMessageList().executeAll();
        
+    int count = 0;
     while( d2.getFlightList().anyPlanesAlive() ) {
       d2.getAlgorithm().doIteration();
+      
+      count++;
+      if( count % 10000 == 0 ) {
+       System.out.println( "iteration "+count );
+      }
+
+      if( count == 40000 ) {
+       break;
+      }
     }
 
     d2.rw.write();
index 71cc210379cfceccd47585d01141b741ef38d056..f5533e18889e80e6b58522a29f751d38608c68e1 100755 (executable)
@@ -1,6 +1,6 @@
 // this class stores the properties of a fix
 
-class Fix {
+public class Fix {
   private String name;
   private Point2d p;
 
index 23ec5f99d692e2515494370f79df787ce046965c..5c324656b4279b69bfe9f4702fc31cef35e5f5d4 100755 (executable)
@@ -4,7 +4,7 @@
 
 //import java.util.*;
 
-class FixList {
+public class FixList {
   
   public /*static*/ int noFixes() { return _noFixes; }
   public /*static*/ Vector fixes() { return _fixes; }
@@ -51,11 +51,11 @@ class FixList {
   }
 
   public /*static*/ void printInfo() {
-    System.out.println("\n\nThe number of fixes:"+_noFixes);
-    System.out.println("The fixes are:");
+    //System.out.println("\n\nThe number of fixes:"+_noFixes);
+    //System.out.println("The fixes are:");
     for( int i = 0; i < _fixes.size(); ++i ) {
       Fix bAux=(Fix) _fixes.elementAt( i );
-      System.out.println(bAux);
+      //System.out.println(bAux);
     }
   }
 
index 50815a42f806d88e0bb03ed39b0cb721a8a70d22..b3b5caf6dc42cb1f7c114de3fbb1ae90b2d4e923 100755 (executable)
@@ -2,7 +2,7 @@
 
 //import java.util.*;
 
-class FlightList {
+public class FlightList {
   private D2 d2;
 
   public /*static*/ int noFlights;
@@ -77,14 +77,14 @@ class FlightList {
       t=new Track(pos, vel);
       nameFix=st.nextToken();
       fAux=getFlight(id);
-      System.out.println(id+" Flight id: "+fAux.flightID);
+      //System.out.println(id+" Flight id: "+fAux.flightID);
       fAux.setTrack(t);
-      System.out.println("Setting current fix ...");
+      //System.out.println("Setting current fix ...");
       fAux.fPlan.setCurrentFix(nameFix);
-      System.out.println("Sent flight "+
-                        fAux.flightID+
-                        "; position: "+
-                        fAux.track.pos);
+      //System.out.println("Sent flight "+
+      //fAux.flightID+
+      //                "; position: "+
+      //                fAux.track.pos);
       d2.getTrajectorySynthesizer().updateTrajectory(time, fAux);
       fAux.traject.printInfo();      
     }
@@ -119,11 +119,11 @@ class FlightList {
   }
 
   public /*static*/ void printInfo() {
-    System.out.println("\n\nThe number of flights:"+noFlights);
-    System.out.println("The flights are:");
+    //System.out.println("\n\nThe number of flights:"+noFlights);
+    //System.out.println("The flights are:");
     for( int i = 0; i < f.size(); ++i ) {
       Flight fAux=(Flight) f.elementAt(i);
-      System.out.println(fAux);
+      //System.out.println(fAux);
     }
   }
 }
index 5d707faafc2b55136adcc6a8fda8a7c2fc1e8dff..1deabb25adcd5940bb149e81f0a8e11eda924ecc 100755 (executable)
@@ -1,6 +1,6 @@
 // this class implements a flight plan
 
-class FlightPlan {
+public class FlightPlan {
   public double cruiseAlt, cruiseSpeed; // cruising altitude and speed
 
   public Route r; // the route (given by fixes)
@@ -25,7 +25,7 @@ class FlightPlan {
 
   public void setCurrentFix(String nameFix) {
     int i=r.getIndexOf(nameFix);
-    System.out.println("name of the fix: "+nameFix+" index:"+i);
+    //System.out.println("name of the fix: "+nameFix+" index:"+i);
     r.setCurrent(i);
   }    
 }
index 7f107a22f416821b107f72a430f69fdcdaf0c73c..d2958c07d2f5d35eb192dcde07996ce3c6c48039 100755 (executable)
@@ -1,6 +1,6 @@
 //import java.util.*;
 
-class Message {
+public class Message {
 
   D2 d2;
   int time;
@@ -22,38 +22,39 @@ class Message {
   }
 
   public void executeMessage() {
-    System.out.println("Executing message of type "+type);
+    //System.out.println("Executing message of type "+type);
+
     //static messages
     if (type.compareTo("SET_MAP_SIZE")==0) {
-      System.out.println("Setting the map size...");
+      //System.out.println("Setting the map size...");
       d2.getStatic().setMapSize(parameters);
     }
     else if (type.compareTo("SET_ITERATION_STEP")==0) {
-      System.out.println("Setting the iteration step...");
+      //System.out.println("Setting the iteration step...");
       d2.getStatic().setIterationStep(parameters);             
     }
     else if (type.compareTo("SET_NO_OF_ITERATIONS")==0) {
-      System.out.println("Setting the no. of iterations...");
+      //System.out.println("Setting the no. of iterations...");
       d2.getStatic().setNumberOfIterations(parameters);                
     }
     else if (type.compareTo("SET_CYLINDER")==0) {
-      System.out.println("Setting the cylinder of safety/unsafety...");
+      //System.out.println("Setting the cylinder of safety/unsafety...");
       d2.getStatic().setCylinder(parameters);          
     }
     else if (type.compareTo("ADD_FIX")==0) {
-      System.out.println("Adding a new fix...");
+      //System.out.println("Adding a new fix...");
       d2.getFixList().addFix(parameters);
     }
     else if (type.compareTo("REMOVE_FIX")==0) {
-      System.out.println("Removing a fix...");
+      //System.out.println("Removing a fix...");
       d2.getFixList().removeFix(parameters);
     }
     else if (type.compareTo("ADD_AIRCRAFT")==0) {
-      System.out.println("Adding an aircraft...");
+      //System.out.println("Adding an aircraft...");
       d2.getAircraftList().addAircraft(parameters);
     }
     else if (type.compareTo("REMOVE_AIRCRAFT")==0) {
-      System.out.println("Removing an aircraft...");
+      //System.out.println("Removing an aircraft...");
       d2.getAircraftList().removeAircraft(parameters);
     }
 
@@ -62,23 +63,23 @@ class Message {
       d2.getAlgorithm().setInitialTime(time);
 
     if (type.compareTo("ADD_FLIGHT_PLAN")==0) {
-      System.out.println("Adding flight plan...");
+      //System.out.println("Adding flight plan...");
       d2.getFlightList().addFlightPlan(time,parameters);               
     }
     else if (type.compareTo("REMOVE_FLIGHT_PLAN")==0) {
-      System.out.println("Removing flight plan...");
+      //System.out.println("Removing flight plan...");
       d2.getFlightList().removeFlightPlan(time,parameters);            
     }
     else if (type.compareTo("AMEND_FLIGHT_INFO")==0) {
-      System.out.println("Amending flight info...");
+      //System.out.println("Amending flight info...");
       d2.getFlightList().amendFlightInfo(time,parameters);
     }              
     else if (type.compareTo("AMEND_FLIGHT_PLAN")==0) {
-      System.out.println("Amending flight plan...");
+      //System.out.println("Amending flight plan...");
       d2.getFlightList().amendFlightPlan(time,parameters);            
     }
     else if (type.compareTo("SENDING_AIRCRAFT")==0) {
-      System.out.println("Sending aircraft data...");
+      //System.out.println("Sending aircraft data...");
       d2.getFlightList().sendingAircraft(time,parameters);
     }
   }
index 9554d03185da74d940c0d07f30fc8fc48f16eed9..41bb5c929e1a5a7428ecb8c7bb56811b84243a52 100755 (executable)
@@ -1,7 +1,7 @@
 //import java.io.*;
 //import java.util.*;
 
-class MessageList {
+public class MessageList {
   private D2 d2;
   private Vector messages;
     
@@ -29,7 +29,7 @@ class MessageList {
     if (line.equals(""))
       return false;
 
-    System.out.println("I'm reading line "+line);       
+    //System.out.println("I'm reading line "+line);       
 
     // treating comments
     if ((line.charAt(0)=='/')&&(line.charAt(1)=='/'))
@@ -47,13 +47,13 @@ class MessageList {
   }
   
   public void executeAll() {
-    System.out.println("executeAll: we have "+messages.size()+" messages.");
+    //System.out.println("executeAll: we have "+messages.size()+" messages.");
     while(hasNext())
       next().executeMessage();     
     d2.getStatic().printInfo();
     d2.getFixList().printInfo();
     d2.getAircraftList().printInfo();  
     d2.getFlightList().printInfo();
-    System.out.println("Messages executed\n\n\n\n\n");
+    //System.out.println("Messages executed\n\n\n\n\n");
   }
 }
index f32c7321125f80878d06b9d496e43b2369934300..ec6765a30d2fb4f99ffa328ddd25334f9851f2cc 100755 (executable)
@@ -1,6 +1,6 @@
 // a 2d point - used for fixes
 
-class Point2d {
+public class Point2d {
   public double x,y;
 
   public Point2d () {
index 685a43e136d73ff3bd3f59b238bbef560f9fe1b7..003bda58bb4d1dae6d90adef6d89369bd47908dd 100755 (executable)
@@ -2,7 +2,7 @@
 
 //import java.text.*;
 
-class Point4d extends Point2d {
+public class Point4d extends Point2d {
   public double x,y,z,time;
 
   public static int outOfRangeTime() { return -1; }
index 4c901b31a9d8b275fcfcacc416c631366ee3a410..eea84aad61575bd825f87622b2fe4aedc99cddad 100755 (executable)
@@ -4,7 +4,7 @@
 //import java.io.*;
 //import java.util.*;
 
-class ReadWrite {
+public class ReadWrite {
   D2 d2;
 
   public ReadWrite( D2 d2 ) {
@@ -12,7 +12,7 @@ class ReadWrite {
   }
 
   public void read() {
-    FileInputStream in = new FileInputStream( "input.txt" );
+    FileInputStream in = new FileInputStream( "input4.txt" );
 
     while(true) {
       String line=in.readLine();
@@ -24,7 +24,7 @@ class ReadWrite {
        break;
     }
 
-    System.out.println("Input data read.");
+    //System.out.println("Input data read.");
   }   
 
   public void write() {
index 3540f761157b7c545dd6dd70bbc96e93ad8e7378..a50a81f46a4e3ad3c9b8b195d21503771ba1458c 100755 (executable)
@@ -3,7 +3,7 @@
 
 //import java.util.*;
 
-class Route {
+public class Route {
 
   D2 d2;
   public int noFixes,current;
index e1f38eacdb05773f6d78e9b6d17043ad96450e9c..af96431fe830b677943b864f4e63f72c2857a1d6 100755 (executable)
@@ -1,10 +1,8 @@
-
 // This class memorizes the static data (besides fixes)
 
-
 //import java.util.*;
 
-class Static {
+public class Static {
 
   public /*static*/ double _width, _height; // the dimensions of the given area 
   public /*static*/ double _iterationStep, _noIterations;    
@@ -39,10 +37,10 @@ class Static {
 
   // this is a test procedure
   public /*static*/ void printInfo() {
-    System.out.println("\n\nStatic Data:");
-    System.out.println("Width:"+_width+"        Height:"+_height);
-    System.out.println("Radius of safety/unsafety:"+_radius);
-    System.out.println("Distance of safety/unsafety:"+_distance);
-    System.out.println("Iteration step:"+_iterationStep+"     No. of Iterations:"+_noIterations);                        
+    //System.out.println("\n\nStatic Data:");
+    //System.out.println("Width:"+_width+"        Height:"+_height);
+    //System.out.println("Radius of safety/unsafety:"+_radius);
+    //System.out.println("Distance of safety/unsafety:"+_distance);
+    //System.out.println("Iteration step:"+_iterationStep+"     No. of Iterations:"+_noIterations);                      
   }  
 }
index 04f9c16fb6b54ba1354a43516b65b67f731da88f..23642cfc96bdc9ebeaa14267edba8a61d2c1469e 100755 (executable)
@@ -1,6 +1,6 @@
 // the data about a plane - current position and velocity
 
-class Track {
+public class Track {
   Point4d pos;
   Velocity vel;
 
@@ -18,6 +18,6 @@ class Track {
   }
   
   public void printInfo() {
-    System.out.println("track: "+pos+"||"+vel);
+    //System.out.println("track: "+pos+"||"+vel);
   }
 }
index 968e1ad53eb7697cd731b4dee8a791afc061caed..e2a25e165ff7f1ba490ebd14434f57bcedc64188 100755 (executable)
@@ -2,7 +2,7 @@
 
 //import java.util.*;
 
-class Trajectory {
+public class Trajectory {
 
   public int noPoints;  // the number of points in the trajectory
   private int current;
@@ -52,9 +52,9 @@ class Trajectory {
   }
 
   public void printInfo() {
-    System.out.println("New trajectory: ");
+    //System.out.println("New trajectory: ");
     for (int i=0 ; i<noPoints ; i++) {
-      System.out.println(getPointAt(i));
+      //System.out.println(getPointAt(i));
     }    
   }  
 }
index 232d6b7a6461461eb2a4e8591b501c31f8f02974..753e0ead5c236c77533b93da46f8a4b5c9352120 100755 (executable)
@@ -33,10 +33,10 @@ public class TrajectorySynthesizer {
   }
 
   public /*static*/ Trajectory updateTrajectory (double time, Flight flight) {
-    System.out.println("Updating trajectory for "+flight.flightID);
+    //System.out.println("Updating trajectory for "+flight.flightID);
     int i;
     setInitialParameters(flight);
-    System.out.println("Starting position: "+currentPos);
+    //System.out.println("Starting position: "+currentPos);
     if (currentPos.outOfRange()) {
       traject.setNoPoints(1);
       traject.setPoint(0, currentPos);
@@ -47,7 +47,7 @@ public class TrajectorySynthesizer {
       for (i=0 ; (!currentPos.outOfRange()) && (i<limit()) ; i++) {
        getTrajectoryPoint(flight, time+i*d2.getStatic().iterationStep());
        if (i==0) {
-         System.out.println("current position: "+currentPos);
+         //System.out.println("current position: "+currentPos);
          traject.distToDest=horizTotalDist;
          traject.nextFixIndex=nextFix;
          traject.nextFix=(currentPos.outOfRange())? null : flight.fPlan.r.getFixAt(nextFix);
@@ -58,12 +58,12 @@ public class TrajectorySynthesizer {
        traject.setPoint(i, (Point4d) currentPos);
       }
       traject.setNoPoints(--i);
-      System.out.println(traject.noPoints);
+      //System.out.println(traject.noPoints);
       traject.timeToDest=(i>0)? traject.getPointAt(i-1).time+timeF:time+timeF;
     }
 
     flight.traject=traject;
-    System.out.println("Finished updating trajectory ...");
+    //System.out.println("Finished updating trajectory ...");
     return traject;
   }
 
@@ -160,7 +160,7 @@ public class TrajectorySynthesizer {
     if ((distance>horizTotalDist)&&(horizTotalDist>0)) {
       timeF=(accel<=0)?(horizTotalDist/hSpeed):
        (-hSpeed+Math.sqrt(hSpeed*hSpeed+2*accel*horizTotalDist))/accel;
-      System.out.println("TIMEF= "+timeF);
+      //System.out.println("TIMEF= "+timeF);
     }
 
     horizTotalDist-=distance;
index f420b71f93a166c1b1714874d4cd04b4c767c2b3..409773d967d53ca16f142882cb9f278a59feb0f0 100755 (executable)
@@ -52,33 +52,33 @@ public class TrialFlight {
     changeToTrialRoute(position, fixIndex);
     trajectoryDiff(position.time);
     conflictsDiff(position.time);
-    System.out.println("old route:"+oldFlight.fPlan.r);
-    System.out.println("new route:"+trialFlight.fPlan.r);
+    //System.out.println("old route:"+oldFlight.fPlan.r);
+    //System.out.println("new route:"+trialFlight.fPlan.r);
     trialFlight.trialStatus=-1;        
   }
 
   public void trajectoryDiff (double time) {
     trialFlight.updateTrajectory(time);
     oldFlight.updateTrajectory(time);        
-    System.out.println("Flight "+trialFlight.flightID+":");
+    //System.out.println("Flight "+trialFlight.flightID+":");
     distDiff=oldFlight.traject.distanceToDestination()-
       trialFlight.traject.distanceToDestination();
     timeDiff=oldFlight.traject.timeToDestination(time)-
       trialFlight.traject.timeToDestination(time);
     if (timeDiff<0) { timeDiff=0; }
-    System.out.println("Time difference: "+timeDiff);
-    System.out.println("Distance difference: "+distDiff);
+    //System.out.println("Time difference: "+timeDiff);
+    //System.out.println("Distance difference: "+distDiff);
   }
     
   public void conflictsDiff(double time) {
     int i, j;
     oldConflicts=d2.getAlgorithm().getConflictsWith(time,oldFlight);
     newConflicts=d2.getAlgorithm().getConflictsWith(time,trialFlight);
-    System.out.println("Flight "+trialFlight.flightID+":");
-    System.out.println("Conflicts for the old flight:");
-    System.out.println(oldConflicts);
-    System.out.println("Conflicts for the trial flight:");
-    System.out.println(newConflicts);
+    //System.out.println("Flight "+trialFlight.flightID+":");
+    //System.out.println("Conflicts for the old flight:");
+    //System.out.println(oldConflicts);
+    //System.out.println("Conflicts for the trial flight:");
+    //System.out.println(newConflicts);
     noNew=0;
     for (i=0 ; i<newConflicts.noConflicts ; i++) {
       Conflict conflict=newConflicts.conflictAt(i);
index 96081ed3a8e4a53f3c78eba2fe44b56bfacd59d6..c4513c07c0d29b78ab03d1ab302f43b9ab1dc488 100755 (executable)
@@ -2,7 +2,7 @@
 
 //import java.lang.*;
 
-class Velocity {
+public class Velocity {
 
   public Point4d vector;
   public double speed;