ls1intum / Apollon

UML Modeling Editor written in React
https://apollon-library.readthedocs.io
MIT License
65 stars 22 forks source link

Add reachability graphs #167

Closed dejdav closed 3 years ago

dejdav commented 3 years ago

Checklist

Motivation and Context

This change introduces a new diagram type, namely reachability graphs in the context of Petri nets, a diagram type that is already implemented in Apollon. The final goal is to create a new exercise type in Artemis where students of the GBS (Grundlagen: Betriebssysteme und Systemsoftware) course are asked to construct the reachability graph of a given Petri net, or vice-versa, to construct the Petri net for a given reachability graph. This change resolves #130.

Description

A new diagram type was added: reachability graphs. They only consist of a single ElementType: markings. Markings are connected using arcs, the one and only RelationshipType within this diagram. New popups or rather update components have been added for markings and arcs. Two translated strings have been added to the respective translation files. Markings have a two properties (a name and a flag that indicates whether a marking is the initial marking). Arcs only have a name and their direction may be changed in the popup. Tests have been added for both components. The tests cover all changes that are possible in the respective popups.

Steps for Testing

  1. Select the new diagram type "Reachability Graph".
  2. Draw a set of markings. Assign different "names" to each marking (this actually is not the name of the marking but rather a comma separated list of integers, optionally surrounded by (), [] or {}, but that is irrelevant for testing the functionality). Define one marking as the initial marking (click on a marking and toggle the checkbox).
  3. Connect the markings using arcs. Assign different names to each arc.
  4. Make sure your graph gets saved correctly and reappears unchanged if you reload the page.

Screenshots

A reachability graph where a marking is currently selected. It is possible to change the text inside the node and to define a marking as the initial marking. This draws an arrow towards the selected marking, as shown in the top left of the screenshot. Screen Shot 2021-05-15 at 21 34 41 The same graph in German language. The checkbox defines whether a marking is the initial marking. Screen Shot 2021-05-15 at 21 36 31 An arc being edited. Arcs have a name and their direction can be toggled. Screen Shot 2021-05-15 at 21 35 05 The new graph in the menu on the right. This diagram type only has one type of node/element, namely markings. Screen Shot 2021-05-15 at 21 35 28