Queues and Their Properties

Queues are Activity Cycle Diagram (ACD) nodes that hold resources. Resources get there by initialization at the start of simulation, or when instances of activities that precede it finish and release resources. The resources in a Queue are removed from them when Combi activities start (create an instance of themselves) and draw resources from them.

The portion of an ACD below shows a Queue that is initialized with 16 resources. It has two links that lead into it: the Pred activity (could be a Normal or a Combi) which releases 3 resources to the Queue whenever instances of Pred finish; and some other activity from the bottom (not shown) that releases 1 resource whenever its instances finish. Links from Queues can only lead to the Combi activities that draw resources from it. In the ACD below, two Combi activities draw from Queue: the Succ Combi which draws 6 resources whenever it starts, and some other Combi at the right (not shown) which draws 1 resource.


In the ACD above, only the name of the Queue and its initial content are specified in the Queue Properties form. To bring up the the Queue Properties form double-click the Queue. The other information shown is defined by the links that release resources to, or that draw resources from, the Queue.

Queue Statistics

As a simulation proceeds, a Queue collects statistics that are calculated on the basis of a graph of Queue content as a function of simulation time like the one shown below:


The graph above goes from simulation time 0 to simulation time 1.9. Imagine that the graph is drawn by initially setting the pencil down at 0,0 and never lifting it up while drawing as indicated by the arrow heads.

The list below shows the Queue statistics, how they are calculated, and how they can be accessed in formulas (shown in parenthesis below the Queue statistic name). For the calculations it is necessary to know the area under the graph (15.1 res-time units) as well as the area under a graph of the content squared (126.3 res2-time units).

Current Content
The current content is the height of the graph at the pencil’s last position. In the graph above this is 10 res units.
Average Content
The average height of the graph. Obtained by dividing the area under the graph by the simulation time. In the graph above the average content is 15.1/1.9=7.95 res units.
Content Standard Deviation
The standard deviation of the height of the graph. Indicates the variability of the content.  If M denotes the area under a graph of the content squared, the Standard Deviation is sqrt[(M/SimTime)-AveCount2]. In the graph above the standard deviation of the content is sqrt[(126.3/1.9)-7.952]=1.82 res units.
Minimum Content
The height of the graph at its lowest point. Considering the part of the graph after the Queue has been initialized. In the graph above the minimum content is 4 res units.
Maximum Content
The height of the graph at its highest point. In the graph above the maximum content is 16 res units.
Total Content
The total number of resource units that have entered the Queue. Obtained by adding the length of all the “up” movements of the pencil, shown in red in the graph above. The total content of the graph above is 34 res units.
Average Wait
The average time spent by resources in the Queue. This is obtained by dividing the area under the graph by the Queue’s Total Content. The average wait thus considers the time that resources currently in the Queue have been waiting, not just those that have already left. The average wait in the graph above is 15.1/34=0.44 time units.
Last Amount Received
The length of the last “up” movement of the pencil. The last amount received in the graph above is 1 res unit.

Additional Queue Options and Statistics

EZStrobe can collect more detailed statistics about Queues than those mentioned above. If Microsoft Excel is available, EZStrobe can also create a chart of Queue content as a function of time.

The Queue Properties form has two pages. To invoke it, double-click the Queue. The first page, Basic Properties, is shown below.


The Graph population vs time option tells EZStrobe to create a graph of Queue content as a function of time in Excel. This option significantly slows down simulations and the graphs it produces need to be customized in Excel to suit specific needs. However, when selected for Queues whose content over time is of interest, it is very useful. The Queue Statistics Graph shown earlier in this article was customized after EZStrobe initially created it. The graphs produced by EZStrobe include markers for each point and a thick line type, which make these graphs attractive only when they contain a handful of data points. Hiding point markers and reducing the portion of the graph that is visible by adjusting the x-axis properties are typically necessary to make these graphs attractive.

The Collect statistics in bins option tells EZStrobe to collect the data needed for a histogram of Queue content as a function of time. The number of bins specified in the Bins field are created between the From and To values. Underflow and overflow bins are also created. The bin output will appear in the simulation report in the Stroboscope IDE and, for 14 bins between 4 and 18, will look like this:

   Content     TotTime  %Time
    < 4.00        0.00   0.00
    < 5.00        0.05   2.63
    < 6.00        0.15   7.89
    < 7.00        0.50  26.32
    < 8.00        0.85  44.74
    < 9.00        1.05  55.26
   < 10.00        1.40  73.68
   < 11.00        1.80  94.74
   < 12.00        1.90 100.00
   < 13.00        1.90 100.00
   < 14.00        1.90 100.00
   < 15.00        1.90 100.00
   < 16.00        1.90 100.00
   < 17.00        1.90 100.00
   < 18.00        1.90 100.00
  >= 18.00        0.00   0.00

The output above indicates, for example, that the percentage of time that the Queue contained less than 7 resources was 26.32%, and that the total time that the Queue content was greater than or equal to 7 but less than 8 was 0.85-0.50=0.35 time units.

Integral Statistics

The second page of the Queue Properties form, Integral Statistics, is for the collection of statistics for the Queue on the basis of a larger unit than that modeled by the Queue. The Integral Statistics page for the model used in Multi-Step Activities in EZStrobe – Non Identical or Non Consecutive Steps is shown below. Please see that article for detailed explanation of Integral Statistics. In essence, rather than plotting Queue content as a function of time, Integral Statistics graph the integer part of the Queue content after it has been divided by a Divisor.


EZStrobe is based upon work supported by the National Science Foundation under Grant No. 9733267. Any opinions, findings, and conclusions or recommendations are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.