use of nars.gui.util.NARGraph.UniqueEdge in project opennars by opennars.
the class TermSyntaxVis method addSyntax.
public static Term addSyntax(NARGraph g, Term t) {
if (t instanceof CompoundTerm) {
CompoundTerm ct = (CompoundTerm) t;
g.addVertex(ct);
int n = 0;
for (Term s : ct.term) {
Term v = addSyntax(g, s);
g.addEdge(ct, v, new UniqueEdge(ct.operator() + ":" + n));
n++;
}
return ct;
} else {
g.addVertex(t);
return t;
}
}
Aggregations