Data collector monitors

Data collector monitors are used to extract numerical data during simulations. The numerical data is used when Calculating statistics, and the data may be saved in data collector log files. A data collector can calculate either timed or untimed statistics, which are described on the help pages for Calculating statistics. Data collector monitors are used for performance analysis of CPNs.

There are four data collector monitors:

  • Marking size monitors
  • List length monitors
  • Count transition occurrences monitors
  • Generic data collectors

Each kind of data collector monitor has a Logging option under the Type index entry for the monitor. This option determines whether the data values that are collected during a simulation should be saved in a data collector log file.

Logging option

If the Logging option is selected for a data collector monitor, the data will be saved in a file named <dcname>.log where <dcname> is the ML name of the data collector, and the log file will be saved in a simulation log files directory.

The Data collector functions can be used to access the statistics that are calculated for a particular data collector monitor.

Examples of data collector monitors can be found in the example net for the Queue system example.

Marking size monitors

A Marking size monitor extracts the number of tokens on a particular place during a simulation, and it is used to calculate, e.g. the average number of tokens on the place during a simulation.

To create a marking size monitor, apply the Create marking size monitor tool to a single place. If there is more than one instance of the place, the monitor will be created for the place instance that the tool is applied to.

After creating a marking size monitor, a monitor is added to the index.

Marking size monitor index entry

A default name is suggested, but the name may be changed.

A marking size monitor will be deleted, if the associated place is deleted.

All of the data collector monitoring functions for marking size monitors are hidden.

The size of the marking of the place will be measured once before the first step in the simulation.

The Nodes ordered by page index entry provides an overview of the nodes that are examined by the monitor.

Untimed nets

If the CPN is untimed, i.e. if none of the places has a timed color set, then the marking size of the place will be measured after every simulation step. In this case, the monitor will not be associated with any transitions. The monitor will calculate untimed statistics.

Marking size, no timed places

Timed nets

If the net contains at least one timed place, i.e. a place with a timed color set, then the size of the marking of the place will be measured each time one of the surrounding transitions occurs. In this case, the monitor will be associated with the place in question, as well as its surrounding transitions. The surrounding transitions may include transitions on other pages, if the place is a fusion place or a port or socket place. The size of the marking of the place will also be measured when Simulation stop criteria are fulfilled. The monitor will calculate timed statistics.

Marking size, timed place in net

List length monitors

List length monitors can be defined for places with List color sets only. There must always be one and only one list on the place in question during a simulation. A list length monitor will measure the length of the solitary list on the place. If there is ever zero or more than one list on the place when the length of the list is measured, then the no_singelton exception will be raised.

To create a list length monitor, apply the Create list length monitor tool to a place with a list color set. After creating a list length monitor, a monitor is added to the index.

List length monitor

A default name for the monitor is suggested, but the name may be changed.

An error will occur if a list length monitor is added to a place that does not have a list color set.

Error for list length monitor

A list length monitor will be deleted if the associated place is deleted.

All of the Data Collector Monitoring Functions for list length monitors are hidden.

The length of the list will be measured once before the first step in the simulation.

The Nodes ordered by page index entry provides an overview of the nodes that are examined by the monitor.

Untimed nets

If the CPN is untimed, i.e. if none of the places have Timed color sets, then the length of the list on the place will be measured after every simulation step. In this case, the monitor will not be associated with any transitions. The monitor will calculate untimed statistics.

Timed nets

If the net contains at least one timed place, i.e. a place with a timed color set, then the length of the list on the place will be measured each time one of the surrounding transitions occurs. In this case, the monitor will be associated with the place in question, as well as its surrounding transitions. The surrounding transitions may include transitions on other pages, if the place is a fusion place or a port or socket place. The length of the list will also be measured when Simulation stop criteria are fulfilled. The monitor will calculate timed statistics.

Count transition occurrences monitors

A Count transition occurrences monitor is used to calculate the number of times a particular transition occurs during a simulation.

To create such a monitor, apply the Create count transition occurrences monitor tool to a transition. After applying the tool, a new monitor will be added to the index.

Count transition occurrences monitor

A default name for the monitor is suggested, but the name may be changed.

A count transition occurrences monitor will be deleted if the associated transition is deleted.

All of the Data Collector Monitoring Functions for count transition occurrences monitors are hidden. The monitor will calculate untimed statistics.

Generic data collector monitors

A Generic data collector monitor is used to extract arbitrary numerical data from a CPN during a simulation.

To create such a monitor, apply the Create data collector monitor tool to an appropriate target. After the tool has been applied, a new monitor will be added to the index, and Monitor template code will be generated for the Data Collector Monitoring Functions.

 Generic data collector

A default name for the monitor is suggested, but the name may be changed.

The Timed option under the Type index entry for the monitor determines whether the statistics that are calculated should be timed or untimed statistics. For more information about timed and untimed statistics, see Calculating statistics.

The Monitor template code for the Data Collector Monitoring Functions can be changed in order to obtain the desired behavior for the monitor.

A generic data collector 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.

Related pages