Soar::WM::Grapher - Utility for creating graphs of Soar's working memory
use Soar::WM; use Soar::WM::Grapher qw(wm_graph); my $wm = Soar::WM->new(file=>'path/to/wme/dump'); my $wme_id = 'S1'; #name of WME to begin graph from my $depth = 2; #number of levels to traverse during graphing my $g = wm_graph($wm, $wme_id, $depth, layout => 'twopi', ratio => 'compress', overlap=>'scale'); $g->as_svg('wm_graph.svg');
This module can be used to create GraphViz representations of Soar working memory.
Soar::WM - Perl extension for representing Soar working memory given a WME dump file
There are three required arguments: a Soar::WM object, the ID of the working memory element to begin graphing from, and the depth to graph. If the depth is 1, then only the specified element and its attribute-value pairs will be graphed. 2 will also graph each of the WMEs attached to the first node, and so on. The return value is a GraphViz object. Any extra arguments passed to this function are passed on to the GraphViz constructor; therefore, you can specify graphing options such as layout, as seen in the synopsis above.
I understand that GraphViz is deprecated in favor of GraphViz2. However, I cannot cleanly install GraphViz2 on my own computer (it has a rather large dependency list). When I can cleanly install GraphViz2, I'll switch to that module.
wm_graph function accepts many optional arguments specified by the GraphViz module.
Nathan Glenn <email@example.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Nathan Glenn.