fix javadoc generation
[sbp.git] / src / edu / berkeley / sbp / ResultNode.java
index 65732a6..655b85a 100644 (file)
@@ -17,11 +17,14 @@ final class ResultNode
     public boolean isDoomedState() { /* this is irrelevant */ return false; }
     public Forest getForest() { return f; }
     public String toString() { return super.toString()+"->"+phase(); }
+    public boolean hasPathToRoot() {
+        if (predecessorPhase()==null) return true;
+        return super.hasPathToRoot();
+    }
 
     public void check() {
         if (destroyed) return;
-        if (successors.size()==0) destroy();
-        else if (predecessors.size()==0) destroy();
+        if (!hasSuccessors() || !hasPredecessors()) destroy();
     }
     protected void destroy() {
         if (destroyed) return;
@@ -32,7 +35,7 @@ final class ResultNode
     protected void addPred(StateNode pred) {
         super.addPred(pred);
         // results should have at most one predecessor
-        if (predecessors.size() > 1) throw new Error();
+        //if (predecessors.size() > 1) throw new Error();
     }
         
     public ResultNode() { this(null, null, null); }