Pass around pointer to D2 as an argument to everything, rather than stash the pointer...
authorjjenista <jjenista>
Mon, 9 Mar 2009 18:10:52 +0000 (18:10 +0000)
committerjjenista <jjenista>
Mon, 9 Mar 2009 18:10:52 +0000 (18:10 +0000)
13 files changed:
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/D2.java
Robust/src/Benchmarks/mlp/directto/mlp-java/FixList.java
Robust/src/Benchmarks/mlp/directto/mlp-java/Flight.java
Robust/src/Benchmarks/mlp/directto/mlp-java/FlightList.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/ReadWrite.java
Robust/src/Benchmarks/mlp/directto/mlp-java/Route.java
Robust/src/Benchmarks/mlp/directto/mlp-java/TrajectorySynthesizer.java
Robust/src/Benchmarks/mlp/directto/mlp-java/TrialFlight.java [deleted file]
Robust/src/Benchmarks/mlp/directto/mlp-java/makefile

index 3326ec9584388db99081819ed873411592aa5afe..90e5a74248e72f7afe0ddd5d5d43d46f381e3a65 100755 (executable)
@@ -25,6 +25,7 @@ public class AircraftList {
 
     System.out.println("Aircraft not found - "+name);
     System.exit(-1);
+    return null;
   }
 
   public int getAircraftIndex(String name) {
@@ -36,6 +37,7 @@ public class AircraftList {
 
     System.out.println("Aircraft not found - "+name);
     System.exit(-1);
+    return 0;
   }
 
   public void printInfo() {
index a969ad76040dff18be232daac9df05da33ef886e..32e712b5cc904992c443ae2df0dff3247ba303b6 100755 (executable)
@@ -2,14 +2,11 @@
 //import java.io.*;
 
 public class Algorithm {
-  private D2 d2;
-  
   public double initialTime,time;
   public double currIteration;
   public ConflictList cList;
 
-  public Algorithm( D2 d2 ) {
-    this.d2 = d2;
+  public Algorithm() {
     cList=new ConflictList();    
   }
   
@@ -18,7 +15,7 @@ public class Algorithm {
     currIteration=0;
   }
   
-  public /*static*/ boolean isConflict(Point4d p1, Point4d p2) {
+  public /*static*/ boolean isConflict(D2 d2, Point4d p1, Point4d p2) {
     Point2d pAux1=new Point2d(p1.x,p1.y);
     Point2d pAux2=new Point2d(p2.x,p2.y);
     if ( (Point2d.squaredDistance(pAux1,pAux2) <= 
@@ -31,7 +28,7 @@ public class Algorithm {
     return false;
   }
 
-  public /*static*/ Point4d findConflict(Flight a, Flight b) {
+    public /*static*/ Point4d findConflict(D2 d2, Flight a, Flight b) {
     Point4d conflictPoint=new Point4d(Point4d.outOfRangeTime(),0,0,0);
     if (a.flightID!=b.flightID) {
       Vector p1=a.traject.p;
@@ -43,7 +40,7 @@ public class Algorithm {
       while ( (pos<p1.size()) && (pos<p2.size()) && (!found) ) {
        Point4d point1=(Point4d) p1.elementAt(pos);
        Point4d point2=(Point4d) p2.elementAt(pos);
-       if (isConflict(point1,point2)) {              
+       if (isConflict(d2, point1,point2)) {          
          System.out.println(point1+" "+point2);
          found=true;
          conflictPoint=point1;
@@ -54,23 +51,23 @@ public class Algorithm {
     return conflictPoint;
   }
     
-  public /*static*/ ConflictList getConflictsWith(double time, Flight flight) {
+  public /*static*/ ConflictList getConflictsWith(D2 d2, double time, Flight flight) {
     ConflictList conflicts=new ConflictList();
 
     Vector flights=d2.getFlightList().f;
     int n,i,j;
     n=d2.getFlightList().noFlights;
 
-    d2.getTrajectorySynthesizer().updateTrajectory(time, flight);
+    d2.getTrajectorySynthesizer().updateTrajectory(d2, time, flight);
     for (i=0; i<n; i++) {
       Flight aAux=(Flight) flights.elementAt(i);
-      d2.getTrajectorySynthesizer().updateTrajectory(time, aAux);
+      d2.getTrajectorySynthesizer().updateTrajectory(d2, time, aAux);
     }
 
     Flight aux1=flight;
     for (i=0; i<n; i++) {
       Flight aux2=(Flight) flights.elementAt(i);
-      Point4d conflictPoint=findConflict(aux1,aux2);
+      Point4d conflictPoint=findConflict(d2, aux1,aux2);
       if (!(conflictPoint.outOfRange())) {
        conflicts.newConflict(conflictPoint,aux1,aux2);
       }
@@ -78,7 +75,7 @@ public class Algorithm {
     return conflicts;
   }
 
-  public /*static*/ void doIteration() {
+  public /*static*/ void doIteration(D2 d2) {
     time=initialTime+currIteration*d2.getStatic().iterationStep();
     currIteration++;
     System.out.println("In doIteration!");
@@ -92,7 +89,7 @@ public class Algorithm {
 
     for (i=0;i<n;i++) {        
       Flight aAux=(Flight) flights.elementAt(i);
-      d2.getTrajectorySynthesizer().updateTrajectory(time,aAux);
+      d2.getTrajectorySynthesizer().updateTrajectory(d2, time,aAux);
     }
     
     System.out.println("Does it get here? (after the trajectory update)");
@@ -101,7 +98,7 @@ public class Algorithm {
       for (j=i+1;j<n;j++) {
        Flight aux1=(Flight) flights.elementAt(i);
        Flight aux2=(Flight) flights.elementAt(j);
-       Point4d conflictPoint=findConflict(aux1,aux2);
+       Point4d conflictPoint=findConflict(d2, aux1,aux2);
        if (!(conflictPoint.outOfRange())) {
          cList.newConflict(conflictPoint,aux1,aux2);
        }
index 42a9257aeb7f56b76e6d477789c4d1c0a32dfec2..724f09d95430fe80ff0786cb22e0192688904c1e 100755 (executable)
@@ -20,11 +20,11 @@ public class D2 {
     singletonStatic                = new Static               ();
     singletonAircraftList         = new AircraftList         ();
     singletonFixList              = new FixList              ();
-    singletonAlgorithm            = new Algorithm            ( this );
-    singletonFlight                = new Flight               ( this, "" );
-    singletonFlightList                   = new FlightList           ( this ); 
-    singletonMessageList          = new MessageList          ( this );
-    singletonTrajectorySynthesizer = new TrajectorySynthesizer( this );
+    singletonAlgorithm            = new Algorithm            ();
+    singletonFlight                = new Flight               ( "" );
+    singletonFlightList                   = new FlightList           (); 
+    singletonMessageList          = new MessageList          ();
+    singletonTrajectorySynthesizer = new TrajectorySynthesizer();
   }
 
   public static void main(String arg[]) {
@@ -32,14 +32,14 @@ public class D2 {
 
     D2 d2 = new D2();
 
-    d2.rw=new ReadWrite( d2 );
-    d2.rw.read();
+    d2.rw=new ReadWrite();
+    d2.rw.read(d2);
 
-    d2.getMessageList().executeAll();
+    d2.getMessageList().executeAll(d2);
        
     int count = 0;
     while( d2.getFlightList().anyPlanesAlive() ) {
-      d2.getAlgorithm().doIteration();
+      d2.getAlgorithm().doIteration(d2);
       
       count++;
       if( count % 10000 == 0 ) {
@@ -51,6 +51,6 @@ public class D2 {
       }
     }
 
-    d2.rw.write();
+    d2.rw.write(d2);
   }
 }
index dd7186b46834a45ea917f3d9b49ba132229d2ae8..b2b3e7379394370049c9113a6828a3bb9d30eb78 100755 (executable)
@@ -38,6 +38,7 @@ public class FixList {
     }
     System.out.println("Fix not found - "+name);
     System.exit(-1);
+    return 0;
   }
 
   public /*static*/ Fix getFix(String name) {
@@ -48,6 +49,7 @@ public class FixList {
     }
     System.out.println("Fix not found - "+name);
     System.exit(-1);
+    return null;
   }
 
   public /*static*/ void printInfo() {
index 25529f54fac292bc7fcfc2221a620b268fd12e28..165e8253a666bc318d7e99f714a0a9f8b8833313 100755 (executable)
@@ -1,8 +1,6 @@
 // the class that describes a flight
 
 public class Flight /*implements Cloneable*/ {
-  
-  private D2 d2;
 
   public String flightID;  // the flight id
   public int trialStatus; // 
@@ -16,8 +14,7 @@ public class Flight /*implements Cloneable*/ {
   public static int realFlightStatus(){ return -1;}
   public static int trialFlightStatus(){ return 1;}  
 
-  public Flight(D2 d2, String id) {
-    this.d2=d2;
+  public Flight(String id) {
     this.flightID=id;
     this.trialStatus=realFlightStatus();
   }
@@ -38,8 +35,8 @@ public class Flight /*implements Cloneable*/ {
     fPlan=fp;
   }
     
-  public void updateTrajectory(double time) {
-    d2.getTrajectorySynthesizer().updateTrajectory(time, this);
+  public void updateTrajectory(D2 d2, double time) {
+    d2.getTrajectorySynthesizer().updateTrajectory(d2, time, this);
   }
 
   public boolean hasID (String id) {
@@ -50,8 +47,8 @@ public class Flight /*implements Cloneable*/ {
     return (flightType.compareTo(flType)==0);
   }
 
-  public static Flight copyOf( D2 d2, Flight f) {
-    Flight fNew       = disjoint flightCopy new Flight(d2, f.flightID);
+  public static Flight copyOf(Flight f) {
+    Flight fNew       = disjoint flightCopy new Flight(f.flightID);
     fNew.trialStatus  = f.trialStatus;
     fNew.aircraftType = f.aircraftType;
     fNew.track        = f.track;
index 4049d2741a5143e8c5d425211a9e30d32ebd10e6..fe484a619e9f726edb220f93e21df46a7329eae1 100755 (executable)
@@ -3,13 +3,10 @@
 //import java.util.*;
 
 public class FlightList {
-  private D2 d2;
-
   public /*static*/ int noFlights;
   public /*static*/ Vector f;
 
-  public FlightList( D2 d2 ) {
-    this.d2=d2;
+  public FlightList() {
     noFlights=0;
     f=new Vector(100);
   }
@@ -20,17 +17,17 @@ public class FlightList {
   }
   */
 
-  public /*static*/ void addFlightPlan(int time, StringTokenizer st) { 
-    Flight newFlight=disjoint flightAdd new Flight(d2, st.nextToken());
+    public /*static*/ void addFlightPlan(D2 d2, int time, StringTokenizer st) { 
+    Flight newFlight=disjoint flightAdd new Flight(st.nextToken());
     noFlights++;
     f.addElement(newFlight);
     FlightPlan fAux=new FlightPlan();
     Aircraft aAux=d2.getAircraftList().getAircraft(st.nextToken());      
     newFlight.setAircraftType(aAux);
     newFlight.setFlightType(st.nextToken());
-    Route rAux=new Route(d2, Integer.parseInt(st.nextToken()));
+    Route rAux=new Route(Integer.parseInt(st.nextToken()));
     for (int i=0;i<rAux.noFixes;i++)
-      rAux.addFix(i,st.nextToken());           
+      rAux.addFix(d2,i,st.nextToken());           
     fAux.setRoute(rAux);
     fAux.setCruiseParam(Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()));
     newFlight.setFlightPlan(fAux);
@@ -41,23 +38,23 @@ public class FlightList {
     return fAux.flightID;
   }
 
-  public /*static*/ void amendFlightPlan(int time, StringTokenizer st) {
+  public /*static*/ void amendFlightPlan(D2 d2, int time, StringTokenizer st) {
     Flight fAux=getFlight(st.nextToken());
-    Route rAux=new Route(d2, Integer.parseInt(st.nextToken()));    
+    Route rAux=new Route(Integer.parseInt(st.nextToken()));    
     for (int i=0;i<rAux.noFixes;i++)
-      rAux.addFix(i,st.nextToken());      
+      rAux.addFix(d2,i,st.nextToken());      
     fAux.fPlan.setRoute(rAux);
     fAux.fPlan.setCruiseParam(Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()));
   }
 
-  public /*static*/ void amendFlightInfo(int time, StringTokenizer st) {
+    public /*static*/ void amendFlightInfo(D2 d2, int time, StringTokenizer st) {
     Flight fAux=getFlight(st.nextToken());
     Aircraft aAux=d2.getAircraftList().getAircraft(st.nextToken());      
     fAux.setAircraftType(aAux);
     fAux.setFlightType(st.nextToken());
   }
 
-  public /*static*/ void sendingAircraft(int time, StringTokenizer st) {
+    public /*static*/ void sendingAircraft(D2 d2, int time, StringTokenizer st) {
     int noF=Integer.parseInt(st.nextToken());
     String id;
     Point4d pos;
@@ -85,7 +82,7 @@ public class FlightList {
                         fAux.flightID+
                         "; position: "+
                         fAux.track.pos);
-      d2.getTrajectorySynthesizer().updateTrajectory(time, fAux);
+      d2.getTrajectorySynthesizer().updateTrajectory(d2, time, fAux);
       fAux.traject.printInfo();      
     }
   }  
@@ -105,6 +102,7 @@ public class FlightList {
     }
     System.out.println("Flight not found - "+id);
     System.exit(-1);
+    return null;
   }
 
   public /*static*/ boolean anyPlanesAlive() {
index 9d98f6fbd26569bbc3a394bcdb183b2a02d6c564..4e2a3aebc80fec32b9fb7a9a2ea4e999a247ad2e 100755 (executable)
@@ -1,27 +1,23 @@
 //import java.util.*;
 
 public class Message {
-
-  D2 d2;
   int time;
   String type;
   StringTokenizer parameters;
 
-  public Message(D2 d2, int time, String type, StringTokenizer parameters) {
-    this.d2=d2;
+  public Message(int time, String type, StringTokenizer parameters) {
     this.time=time;
     this.type=type;
     this.parameters=parameters;
   }
 
   public Message(Message m) {
-    this.d2=m.d2;
     this.time=m.time;
     this.type=m.type;
     this.parameters=m.parameters;
   }
 
-  public void executeMessage() {
+  public void executeMessage(D2 d2) {
     System.out.println("Executing message of type "+type);
 
     //static messages
@@ -64,7 +60,7 @@ public class Message {
 
     if (type.compareTo("ADD_FLIGHT_PLAN")==0) {
       System.out.println("Adding flight plan...");
-      d2.getFlightList().addFlightPlan(time,parameters);               
+      d2.getFlightList().addFlightPlan(d2,time,parameters);            
     }
     else if (type.compareTo("REMOVE_FLIGHT_PLAN")==0) {
       System.out.println("Removing flight plan...");
@@ -72,15 +68,15 @@ public class Message {
     }
     else if (type.compareTo("AMEND_FLIGHT_INFO")==0) {
       System.out.println("Amending flight info...");
-      d2.getFlightList().amendFlightInfo(time,parameters);
+      d2.getFlightList().amendFlightInfo(d2, time,parameters);
     }              
     else if (type.compareTo("AMEND_FLIGHT_PLAN")==0) {
       System.out.println("Amending flight plan...");
-      d2.getFlightList().amendFlightPlan(time,parameters);            
+      d2.getFlightList().amendFlightPlan(d2, time,parameters);        
     }
     else if (type.compareTo("SENDING_AIRCRAFT")==0) {
       System.out.println("Sending aircraft data...");
-      d2.getFlightList().sendingAircraft(time,parameters);
+      d2.getFlightList().sendingAircraft(d2, time,parameters);
     }
   }
 }
index 826f7814855e4d1d345b283f24dc2701ef6be409..a49cb737f3243b438384eafe9d1ddba3f45634f2 100755 (executable)
@@ -2,11 +2,9 @@
 //import java.util.*;
 
 public class MessageList {
-  private D2 d2;
   private Vector messages;
     
-  public MessageList( D2 d2 ) { 
-    this.d2 = d2; 
+  public MessageList() { 
     messages=new Vector();
   }
 
@@ -25,7 +23,7 @@ public class MessageList {
   }
 
   //is true for DO_WORK
-  public boolean setMessage(String line) {     
+    public boolean setMessage(String line) {   
     if (line.equals(""))
       return false;
 
@@ -38,7 +36,7 @@ public class MessageList {
     StringTokenizer st=new StringTokenizer(line);
     int time=Integer.parseInt(st.nextToken());
     String type=st.nextToken();        
-    Message newMessage=disjoint msgs new Message(d2,time,type,st);
+    Message newMessage=disjoint msgs new Message(time,type,st);
     messages.addElement(newMessage);
     if (type.equals("DO_WORK"))
       return true;
@@ -46,10 +44,10 @@ public class MessageList {
     return false;
   }
   
-  public void executeAll() {
+  public void executeAll(D2 d2) {
     System.out.println("executeAll: we have "+messages.size()+" messages.");
     while(hasNext())
-      next().executeMessage();     
+      next().executeMessage(d2);     
     d2.getStatic().printInfo();
     d2.getFixList().printInfo();
     d2.getAircraftList().printInfo();  
index f3f67914d79a14ef0ccd9c10cca5c4df211ce4f3..f9129aaff00508e890f4e1bb11d48862b2a234c9 100755 (executable)
@@ -5,13 +5,10 @@
 //import java.util.*;
 
 public class ReadWrite {
-  D2 d2;
 
-  public ReadWrite( D2 d2 ) {
-    this.d2 = d2;
-  }
+  public ReadWrite() {}
 
-  public void read() {
+  public void read(D2 d2) {
     FileInputStream in = new FileInputStream( "input4.txt" );
 
     while(true) {
@@ -28,7 +25,7 @@ public class ReadWrite {
     System.out.println("Data set read");
   }   
 
-  public void write() {
+  public void write(D2 d2) {
     d2.getStatic().printInfo();
     d2.getFixList().printInfo();
     d2.getAircraftList().printInfo();  
index a50a81f46a4e3ad3c9b8b195d21503771ba1458c..10484c49e56e271025dc9689defc119a688f5199 100755 (executable)
@@ -5,19 +5,16 @@
 
 public class Route {
 
-  D2 d2;
   public int noFixes,current;
   public Vector fixes;
 
-  Route(D2 d2, int no) {
-    this.d2=d2;
+  Route(int no) {
     noFixes=no;
     current=0;
     fixes=new Vector(noFixes);
   }
 
-  Route(D2 d2, int no, int cur) {
-    this.d2=d2;
+  Route(int no, int cur) {
     noFixes=no;
     current=cur;
     fixes=new Vector(noFixes);
@@ -27,7 +24,7 @@ public class Route {
     fixes.insertElementAt(f, pos);
   }
 
-  public void addFix (int pos, String name) {
+  public void addFix (D2 d2, int pos, String name) {
     addFix(pos, (Fix) d2.getFixList().getFix(name) );
   }
 
index 232d6b7a6461461eb2a4e8591b501c31f8f02974..bec9ff85206e1c32e21eb05e037d1390d8ac8dcc 100755 (executable)
@@ -8,8 +8,6 @@
 
 public class TrajectorySynthesizer {
   
-  D2 d2;
-
   private /*static*/ double horizTotalDist, currentDist;
   private /*static*/ Velocity currentVelocity;
   private /*static*/ Point4d currentPos;
@@ -22,17 +20,16 @@ public class TrajectorySynthesizer {
   private /*static*/ int limit() { return 200; }
 
 
-  public TrajectorySynthesizer( D2 d2 ) {
-    this.d2 = d2;
+  public TrajectorySynthesizer() {
     timeF=0;
   }
 
-  public /*static*/ Trajectory updateTrajectory (int time, Flight flight) {
+  public /*static*/ Trajectory updateTrajectory (D2 d2, int time, Flight flight) {
     Integer nTime=new Integer(time);
-    return updateTrajectory (nTime.doubleValue(), flight);
+    return updateTrajectory (d2, nTime.doubleValue(), flight);
   }
 
-  public /*static*/ Trajectory updateTrajectory (double time, Flight flight) {
+    public /*static*/ Trajectory updateTrajectory (D2 d2, double time, Flight flight) {
     System.out.println("Updating trajectory for "+flight.flightID);
     int i;
     setInitialParameters(flight);
diff --git a/Robust/src/Benchmarks/mlp/directto/mlp-java/TrialFlight.java b/Robust/src/Benchmarks/mlp/directto/mlp-java/TrialFlight.java
deleted file mode 100755 (executable)
index f420b71..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-// trial flight class with trial planning-related methods
-
-public class TrialFlight {
-  D2 d2;
-
-  Flight oldFlight, trialFlight;
-  Route trialRoute;
-  Trajectory trialTrajectory;
-  double time;
-  Fix fix1, fix2;
-  int fixIndex;
-  // differences between the old flight and the trial flight follow:
-  double timeDiff, distDiff; // time and distance difference
-  ConflictList oldConflicts, newConflicts; // the lists of conflicts
-  int noNew, noRemoved; // the number of new and removed conflicts, respectively
-  
-  // constructor of a trial flight using a shortcut between two fixes.    
-  public TrialFlight(D2 d2, Flight flight, Fix fix1, Fix fix2) {
-    this.d2=d2;
-    int aux, fixIndex1, fixIndex2;
-    oldFlight=flight;
-    fixIndex1=oldFlight.fPlan.r.getIndexOf(fix1);
-    fixIndex2=oldFlight.fPlan.r.getIndexOf(fix2);
-    if (fixIndex1>fixIndex2) {
-      aux=fixIndex1;
-      fixIndex1=fixIndex2;
-      fixIndex2=aux;
-    }
-    trialFlight=Flight.copyOf(d2, oldFlight);
-    trialFlight.trialStatus=Flight.trialFlightStatus();
-    this.changeToTrialRoute(fixIndex1, fixIndex2);
-  }
-
-  // constructor for a trial flight using the current position of a plane
-  public TrialFlight(D2 d2, Flight flight, String fixName) {
-    this.d2=d2;
-    oldFlight=flight;    
-  }
-
-  // constructor that uses an estimated position and a fix
-  public TrialFlight(D2 d2, Flight flight, Point4d position, Fix fix) {
-    this.d2=d2;
-    int aux;
-    oldFlight=flight;
-    fixIndex=oldFlight.fPlan.r.getIndexOf(fix);
-    trialFlight=Flight.copyOf(d2, oldFlight);
-    trialFlight.trialStatus=Flight.trialFlightStatus();
-    oldFlight.updateTrajectory(position.time);
-    // assuming that the position given as parameter is the same as the first point in the trajectory
-    trialFlight.track=new Track(new Point4d(position), new Velocity(oldFlight.track.vel)); 
-    trialFlight.fPlan=new FlightPlan(oldFlight.fPlan); 
-    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);
-    trialFlight.trialStatus=-1;        
-  }
-
-  public void trajectoryDiff (double time) {
-    trialFlight.updateTrajectory(time);
-    oldFlight.updateTrajectory(time);        
-    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);
-  }
-    
-  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);
-    noNew=0;
-    for (i=0 ; i<newConflicts.noConflicts ; i++) {
-      Conflict conflict=newConflicts.conflictAt(i);
-      if (oldConflicts.findConflict(conflict.flight1, conflict.flight2)==null) {
-       noNew++;
-      }
-    }
-    noRemoved=oldConflicts.noConflicts-(newConflicts.noConflicts-noNew);
-  }
-  
-  public void changeToTrialRoute (Point4d pos, int index) {
-    int i,count, index1=0;
-    if (index>-1) {
-      trialRoute=new Route(d2, oldFlight.fPlan.r.noFixes-index);
-      trialRoute.current=0;
-      for (i=index; i<oldFlight.fPlan.r.noFixes ; i++) {
-       trialRoute.addFix(i-index, oldFlight.fPlan.r.getFixAt(i));
-      }
-      trialFlight.fPlan.r=trialRoute;
-    }
-  }
-
-  public void changeToTrialRoute (int index1, int index2) {
-    int i,count;
-    if ((index1>-1) && (index2>-1) && (index2-index1>1)) {
-      trialRoute=new Route(d2, oldFlight.fPlan.r.noFixes-
-                          (index2-index1-1));
-      trialRoute.current=index1+1;
-      for (i=0 ; i<=index1 ; i++) {
-       trialRoute.addFix(i, oldFlight.fPlan.r.getFixAt(i));
-       if (oldFlight.fPlan.r.current==i) {
-         trialRoute.current=i;
-       }
-      }
-      
-      for (i=index2; i<oldFlight.fPlan.r.noFixes ; i++) {
-       trialRoute.addFix(i-index2+index1+1,
-                         oldFlight.fPlan.r.getFixAt(i));
-       if (oldFlight.fPlan.r.current==i) {
-         trialRoute.current=i-index2+index1+1;
-       }
-      }
-      trialFlight.fPlan.r=trialRoute;
-    }
-  }
-}
index d9679373eb2229e687baab3964cb5d3be76c2a2b..6892efc2e0b637206f7c77b469f5b9b028770eeb 100644 (file)
@@ -1,7 +1,7 @@
-MAIN_CLASS=D2
+MAIN_CLASS=D2 #smalltest
 
 PROGRAM=test
-SOURCE_FILES=*.java
+SOURCE_FILES=D2.java #smalltest.java
 
 BUILDSCRIPT=~/research/Robust/src/buildscript
 BSFLAGS= -debug -nooptimize -mainclass $(MAIN_CLASS) -justanalyze -ownership -ownallocdepth 1 -ownwritedots final -ownaliasfile aliases.txt -enable-assertions