Breakpoint monitoring functions | CPN Tools help |
CPN ML |
Monitoring functions, Breakpoint monitors
Each one of the breakpoint monitors has two monitoring functions:
Accessibility of the monitoring functions for the different kinds of breakpoint monitors:
predicate | action | |
Place contents | hidden | hidden |
Transition enabled | hidden | hidden |
Generic breakpoint | accessible | hidden |
Function types for the accessible functions:
pred : subnet -> bool
For more information about the subnet
data type see Data types for monitored subnets.
All of the following examples are examples of monitoring functions for the Simple Protocol net. Additional examples of breakpoint monitoring functions can be found in the example net for the Queue System.
The following predicate function is for a monitor that is associated with no places and no transitions. The monitor will stop a simulation when the model time is greater than 200.
fun pred () = IntInf.toInt(time()) > 200
The following predicate function is for a monitor that is associated with one place and two transitions. The monitor will stop a simulation when either the Transmit_Ack
or the Transmit_Packet
transition on the page Top
occurs. The variables of the transitions and the marking of the place B
are ignored in this function.
fun pred (bindelem, Top'B_1_mark : INTxDATA ms) = let fun predBindElem (Top'Transmit_Packet (1, {n,p,r,s})) = true | predBindElem _ = false in predBindElem bindelem end
Transmit_Packet
transition occurs, and
not (Ok(s,r))
, and
B
, as indicated by (size Top'B_1_mark >= 2)
size
function is a function for multi-sets.
fun pred (bindelem, Top'B_1_mark : INTxDATA ms) = let fun predBindElem (Top'Transmit_Packet (1, {n,p,r,s})) = not (Ok(s,r)) andalso (size Top'B_1_mark >= 2) | predBindElem _ = false in predBindElem bindelem end