Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup v2 #51

Merged
merged 9 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.

EXCLUDE = symmetri/submodules symmetri/small_vector.hpp symmetri/include/symmetri/maxplus.hpp symmetri/tests symmetri/queue
EXCLUDE = symmetri/submodules symmetri/include/symmetri/maxplus.hpp symmetri/tests symmetri/externals symmetri/gui

# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Net net = {{"foo", {{"B", "C"}, {"Z", "B"}}},
{"bar", {{"Z"}, {"B", "C"}}}};
Marking initial = {{"Z", Color::Success}};
Marking goal = {};
auto pool = std::make_shared<symmetri::TaskSystem>(4);
symmetri::PetriNet app(net,"test_net_without_end", pool, initial, goal);
auto pool = std::make_shared<TaskSystem>(4);
PetriNet app(net,"test_net_without_end", pool, initial, goal);
app.registerCallback("foo", &foo);
app.registerCallback("bar", &bar);

Expand Down
60 changes: 60 additions & 0 deletions docs/img/colors.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 14 additions & 1 deletion docs/symmetri_nets.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,20 @@ There is also the complication of conflict. Conflict arises if two or more trans

## Failure at the level of transitions

When firing is atomic there is no room for failure of transitions. They either fire and cause a marking mutation or they do not. In Symmetri, the atomic mutation is split into consumption and production, and these mutations are processed at different points in time. The execution or scheduling of a callback will still always consume tokens. The production of tokens however, can be made dependent on the outcome of a callback. Being able to withhold token production gives modelling capabilities to alter transition sequences and even create a deadlock on purpose in cases of failures inside a callback. This kind of behaviour is favourable if one wants to [fail fast](https://en.wikipedia.org/wiki/Fail-fast).
When firing is atomic there is no room for failure of transitions. They either fire and cause a marking mutation or they do not. In Symmetri, the atomic mutation is split into consumption and production, and these mutations are processed at different points in time. The execution or scheduling of a callback will still always consume tokens. The production of tokens however, can be made dependent on the outcome of a callback. Being able to withhold token production gives modelling capabilities to alter transition sequences and even create a deadlock on purpose in cases of failures inside a callback. This kind of behavior is favorable if one wants to [fail fast](https://en.wikipedia.org/wiki/Fail-fast).

## Colors

In Symmetri there is a minimal support set for using high-level Petri nets, also known as Colored Petri nets. It is implemented by adding color-restrictions on the input-arcs, running from (pre-)places to transitions. A colored arc implies that the token in the pre-place must be of the same color as the color of the arc.

![](img/colors.svg)

<center><br />A Petri net with color constraints. Because the Token in P<sub>2</sub> is blue, T<sub>blue</sub> will be fired
</center>

This deviates a from literature where the definition is much more formal, where colors represent any type or value. In Symmetri we use colors only as means to communicate state and not to transfer data from one transition to the next. This could be interesting someday, but for now is out of scope.

Also, because the output of a transition in Symmetri is determined by what happens in the *Callback* (e.g. configurable by the user), there technically is no color constraint on the output arcs at the level of the Petri net definition. Do note, that if there simply are no consumers for a particular color in a specific place, this simply results in a deadlocked system.

## Input from abroad

Expand Down
Loading