greatspn / SOURCES

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

Algebra tool does not merge places #23

Closed Arminius closed 3 years ago

Arminius commented 3 years ago

Hello, I've been trying to use the algebra tool to merge different petri nets together at specific places/transitions, but I haven't had any success in actually getting this functionality to work. I've come up with the following minimal example to illustrate my problems: My starting petri nets look like this: a->|->b a<-|<-b

After running the algebra tool on these nets, the result looks like this: a1->|->b1  a<-|<-b

For the restfile, I've tried both an empty/nonexistent file as well as a file with the contents place={a|b}, but in any case, the resulting petri net contains both input nets side by side rather than actually merging the nodes a and b.

Am I doing something wrong here, or am I fundamentally misunderstanding what the algebra tool is supposed to do?

amparore commented 3 years ago

dear Arminius, algebra works by joining places and/or transitions by tag and not by name. In the editor you could add tags to places and transitions (see the Tags property box when you select places/transitions). An object can have multiple tags, that are written separated by |. The algebra tool (that you can also use from the gui) will operate by making a cross-product of all places/transitions that share common tags in the tag list you are passing to the tool. I send you an example file.

P.S. I have fixed some bugs in the GUI - please re-download it from http://www.di.unito.it/~amparore/mc4cslta/editor.html before.

best regards --Elvio

Il giorno gio 25 feb 2021 alle ore 12:53 Arminius notifications@github.com ha scritto:

Hello, I've been trying to use the algebra tool to merge different petri nets together at specific places/transitions, but I haven't had any success in actually getting this functionality to work. I've come up with the following minimal example to illustrate my problems: My starting petri nets look like this: [image: a->|->b] https://camo.githubusercontent.com/a7baab1c072ed051c813e33130284bd20ea54c29c03ab02cbd6ca2e2f2199d61/68747470733a2f2f692e70617374652e706963732f66333834303765643735646232663130346339613264366361383038313764652e706e67 [image: a<-|<-b] https://camo.githubusercontent.com/66e3818614a50a51a95923654defc7a718bcd006e60902a3c575d0d57e9625c5/68747470733a2f2f692e70617374652e706963732f31303565313735626334366562316262333335386635373861333465353335362e706e67

After running the algebra tool on these nets, the result looks like this: [image: a1->|->b1 a<-|<-b] https://camo.githubusercontent.com/ce7f7fb6a477624eb2ea50da8cc9f7f61b132d34f4773af1cad887eec0c51998/68747470733a2f2f692e70617374652e706963732f64643833623134303761636663646265613336663735306534626163356365332e706e67

For the restfile, I've tried both an empty/nonexistent file as well as a file with the contents place={a|b}, but in any case, the resulting petri net contains both input nets side by side rather than actually merging the nodes a and b.

Am I doing something wrong here, or am I fundamentally misunderstanding what the algebra tool is supposed to do?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/greatspn/SOURCES/issues/23, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGLFJEUW7YX4RFKFHYGTQSLTAY23BANCNFSM4YGLT3QQ .

Arminius commented 3 years ago

Thanks! After tagging the places a and b, I now get the following: t0->a->|->b-t0  a - t0 <- b

That looks very unexpected, but after closer inspection, that looks like it might be right. Is this about what you would expect?

Arminius commented 3 years ago

I've decided myself that this is alright; this issue can be closed.