greatspn / SOURCES

Main repository of the GreatSPN framework
GNU General Public License v2.0
42 stars 13 forks source link

Coloration of Petri Nets #40

Closed MathisHRD closed 1 year ago

MathisHRD commented 1 year ago

Hello,

I am currently using GreatSPN 3.0. I need coloration of some parts of petri nets. I am new and I only found the documentation for Great SPN2.0. I managed to create Color class and attribute color to places. However, i didn't find the button to color transition or arc . In the documentation of GreatSPN 2.0 i saw coloration of transition, but i don’t have the same button. Then i have "Invalid Arc Cardinality expression. Parse Error at <>, position 1:1-0". I don’t have this error when I do not use color. I surely missed something but i can't find solution. What is the process to use coloration in GreatSPN? Thank you

316953989_1340086246740919_8639425909669788369_n

amparore commented 1 year ago

Hello Mathis, yes the old manual is very outdated, even if the syntax very similar. A simple way to start with colored Petri nets in GreatSPN is to look at the examples. When you have an open project, click on the New page button (second on the toolbar), then "Add Library model" and choose one in the second block. You can start with SimpleCPN, DatabaseCPN or PhilosophersCPN, which have examples of the syntax that is needed to declare color classes, and to correctly label the arcs.

Transitions connected to colored places are implicitly colored, so only places need to be specified as colored. To properly label the arcs, you will need to add color variables, and then write a proper expression on the arc that connects a colored place with a transition. It is easier if you first have a look at the examples, which will give you the basic ideas.

--Elvio

MathisHRD commented 1 year ago

With these examples I managed to understand how it works, Thank you!