add support for [olc=0] predicate
authoradam <adam@megacz.com>
Sun, 7 Sep 2008 03:12:32 +0000 (04:12 +0100)
committeradam <adam@megacz.com>
Sun, 7 Sep 2008 03:12:32 +0000 (04:12 +0100)
src/edu/berkeley/fleet/two/FleetTwoFleet.java

index 2b7a9cd..5e75d96 100644 (file)
@@ -132,8 +132,8 @@ public abstract class FleetTwoFleet extends Fleet {
 
         Predicate predicate = Default;
         if (P_ALWAYS.get(inst)) predicate = IgnoreOLC;
-        if (P_OLC_ZERO.get(inst))    throw new RuntimeException("not yet supported");
         if (P_OLC_NONZERO.get(inst))    predicate = Default;
+        if (P_OLC_ZERO.get(inst))    predicate = OLCZero;
         if (P_A.get(inst))      predicate = FlagA;
         if (P_B.get(inst))      predicate = FlagB;
         if (P_NOT_A.get(inst))  predicate = NotFlagA;
@@ -206,11 +206,13 @@ public abstract class FleetTwoFleet extends Fleet {
         if (!pi.looping) instr = OS.set(instr);
         switch(pi.predicate) {
             case IgnoreOLC:         instr = P_ALWAYS.set(instr); break;
+            case OLCZero:         instr = P_OLC_ZERO.set(instr); break;
             case Default: instr = P_OLC_NONZERO.set(instr); break;
             case FlagA:      instr = P_A.set(instr);      break;
             case FlagB:      instr = P_B.set(instr);      break;
             case NotFlagA:  instr = P_NOT_A.set(instr);      break;
             case NotFlagB:  instr = P_NOT_B.set(instr);      break;
+            default: throw new RuntimeException("error!");
         }
 
         if (d instanceof Tail) {