Skip to content

Commit f6a5b24

Browse files
committed
Update to version 0.5.0
1 parent 445f37a commit f6a5b24

4 files changed

Lines changed: 93 additions & 66 deletions

File tree

ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
May 2026: version 0.5.0
2+
* Major editor refresh: menus, multi-graph documents, magnetic grid, force directed graph.
3+
* GRAFCET: adding (WIP) actions, forcage, display, multi GRAFCET (GEMMA).
4+
* Flowshop: import from flowshop description files, fix display of critical cycles.
5+
* Save format revision 4
6+
* Many major improvements and bug fixes in algorithms: Howard, critical cycles, sparse matrices
7+
* MQTT support replaced by ZeroMQ (WIP)
8+
* API: reset()/clear() split; merged run() and startUp()
9+
* Julia bindings extended
10+
111
Jan 2023: version 0.4.0
212
* No longer use SFML, GUI is 100% DearIMGui
313
* Without SFML can now compile with Emscripten for online version

Makefile.common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Project definition
33
#
44
PROJECT_NAME := TimedPetriNetEditor
5-
PROJECT_VERSION := 0.4.0
5+
PROJECT_VERSION := 0.5.0
66
COMPILATION_MODE := debug
77
CXX_STANDARD := --std=c++17
88

README.md

Lines changed: 53 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,61 @@
11
# Timed Petri Net Editor
22

3-
[TimedPetriNetEditor](https://github.com/Lecrapouille/TimedPetriNetEditor) is a
4-
graphical interface for editing and running Petri nets. It offers some mathematics
5-
tools for timed event graphs which are a subclass of timed Petri nets with good
6-
mathematics properties for modeling discrete event systems with [(max,+)
7-
algebra](https://jpquadrat.github.io/).
3+
[TimedPetriNetEditor](https://github.com/Lecrapouille/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](https://jpquadrat.github.io/).
84

95
**Note:** An online version is in gestation.
106
Here is the [link](https://lecrapouille.github.io/TimedPetriNetEditor/TimedPetriNetEditor.html).
117

128
## What are Petri nets, timed Petri nets, timed event graph, GRAFCET?
139

14-
You can read this [internal document](doc/petri.md) for more information. Else
15-
you can go to [Related lectures and projects](doc/biblio.md).
10+
You can read this [internal document](doc/petri.md) for more information. Else you can go to [Related lectures and projects](doc/biblio.md).
1611

1712
## Application Overview
1813

19-
The following picture is an overview of the look of the application. You can
20-
click on it to watch a YouTube showing an example of timed Petri net running
21-
simulating emergency operators (French 911 call center) responding to people in
22-
distress. Operators of level 1 filter non-critical cases (advice). Operators of
23-
level 2 manage other cases: urgency and critical cases. For urgency cases, the
24-
operator of level 1 hangs up when he makes the victim wait the operator of
25-
level 2. For critical cases, the operator of level 1 waits with the victim until
26-
an operator of level 2 pick up before hanging up.
14+
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.
2715

2816
[![TimedPetri](doc/pics/911.png)](https://youtu.be/hOhunzgFpcA)
2917

3018
*Fig 1 - A timed Petri net (made with this editor).*
3119

3220
Why developing another Petri editor? Because:
33-
- This project has started as a continuation of [ScicosLab](http://www.scicoslab.org/)'s
34-
(max,+) toolbox developed at INRIA (which is no longer developed) which missed
35-
a graphical Petri editor associated with (max,+) algebra.
36-
- Many Petri net editors in GitHub are no longer maintained (> 7 years) or that
37-
I cannot personally compile or use (Windows system, Visual Studio compiler,
38-
C#, Java ..) or the code is too complex (no comments) to add my own extensions. This
39-
editor can be used for Julia language.
21+
- This project has started as a continuation of [ScicosLab](http://www.scicoslab.org/)'s (max,+) toolbox developed at INRIA (which is no longer developed) which missed a graphical Petri editor associated with (max,+) algebra.
22+
- 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.
23+
24+
## Prerequisites
25+
26+
The editor can use [ZeroMQ](https://zeromq.org/) for remote control (JSON commands over TCP). This is enabled by default (`TPNE_ZEROMQ=1` in `Makefile.common`). To build without ZeroMQ:
27+
28+
```sh
29+
make TPNE_ZEROMQ=0
30+
```
31+
32+
When ZeroMQ is enabled, install the development package for your system before building:
33+
34+
**Fedora / RHEL / CentOS:**
35+
```sh
36+
sudo dnf install zeromq-devel
37+
```
38+
39+
**Debian / Ubuntu:**
40+
```sh
41+
sudo apt install libzmq3-dev
42+
```
43+
44+
**Arch Linux:**
45+
```sh
46+
sudo pacman -S zeromq
47+
```
48+
49+
**macOS (Homebrew):**
50+
```sh
51+
brew install zeromq
52+
```
53+
54+
You can verify that `pkg-config` finds the library with:
55+
56+
```sh
57+
pkg-config --exists libzmq && echo "ZeroMQ OK"
58+
```
4059

4160
## Compilation, Installation
4261

@@ -49,10 +68,13 @@ make -j8
4968
sudo make install
5069
```
5170

71+
## Developer note: `-ffast-math` and NaN/Inf
72+
73+
This project may be compiled with `-ffast-math` (see `PERFORMANCE_FLAGS` in `.makefile/rules/Makefile`), which implies `-ffinite-math-only`. Under this assumption the compiler considers that `NaN` and `±Inf` never occur, so `std::isnan()` / `std::isinf()` are constant-folded to `false` and direct comparisons such as `x == -inf` become unreliable. When you need to detect a special floating-point value (the `(max,+)` zero `-inf`, the `NaN` "no duration" sentinel of `Place -> Transition` arcs, ...), use the bit-pattern based helpers from [`src/PetriNet/SafeFloat.hpp`](src/PetriNet/SafeFloat.hpp) (`safeIsNaN`, `safeIsNegInf`, `safeIsPosInf`, `safeIsInf`) instead of the standard library functions.
74+
5275
## Usage
5376

54-
You can pass a Petri net file to the command line. See this [document](doc/save.md)
55-
concerning the description of the file format used for saving Petri net.
77+
You can pass a Petri net file to the command line. See this [document](doc/save.md) concerning the description of the file format used for saving Petri net.
5678

5779
```sh
5880
./build/TimedPetriNetEditor [data/examples/AppelsDurgence.json]
@@ -66,29 +88,18 @@ See:
6688

6789
## Debug inside Visual Studio Code
6890

69-
Type F5 key to launch the application with a debugger.
70-
You can modify the `.vscode/launch.json` to indicate
91+
Type F5 key to launch the application with a debugger. You can modify the `.vscode/launch.json` to indicate
7192

7293
## Julia integration
7394

74-
The `make install` is needed for its usage with Julia. Once installed in your operating system, you can directly from
75-
the [Julia](https://github.com/JuliaLang/julia) REPL (this part
76-
is described in detail in a dedicated [document](julia.md)):
77-
78-
```sh
79-
julia> include("src/julia/TimedPetriNetEditor.jl")
80-
counter (generic function with 1 method)
81-
82-
julia> pn = petri_net()
83-
PetriNet(0)
95+
The C++ files in [`src/julia`](src/julia) (`Julia.cpp` / `Julia.hpp`) build the C ABI shared library used by Julia. The Julia wrapper itself will live in its own package, [TimedPetriNetEditor.jl](https://github.com/Lecrapouille/TimedPetriNetEditor.jl), which drives this build (`Pkg.build`) and exposes the API:
8496

85-
julia> petri_editor!(pn)
97+
```julia
98+
using TimedPetriNetEditor
99+
pn = petri_net()
100+
petri_editor!(pn)
86101
```
87102

88-
If you do not desire to install TimedPetriNetEditor on your operating system,
89-
you will have to adapt the `DEFINES` in Makefile to indicate the path of the
90-
`data/` folder (to find the fonts). You will also have to manually modify this
91-
Julia file to indicate the correct path of the shared library
92-
`libtimedpetrineteditor.so`.
103+
`TimedPetriNetEditor.jl` resolves the produced shared library automatically (no hard-coded path) and also adds the ScicosLab flowshop functions (`import_flowshop!`, `find_critical_cycle`, `show_cr_graph`) on top of [MaxPlus.jl](https://github.com/Lecrapouille/MaxPlus.jl).
93104

94105
You can read this [cheatsheet](doc/julia.md) concerning the API for Julia.

TODO

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
1+
ZeroMQ:
2+
- Encore non testé
13

4+
Editeur;
5+
- Colorier en rouge la grille des GRAFCET qui ont une erreur
6+
- Centrage du graphe dans la fenetre KO
27

3-
Gros bug de selection d'arcs en mode "Timed event graph" car il n'y a plus les Places affichées.
4-
placer les 3 GRAFCET dans un dictionnaire afin de trouver facilement les references.
5-
Colorier en rouge la grille des GRAFCET qui ont une erreur
6-
Parser 30s/X1/0s
7-
Gerer forcage init
8-
Ajouter actions if DR: KM1
9-
Placer le texte des transitions sous le rectangle
8+
Timed event graph:
9+
- Gros bug de selection d'arcs car il n'y a plus les Places affichées.
10+
- Creer un arc vide en mode timed event graph: segfault
1011

11-
Extraire les méthodes GRAFCET de Simulation vers Grafcet.hpp/cpp
12-
Ajouter le support des actions conditionnelles "if X: Y" pour GRAFCET
13-
14-
Ne pas afficher les arcs P -> T
15-
Ajouter un time scaling + 0 timing en mode "remote"
16-
Tester generation de code arduino + connection en remote a l'editeur
17-
Finir l'exemple de https://www.youtube.com/watch?v=8_mZYlMHsds dans GEMMA.json + ajouter dans le README
18-
Ajouter les reset et inhibitor cote Petri
19-
Finir flowshop + plot des donnees
12+
GRAFCET:
13+
- placer les 3 GRAFCET dans un dictionnaire afin de trouver facilement les references.
14+
- Parser 30s/X1/0s
15+
- Gerer forcage init
16+
- Bug: En mode GRAFCET le focage fait iterer GC entre init et val
17+
- Ajouter actions if DR: KM1
18+
- Code: "if frozen if GRAFCET ..." devrait etre inverse dans le code
19+
- au lieu de faire un interpreteur type Forth parsons une vraie expression mathematique.
20+
Il faudrait gerer la forme «t1/variable/t2». Dans l’exemple ci-contre, la réceptivité
21+
n'est vraie que 3 s après que « a » passe de l’état 0 à l’état 1, elle ne redevient
22+
fausse que 7 s après que « a » passe de l’état 1 à l’état 0.
2023

21-
Crash: modifier graphe, Clique sur X, sauver => boucle infinie
22-
En mode GRAFCET le focage fait iterer GC entre init et val
24+
Arduino:
25+
- Extraire les méthodes GRAFCET de Simulation vers Grafcet.hpp/cpp
26+
- Ajouter le support des actions conditionnelles "if X: Y" pour GRAFCET
2327

24-
if frozen if GRAFCET devrait etre inverse dans le code
28+
Flowshop:
29+
- plot les donnees de la simulation du flowshop
2530

26-
au lieu de faire un interpreteur type Forth parsons une vraie expression mathematique.
27-
Il faudrait gerer la forme «t1/variable/t2». Dans l’exemple ci-contre, la réceptivité
28-
n'est vraie que 3 s après que « a » passe de l’état 0 à l’état 1, elle ne redevient
29-
fausse que 7 s après que « a » passe de l’état 1 à l’état 0.
31+
Visualisation à distance:
32+
- Ajouter un time scaling + 0 timing en mode "remote"
33+
- Tester generation de code arduino + connection en remote a l'editeur
34+
- Finir l'exemple de https://www.youtube.com/watch?v=8_mZYlMHsds dans GEMMA.json + ajouter dans le README
35+
- Ajouter les reset et inhibitor cote Petri

0 commit comments

Comments
 (0)