SNAKES is a Python library that provides all then necessary to define
and execute many sorts of Petri nets, in particular those of the PBC
and M-nets family. Its main aim is to be a general Petri net library,
being able to cope with most Petri nets models, and providing the
researcher with a tool to quickly prototype its new ideas. SNAKES
should be suitable to provide the data model for editors or
simulators; actually, any editor that use SNAKES may also be a
simulator as SNAKES can execute any net.
A key feature of SNAKES is the ability to use arbitrary Python objects as tokens and arbitrary Python expressions in many points, for instance in transitions guards or arcs outgoing of transitions. This is what makes SNAKES that general. This relies on the capability of Python to run dynamically provided Python code (the eval function). This feature may not be efficient enough for model-checking: speed is the price to pay for the wide generality. However, in the case of a new model, SNAKES may happen to be the only available tool.
Another important feature of SNAKES is the plugin system that allows to extend the features and work with specialised classes of Petri nets. Currently, the following plugins are provided:
| pos | adds to nodes the capability of holding their position. Nodes can be moved or shifted, Petri nets can be shifted globally and their bounding box can be computed. |
| gv | adds a method to draw a Petri net or a state graph using the tool GraphViz (through the Python binding PyGraphViz). This module replaces the previous plugin called graphviz and provides more flexibility and security, graphviz is still provided but deprecated. |
| status | extends the Petri net model by adding status to the nodes. This is similar to what is used in the models of the PBC or Mnets family. Nodes can then merged automatically according to their status. |
| ops | this plugins defines control flow operations on Petri nets usually found in the PBC and Mnets family. Nets can be composed in parallel, sequence, choice and iteration. These operations rely on the places status. |
| labels | allows to add arbitrary labels to most objects (places, transitions, nets, …) |
| posops | combines the features of pos and ops plugins: the control flow operations are modified in order to rearrange the nodes position in order to provide well shaped nets. This plugin is deprecated because the new gv does the work much better. |
| synchro | it defines the label-based transition synchronisation defined in the Mnets model. |
| clusters | this is an auxiliary plugin that allows to group nodes in a Petri net. This feature is used by ops in order to record how a net is constructed, which is exploited by gv in order to build a nice layout of composed nets. |
An Ubuntu version is available at my LaunchPad PPA.
To install from source, first download snakes-0.9.10.tar.gz (2.6M, updated 2009-06-19). Then uncompress the archive and run python setup.py at the command line.
SNAKES should work with a Python version at least 2.5 but will not work for an older version. Optionally, you may want to install additional software required by some plugins:
| gv | depends on GraphViz and its Python binding PyGraphViz. The plugin graphviz depends on GraphViz only but is now deprecated. |
|
© 2007 Franck Pommereau <pommereau@univ-paris12.fr> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
Please feel free to send me comments, questions, bug reports or contributions by email.
If you wish to be notified of the new releases of SNAKES, please register at the FreshMeat page.
You may contribute to SNAKES by either send patches by email, or by using the SNAKES Launchpad page.
A good starting point may be the tutorial. Then, you may find the API reference manual useful, it documents all the API and gives number of examples of how to use the various classes and functions.
If you do not program Python, you can learn it in a few hours thanks to the very good Python tutorial.
In order to know more about the PBC and M-nets family or the Petri net compositions defined in the plugins, you may read papers from my publications page (in particular those with calculus in the title).