projects
/
sbp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3425ced
)
fixes to Node.toGraphViz()
author
adam
<adam@megacz.com>
Mon, 26 Feb 2007 01:20:09 +0000
(20:20 -0500)
committer
adam
<adam@megacz.com>
Mon, 26 Feb 2007 01:20:09 +0000
(20:20 -0500)
darcs-hash:
20070226012009
-5007d-
e0abf5a2250a725af1bc7c74eac4adfb4c1e5a21
.gz
src/edu/berkeley/sbp/Node.java
patch
|
blob
|
history
diff --git
a/src/edu/berkeley/sbp/Node.java
b/src/edu/berkeley/sbp/Node.java
index
14114b9
..
8710863
100644
(file)
--- a/
src/edu/berkeley/sbp/Node.java
+++ b/
src/edu/berkeley/sbp/Node.java
@@
-58,7
+58,6
@@
final class Node
if (pos>0) child.reduce(r, pos-1, target, null);
else new Reduction(child, r, r.rewrite(child.phase().getLocation().createRegion(target.getLocation())), target);
}
if (pos>0) child.reduce(r, pos-1, target, null);
else new Reduction(child, r, r.rewrite(child.phase().getLocation().createRegion(target.getLocation())), target);
}
-
holder[pos] = old;
}
holder[pos] = old;
}
@@
-87,14
+86,14
@@
final class Node
// GraphViz //////////////////////////////////////////////////////////////////////////////
public GraphViz.Node toGraphViz(GraphViz gv) {
// GraphViz //////////////////////////////////////////////////////////////////////////////
public GraphViz.Node toGraphViz(GraphViz gv) {
+ if (results.size()==0) return null;
if (gv.hasNode(this)) return gv.createNode(this);
GraphViz.Node n = gv.createNode(this);
n.label = ""+state.toStringx();
n.shape = "rectangle";
boolean hasparents = false;
if (gv.hasNode(this)) return gv.createNode(this);
GraphViz.Node n = gv.createNode(this);
n.label = ""+state.toStringx();
n.shape = "rectangle";
boolean hasparents = false;
- //for(Node parent : parents()) { hasparents = true; n.edge(parent, ""); }
- //for(Forest result : resultMap) n.edge(result, "");
- n.color = !hasparents ? "blue" : /*state.evil ? "red" :*/ "green";
+ for(Result r : results) n.edge(r, "");
+ n.color = state.doomed ? "red" : "green";
((GraphViz.Group)phase().toGraphViz(gv)).add(n);
return n;
}
((GraphViz.Group)phase().toGraphViz(gv)).add(n);
return n;
}