X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FResultNode.java;h=e22bd45a41c07ea64b1f32e64c393481adec021e;hp=671940ae2d01bc1cabcfb36e56df8373dc1f7943;hb=76ce41540f06ac1fbcb44332dd62f53e88c27cf1;hpb=c53fc2952c7885d727500ce404887d552c5dec5f diff --git a/src/edu/berkeley/sbp/ResultNode.java b/src/edu/berkeley/sbp/ResultNode.java index 671940a..e22bd45 100644 --- a/src/edu/berkeley/sbp/ResultNode.java +++ b/src/edu/berkeley/sbp/ResultNode.java @@ -7,22 +7,15 @@ import edu.berkeley.sbp.Sequence.Pos; import java.util.*; final class ResultNode - implements GraphViz.ToGraphViz { + extends Node { private Forest.Many f = new Forest.Many(); - //private HashSet predecessors = new HashSet(); - //private HashSet successors = new HashSet(); - private FastSet predecessors = new FastSet(); - private FastSet successors = new FastSet(); private boolean destroyed = false; private boolean primordeal; private int usedByNonDoomedNode = 0; private Pos reduction; private GSS.Phase predPhase; - public boolean predecessorsContains(StateNode n) { - return predecessors.contains(n); - } public Pos reduction() { return reduction; } public void merge(Forest newf) { this.f.merge(newf); @@ -34,11 +27,8 @@ final class ResultNode */ } - public boolean noSuccessors() { return successors.size()==0; } - public GSS.Phase phase() { return predPhase; } public Forest getForest() { return f; } - public Iterable getPreds() { return predecessors; } public void addSucc(StateNode succ) { if (successors.contains(succ)) return; successors.add(succ); @@ -75,7 +65,7 @@ final class ResultNode while(successors.size() > 0) for(StateNode succ : successors) { removeSucc(succ); - succ.removeResult(this); + succ.removePred(this); break; } successors = null; @@ -105,20 +95,5 @@ final class ResultNode if (pred != null) addPred(pred); } - // GraphViz ////////////////////////////////////////////////////////////////////////////// - - public GraphViz.StateNode toGraphViz(GraphViz gv) { - if (gv.hasNode(this)) return gv.createNode(this); - GraphViz.StateNode n = gv.createNode(this); - n.label = ""+f; - n.shape = "rectangle"; - //if (pred()!=null) n.edge(pred, ""); - n.color = "blue"; - if (phase() != null) - ((GraphViz.Group)phase().toGraphViz(gv)).add(n); - return n; - } - public boolean isTransparent() { return false; } - public boolean isHidden() { return false; } } \ No newline at end of file