Anti-places/limit places
|
CPN Tools help
|
|
How-to
|
Introduction
Often one would like to limit the capacity for a place, e.g. to model a network buffer, or simply to make the net finite to facilitate the generation of state-spaces.
Unfortunately CPN Tools doen not support this, but this can easily be modelled using the concept of anti-places.
An anti-place is a place corresponding to the original place, where for each arc to/from the original place, there is an arc from/to the anti-place, moving the same number of uncoloured tokens.
Example
This is a very simple model of a sender and a receiver.
The sender, sends packages onto a network.
The receiver receives packages from the network.
Limit the capacity
We would like to limit the capacity of the network to 2.
We add an anti-place with two tokens. When I do this to the above example, I obtain:
Adding an anti-place
- I add a new place with the type "E". I give the new place the name "Anti Network", so it is obvious that it is the anti-place of "Network"
- I give the new place the initial marking "2`e", because I choose that the limit should be 2.
NOTE: I do not need to add the type "E", as it is one of the standard declarations.
Changes to arcs (incoming and outgoing)
- I keep the original arc and its inscription
- I add a new arc in the opposite direction, but attach the place end to the anti-place in stead. The instription of the new arc is as many "e"-tokens as I move along the original arc. In this example, the inscription of the original arc is "p" (moving exactly one token), so the new inscription is "e". Has the original inscription been, e.g., "1`true++2`false", "3`'hello'", or "1`1++1`3++1`9", the new inscription would have been in all cases "3`e"
Examples
The examples from this document can be downloaded
- unbounded.cpn -- thr original unbounded example
- limited.cpn -- the example, where I have limited the capacity of the network to 2