|
Loading
|
||||
Queue system queue lengthA number of monitors for the Queue system example net illustrate different ways in which the length of the queue of jobs can be measured. List_length_dc_System'Queue_1This monitor is a list length monitor, and it is used to calculate the length of the list that represents the queue of jobs.
This monitor was created by applying the Create List Length Monitor tool to the Queue Length
This monitor is a generic data collector monitor that is also used to calculate the length of the queue of jobs. The monitor is associated with the place
This monitor will measure the length of the list on the place Predicate function
The predicate function is invoked each time the
fun pred (bindelem, Server'Queue_1_mark : Jobs ms) =
let
fun predBindElem (Server'Start (1, {jobs, job,proctime})) = true
| predBindElem (Arrivals'Arrive (1, {jobs, job})) = true
| predBindElem _ = false
in
predBindElem bindelem
end
The predicate function can examine the marking of the Observation function
The observation function will be invoked whenever one of the transitions surrounding the place fun obs (bindelem, Server'Queue_1_mark : Jobs ms) = length(ms_to_col(Server'Queue_1_mark))
Whenever it is invoked, this observation function examines the marking of the place
The observation function can examine the transitions that surround the place Initialization and stop functions
The initialization and stop functions are similar to the observation function, however they return integer option values. The initialization function will be invoked once before a simulation starts, and it will return the value fun init (Server'Queue_1_mark : Jobs ms) = SOME (length(ms_to_col(Server'Queue_1_mark))) fun stop (Server'Queue_1_mark : Jobs ms) = SOME (length(ms_to_col(Server'Queue_1_mark))) Queue length advancedThis monitor is similar to the “Queue Length” monitor. The statistics that are calculated for this monitor will be the same as those for the “Queue Length” monitor. The difference between the two monitors is that fewer data values are collected for this monitor.
The monitor is associated with two places and two transitions. It is associated with the nodes that are associated with the “Queue Length” monitor as well as the place When a job is added to the empty queue and the server is idle, the job will be immediately removed from the queue. This means that the length of the queue will change from 0 to 1 to 0 at the same model time. In other words, in these situations, the length of the queue will be 1 for 0 units of time. This monitor avoids measuring the length of the queue when a job is added to the empty queue and the server is idle. The figure below shows the differences in the data values that are collected by this monitor and the “Queue Length” monitor. Predicate function
The predicate function for this monitor is the only monitoring function that is different from the monitoring functions for the “Queue Length” monitor. Lines 6-7 below ensure that data will not be collected when the
fun pred (bindelem, Server'Idle_1_mark : Server tms,
Server'Queue_1_mark : Jobs ms) =
let
fun predBindElem (Server'Start (1, {jobs, job,proctime})) = true
| predBindElem (Arrivals'Arrive (1, {jobs, job})) =
not((length(ms_to_col(Server'Queue_1_mark))=1) andalso
(size Server'Idle_1_mark=1))
| predBindElem _ = false
in
predBindElem bindelem
end
Queue length NoInitNoStopThis monitor is similar to the “Queue Length” monitor. However, it is different in that the initialization and stop functions return the value NONE. In other words, this monitor does not measure the length of the queue of jobs before a simulation starts or when a simulation stops because Simulation stop criteria are fulfilled.
The statistics for this monitor will be slightly different from those for the “Queue Length” monitor because this monitor ignores the fact that the length of the queue is 0 from time 0 until the first time the transition Queue length NoInitThis monitor is similar to the “Queue Length” monitor. However, it is different in that the initialization function returns the value NONE. In other words, this monitor does not measure the length of the queue of jobs before a simulation starts. As compared to the “Queue Length NoInitNoStop” monitor, this monitor may collect at additional data values, namely the values returned by the stop function when simulation stop criteria are fulfilled. The statistics for this monitor will always be exactly the same as those for the “Queue Length NoInitNoStop” monitor. Queue length NoStopThis monitor is also similar to the “Queue Length” monitor. However, it is different in that the stop function returns the value NONE. In other words, this monitor does not measure the length of the queue of jobs when simulation stop criteria are fulfilled. As compared to the “Queue Length” monitor, this monitor may collect fewer data values, namely because the stop function does not return a data value when simulation stop criteria are fulfilled. The statistics for this monitor will always be exactly the same as those for the “Queue Length” monitor. If the stop function for the “Queue Length” monitor is invoked because simulation stop criteria are fulfilled, then a plot of the data from this monitor will differ slightly from a plot of the data from the “Queue Length” monitor.
Here is an example of the data that is collected by the two monitors during a simulation that stops as soon as the Related pagesQueue system example, Queue system queue delay, Queue System Server Utilization, Queue System Miscellaneous Monitors |
||||