TimedPetriNetEditor is a graphical interface for editing and running Petri nets. It offers some mathematics tools for timed event graphs which are a subclass of timed Petri nets with good mathematics properties for modeling discrete event systems with (max,+) algebra.
Note: An online version is in gestation. Here is the link.
You can read this internal document for more information. Else you can go to Related lectures and projects.
The following picture is an overview of the look of the application. You can click on it to watch a YouTube showing an example of timed Petri net running simulating emergency operators (French 911 call center) responding to people in distress. Operators of level 1 filter non-critical cases (advice). Operators of level 2 manage other cases: urgency and critical cases. For urgency cases, the operator of level 1 hangs up when he makes the victim wait the operator of level 2. For critical cases, the operator of level 1 waits with the victim until an operator of level 2 pick up before hanging up.
Fig 1 - A timed Petri net (made with this editor).
Why developing another Petri editor? Because:
- This project has started as a continuation of ScicosLab's (max,+) toolbox developed at INRIA (which is no longer developed) which missed a graphical Petri editor associated with (max,+) algebra.
- Many Petri net editors in GitHub are no longer maintained (> 7 years) or that I cannot personally compile or use (Windows system, Visual Studio compiler, C#, Java ..) or the code is too complex (no comments) to add my own extensions. This editor can be used for Julia language.
git clone https://github.com/Lecrapouille/TimedPetriNetEditor --depth=1 --recursive
cd TimedPetriNetEditor/
make download-external-libs
make compile-external-libs
make -j8
sudo make install
You can pass a Petri net file to the command line. See this document concerning the description of the file format used for saving Petri net.
./build/TimedPetriNetEditor [data/examples/AppelsDurgence.json]
See:
- this document showing some examples offered with this repo.
this document describing the mouse and key bindings for the graphical interface.this document describing how to control the editor through MQTT commands.- this document Explaining how to export/import the net to/from other applications.
Type F5 key to launch the application with a debugger.
You can modify the .vscode/launch.json
to indicate
The make install
is needed for its usage with Julia. Once installed in your operating system, you can directly from
the Julia REPL (this part
is described in detail in a dedicated document):
julia> include("src/julia/TimedPetriNetEditor.jl")
counter (generic function with 1 method)
julia> pn = petri_net()
PetriNet(0)
julia> petri_editor!(pn)
If you do not desire to install TimedPetriNetEditor on your operating system,
you will have to adapt the DEFINES
in Makefile to indicate the path of the
data/
folder (to find the fonts). You will also have to manually modify this
Julia file to indicate the correct path of the shared library
libtimedpetrineteditor.so
.
You can read this cheatsheet concerning the API for Julia.