new mlp benchmark
[IRC.git] / Robust / src / Benchmarks / mlp / directto / mlp-java / Conflict.java
diff --git a/Robust/src/Benchmarks/mlp/directto/mlp-java/Conflict.java b/Robust/src/Benchmarks/mlp/directto/mlp-java/Conflict.java
new file mode 100755 (executable)
index 0000000..5b5f550
--- /dev/null
@@ -0,0 +1,24 @@
+// This class memorizes a conflict
+
+class Conflict {
+  public Point4d coordinates; // its position
+  public Flight flight1, flight2; // the two flights involved in the conflict
+
+  public Conflict(Point4d coord, Flight f1, Flight f2) {
+    coordinates=coord;
+    flight1=f1;
+    flight2=f2;
+  }
+
+  public boolean hasFlights(Flight f1, Flight f2) {
+    if ( ((flight1.flightID==f1.flightID)&&(flight2.flightID==f2.flightID))||
+        ((flight1.flightID==f2.flightID)&&(flight2.flightID==f1.flightID)) )
+      return true;    
+    return false;
+  }
+
+  public String toString() {
+    return ("Conflict at time "+coordinates.time+" position "+coordinates+" between "+
+           flight1.flightID+" and "+flight2.flightID+".");
+  }    
+}