move InterpreterDestination serial number into the Interpreter class
[fleet.git] / src / edu / berkeley / fleet / interpreter / Interpreter.java
index 438855b..752ac72 100644 (file)
@@ -11,6 +11,9 @@ import edu.berkeley.fleet.util.*;
 
 public class Interpreter extends FleetTwoFleet implements Parser.FleetWithDynamicShips {
 
+    /** used to allocate serial numbers; see InterpreterDestination for further detail */
+    int maxAllocatedDestinationSerialNumber = 0;
+
     private InterpreterShip debugShip = null;
     private BlockingQueue<BitVector> debugStream = new LinkedBlockingQueue<BitVector>();
     private HashMap<String,InterpreterShip> ships = new HashMap<String,InterpreterShip>();
@@ -77,7 +80,7 @@ public class Interpreter extends FleetTwoFleet implements Parser.FleetWithDynami
     // Instruction Encoding /////////////////////////////////////////////////////////////////////////
 
     public BitVector getDestAddr(Path path) {
-        long ret = ((InterpreterDestination)path.getDestination()).addr;
+        long ret = ((InterpreterDestination)path.getDestination()).getSerialNumber();
         BitVector sig = path.getSignal();
         BitVector bv = new BitVector(DISPATCH_PATH.valmaskwidth+1);
         bv.set(ret);