Soar::WM::Grapher - Utility for creating graphs of Soar's working memory
version 0.02
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
wm_graph
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.
The wm_graph function accepts many optional arguments specified by the GraphViz module.
Nathan Glenn <garfieldnate@gmail.com>
This software is copyright (c) 2012 by Nathan Glenn.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Soar::WM::Grapher, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Soar::WM::Grapher
CPAN shell
perl -MCPAN -e shell install Soar::WM::Grapher
For more information on module installation, please visit the detailed CPAN module installation guide.