StringWriter out = new StringWriter();
out.write("graph G {\noverlap=false;\nratio=fill;\n");
final ModelInfo modelInfo = new ModelInfo(m.getLines());
for(Agent a : modelInfo.getAgents()){
out.write(a.getName() + "[fontsize=24,width=1.6,height=1.6]\n");
for(Site s : a.getSites()){
if (s.getState() == null){
out.write(s.getAgent() + " -- " + s.getQualifiedName() +" []\n");
out.write(s.getQualifiedName() + "[label="+s.getName()+",fontsize=12,width=0.2,height=0.2]\n");
}
else {
out.write(s.getAgent() + " -- " + s.getQualifiedName() +" []\n");
out.write(s.getQualifiedName() + "[label=\""+s.getName()+"~"+s.getState()+"\",fillcolor=green, shape=triangle, style=filled,fontsize=12]\n");
}
}
}
for(Entry<String, Set<String>> b : modelInfo.getBindings().entrySet()){
for (String s : b.getValue()){
out.write(b.getKey() + "--" + s +"[color=black, dir=none, label=\":\", labelangle=45, labeldistance=1, labelfontsize=6, style=solid]\n");
}
}