• No results found

3.4 Quality Assessment

3.4.1 Experiment

The M/M/1 queueing system consists of an unbounded queue for storing received tokens and a single server to process these tokens. Assume that the parameter for the exponentially distributed inter-arrival time of the tokens is λ and that the parameter for the exponentially distributed processing time is µ. Then, for λ < µ, the M/M/1 queueing system implies an ergodic (embedded) Markov chain of which all states are recurrent [102]. Now, let N denote the number of tokens in the system, i.e., the number of tokens in the unbounded queue plus the one being processed by the server. Two important performance metrics for the M/M/1 queueing system are E[N] and var[N], which are given by [5, 102]

E[N] = µ − λλ = ρ 1 − ρ and var[N ] = µλ (µ − λ)2 = ρ (1 − ρ)2

where ρ = λµ is called the load. Two other important performance metrics for the M/M/1 queueing system are related to the sojourn time w for tokens. The so- journ time of a token is the time between entering the queue and leaving the sys- tem after being processed by the server and hence, it equals the time that the token spends waiting in the queue plus its processing time. Due to the exponentially dis- tributed inter-arrival and processing times, the sojourn time is again exponentially distributed and the parameter of this exponential distribution is µ(1−ρ) [31]. Hence, the expected valueE[w] and variance var[w] of the sojourn time are given by

E[w] = µ − λ1 = 1 µ(1 − ρ) and var[w] = 1 (µ − λ)2 = 1 µ2(1 − ρ)2

respectively. Table 3.3 shows some numerical performance results for different loads. To analyse the coverage of the Confidence Intervals underlying the POOSL library classes for accuracy analysis, a model of the M/M/1 queueing system has been de- veloped. A screen dump of this model in the SHESim tool is depicted in figure 3.17.

λ µ ρ E[N] var[N] E[w] var[w] 1 10 0.1 1/9 10/81 1/9 1/81 1 5 0.2 1/4 5/16 1/4 1/16 3 10 0.3 3/7 30/49 1/7 1/49 2 5 0.4 2/3 10/9 1/3 1/9 1 2 0.5 1 2 1 1 3 5 0.6 3/2 15/4 1/2 1/4 7 10 0.7 7/3 70/9 1/3 1/9 4 5 0.8 4 20 1 1 9 10 0.9 9 90 1 1

Table 3.3: True performance of the M/M/1 queueing system for different λ and µ.

The model includes the processesSender,BufferandReceiver. After creating

a new token, theSenderwaits with actually sending it to theBufferuntil having

delayed for a time that is exponentially distributed with parameter λ. To this end, the

Senderincludes an instance variable of data classExponentialfrom the library

for modelling distributions, see section 3.1.1. TheBufferprocess, which models the

M/M/1 queueing system, contains an instance variable of a container data class (see also section 4.3.1)Queue, which represents an unbounded queue. The behaviour of

Bufferis defined by two independent concurrent activities as proposed in example

3.5 on page 77. One activity is concerned with receiving tokens from theSender

and putting them in theQueue. Whenever there is a token in theQueue, the other

activity models the processing of it by delaying for an exponentially distributed time with parameter µ. Only after having delayed, this activity removes the token from

theQueueand sends it to theReceiver. To model the processing time,Buffer

also contains an instance variable of classExponential. The actual sending and

receiving of tokens by the concurrent activities is performed instantaneously. Because of keeping the tokens in theQueue while they are being processed, the

occupancy of theQueue equals the number of tokens in the system. Hence, the

time-averageQueueoccupancy and the time-variance in theQueueoccupancy con-

verge almost surely to E[N] and var[N] respectively. Observe that these perfor- mance metrics concern a conditional long-run time average and variance respec- tively, where the condition for both is putting or removing a token from theQueue

(see also example 2.11 on page 52). Moreover, the sample-average duration of being in theQueueand the sample-variance in this duration converges almost surely to

E[w] and var[w] respectively. These performance metrics concern a conditional long- run sample average and variance respectively, where the condition for both is the completion of the processing of a token (see also example 2.10 on page 50). Remark that an alternative for this condition is the removal of a token from theQueue.

To estimate the identified performance metrics, the POOSL model is extended with eight performance monitors. Each of the four performance metrics is estimated with both the technique of regenerative cycles and the batch-means technique. To ap- ply the technique of regenerative cycles, the situation of the Queuebeing empty

is used as recurrence condition for all performance metrics. Notice that this recur- rence condition is appropriate for estimatingE[N] and var[N] (see also example 3.5). However, using the emptiness of theQueueas recurrence condition for estimating

E[w] and var[w] is actually not advisable. This is because the emptiness of theQueue

does not represent the completion of processing a token that took a specific time and hence, the state in whichQueueis empty does not necessarily imply a relevant re- current state for the implied reduced Markov chain (i.e., the Markov chain that is

obtained after reducing the Markov chain defined by the POOSL model with respect to the condition of completing the processing of a token). Nevertheless, the empti- ness of theQueueis still used as recurrence condition because it is not evident which

processing time is suitable for defining a recurrence condition. For the batch-means technique, a default batch size as provided by the monitor classes is used.

To obtain a number of confidence intervals for each of the eight performance mon- itors (with which the coverage of their underlying Confidence Intervals can be es- timated), some further extensions to the model are needed. These extensions allow to reset the M/M/1 queueing system by re-initialising theQueue, all performance

monitors and both instances ofExponential. Recall that initialising an instance

ofExponentialinvolves the creation of a random number generator. Since the

library classes for distributions rely onrandomiseSeedto initialise such random

number generators, the simulation subruns will be independent (see also appendix B). The actual coverage analysis is performed for each of the combinations of λ and µ indicated in table 3.3 as follows. Each coverage metric can be considered as a condi- tional long-run sample average, where the reward value is 1 if the true performance value is indeed in the obtained confidence interval and 0 if it is not. The condition for this metric is the completion of a simulation subrun. Since the simulation subruns are independent, this condition may also serve as recurrence condition for applying the technique of regenerative cycles. Hence, an additional eight performance moni- tors of classLongRunSampleAverageare introduced, which will be referred to as

the coverage monitors. A reward value (0 or 1) is registered for a coverage monitor with methodrewardRCat the moment that the estimation results for the accom-

panying performance metric are being considered accurate for the first time9. If all

estimation results are considered to be accurate, then the current simulation subrun is terminated and the M/M/1 queueing system is reset as described above. The cri-

terium for terminating a simulation subrun is that all eight performance monitors have an accuracy of at least 0.95 (for a confidence level of 0.95). Each time a simula- tion subrun is terminated, the intermediate coverage results are logged to file as well. When a minimum of 500 simulation subruns have been performed10 and all cover-

age results are considered to be accurate, then the coverage analysis is completed. The decision of whether the coverage results are accurate is based on initialising all eight coverage monitors with a desired confidence level and accuracy bound of 0.95.