Graphical block debugging: Difference between revisions

From ASCEND
Jump to navigation Jump to search
Restored page from Google Cache, uploaded by John Pye
 
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div class="pageexperimental">''This page documents an '''experimental''' feature. You can help out by '''testing it''' and <span class="plainlinks">[http://ascendwiki.cheme.cmu.edu/index.php?title=Graphical_block_debugging&action=edit recording]</span> your experiences.''</div>
{{experimental}}


Some progress has been made on this, with the addition of a method in the <tt>system</tt> directory called <tt>system_write_graph</tt>. This method should output the incidence between a filtered set of variables and relations.
Some progress has been made on this, with the addition of a method in the <tt>system</tt> directory called <tt>system_write_graph</tt>. This method should output the incidence between a filtered set of variables and relations. The graph is drawn using [http://www.graphviz.org GraphViz].


<div class="thumb tnone"><div class="thumbinner" style="width:402px;">[[Image:Lotka-graph.png]] <div class="thumbcaption"><div class="magnify">[[File:Lotka-graph.png|<img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" />]]</div>Graph of the relationship between variables and relations in the {{src|models/johnpye/lotka.a4c}} example. The graph is drawn using [http://www.graphviz.org GraphViz].</div></div></div>
[[Image:Lotka-graph.png|200px|thumb|none|Graph of the relationship between variables and relations in the {{src|models/johnpye/lotka.a4c}} example.]]


At present this functionality is available from the Python API as shown:
At present this functionality is available from the Python API as shown:
Line 13: Line 13:
M.build()
M.build()
f = file('lotka.png','w')
f = file('lotka.png','w')
M.write(f,&quot;dot&quot;)
M.write(f,"dot")


f.close()</source>
f.close()</source>
Line 21: Line 21:
Some preliminary work at integrating these graphics into the PyGTK has been made, see [[Incidence Graph]].
Some preliminary work at integrating these graphics into the PyGTK has been made, see [[Incidence Graph]].


 
[[Category:Documentation]]
 
 
[[Category:Experimental]]

Latest revision as of 01:41, 26 November 2017

This page documents an experimental feature. Please tell us if you experience any problems.

Some progress has been made on this, with the addition of a method in the system directory called system_write_graph. This method should output the incidence between a filtered set of variables and relations. The graph is drawn using GraphViz.

Graph of the relationship between variables and relations in the models/johnpye/lotka.a4c example.

At present this functionality is available from the Python API as shown:

L=ascpy.Library()
L.load('johnpye/lotka.a4c')
M = self.L.findType('lotka').getSimulation('sim')

M.build()
f = file('lotka.png','w')
M.write(f,"dot")

f.close()

The file lotka.png can then be viewed in your preferred graphics viewer.

Some preliminary work at integrating these graphics into the PyGTK has been made, see Incidence Graph.