Breakpoint monitors | CPN Tools help |
How-to |
Breakpoint monitors are used to stop simulations when certain conditions are fulfilled.
There are several different kinds of breakpoint monitors:
A Place Contents monitor will check the number of tokens on a place to determine if a simulation should be stopped. The simulation can be stopped either
A place contents monitor will check the number of tokens on a place each time one of the surrounding transitions of the place occurs. A place contents monitor will not check the number of tokens on a place before the first step in a simulation.
To create a Place contents monitor, apply the Create place contents monitor tool to a place.
A place contents monitor will be deleted if the corresponding place is deleted.
A Transition Enabled monitor will check whether a transition is enabled to determine if a simulation should be stopped. The simulation can be stopped either
A Transition enabled monitor will check whether the appropriate transition is enabled after every step in a simulation. If at least one place in the net has a timed coloured set, then the transition enabled monitor will also check if the transition is enabled whenever model time is increased. A transition enabled monitor will not check if the transition is enabled before the first step in a simulation.
To create a Transition enabled monitor, apply the Create transition enabled monitor tool to a transition.
A transition enabled monitor will be deleted if the corresponding transition is deleted.
A generic breakpoint monitor can be used to stop a simulation when an arbitrary condition is fulfilled. A generic breakpoint monitor can examine any subnet of a CP-net, e.g. a single node, a group of nodes, or no nodes.
To create a generic breakpoint monitor, apply the Create breakpoint monitor tool to the appropriate subnet. Here is an example of how to create a generic breakpoint monitor that will monitor a single transition and a single place in the Simple Protocol example net:
After applying the Create breakpoint monitor tool, a new monitor will be added to the index, and monitor template code is automatically generated for the predicate function for the monitor.
The predicate function can be modified to obtain the desired behavior. The following predicate function will stop a simulation when the following two conditions are fulfilled:
Transmit_Packet
transition occurs, and
B
For additional examples, see the help page for breakpoint monitoring functions.
A generic breakpoint monitor will not be deleted if any of the associated nodes are deleted. However, if an associated node is deleted, it is likely that there will be errors in the monitor.