Queue and Facility Statistics in Simulation

Một phần của tài liệu Simulation of industrial systems (1) (Trang 88 - 93)

Using terminology from Chapter 2, the majority of simulation models include two basic nodes: (1) queues where transactions (customers) can wait if necessary and (2) facilities where customers are served. As a result, most simulation languages, particularly those based on the process-oriented approach, automatically produce performance statistics for these two nodes as standard reports. In this section, we describe these statistics and show how they are computed so that the user can inter- pret them more readily. Although a facility diff ers from a queue in that its delay time is usually scheduled by sampling from a service time distribution (the length of stay in a queue is dependent on the state of the system), the nodes share similari- ties that help with interpreting performance statistics.

3.4.3.1 Queue Statistics

For queues, we are normally interested in the following performance measures:

1. Average queue length

2. Average waiting time in queue

We show that these measures can be determined once we know the variation in queue length over the duration of the simulation. A numeric example is used to demonstrate the explanation.

Example 3.11

Figure 3.14 shows a variation in queue length over a simulated period of 25 time units. Because queue length is a time-based variable, the average queue length is

Lq = Area ____

T = 36 ___

20 = 1.8 transactions

To obtain the average waiting time in queue, Wq, note that each unit increment in queue length in Figure 3.14 is equivalent to a trans- action entering the queue. Also, each unit decrement in queue length signifi es queue departure. If we assume a fi rst-in, fi rst-out (FIFO) queue discipline, the individual waiting times of the six transactions that enter the queue can be computed as shown in Figure 3.14; that is, W1 is the waiting time of the fi rst transaction and W6 is the waiting time of the sixth transaction.

Because state changes in queue length occur in discrete units that cor- respond to the transaction entering or leaving the queue, we observe that

W1 + W2 + … + W6 = area under queue length curve As a result, we obtain the average waiting time as:

Wq = _______________________________ sum of waiting times number of transactions entering queue = area ____

6 = 36 ___

6

= 6 time units

Th e above average waiting time calculations apply only to those trans- actions that must wait, (i.e., transactions with positive waiting time).

If we are interested in the average waiting time for all transactions, we must add those with zero wait time to the number of transactions entering the queue.

Th e formula to compute Wq, the average waiting time in queue, actually confi rms the following well-known result from queueing the- ory (see Ref. [6]):

__L q = λ W __q

where λ is the arrival rate of the transactions. We can verify this relationship in terms of the computations given above by observing

Queue length

1 2 3 4

Area = 36

5 10 15 20

Simulation time

W3= 6 W5= 5 W6= 6

W4= 2

W1= 11 W2= 6

Figure 3.14 Plot of queue length versus time.

that given n as the number of transactions entering the queue, we have

__

L q = area ____

T = ( ____ area n ) ( n __ T ) = W __q λ

Notice that when n represents the number of transactions with posi- tive wait time, λ represents the rate at which transactions enter the queue.

On the contrary, when n includes transactions with zero wait time, λ represents the rate at which transactions are generated at the source.

3.4.3.2 Facility Statistics

A facility is designed with a fi nite number of parallel servers. Th e basic performance measures of a facility include

1. Average utilization

2. Average busy time per server 3. Average idle time per server

Average utilization is a time-based variable that measures the average number of busy servers. Busy time per server is measured from the instant the server becomes busy until it again becomes idle. A server’s busy time may span the completion of more than one service depending on the degree of facility utilization. Idle time per server represents uninterrupted periods of idleness for the server. Th e calculation of these measures is demonstrated in the following example.

Example 3.12

In a four-server facility, suppose that the number of busy servers changes with time as shown in Figure 3.15. We want performance measures over a period of 20 time units. As in the computations of queue statistics, we fi rst compute the areas A1 and A2 from which we have

Average utilization = A_______ 1 + A2

20 = 1.55 servers

To compute the average busy time, notice that A1 + A2 is equal to the sum of the busy times of busy servers. Also notice that the number of times the status of servers is changed from idle to busy is fi ve. As a result, we obtain

Average busy time per server = ___________________ sum of busy times

number of observations = A_______ 1 + A2

5

= 31 ___

5 = 6.2 time units

Because idleness is the opposite of busy, the sum of idle times for all servers must equal area A3 in Figure 3.15. Additionally, the number of occurrences of idleness should equal the number of times the servers become busy during a specifi ed simulation period. As a result, we obtain

Average idle time per server = A___ 3

5 = 49 ___

5 = 9.8 time units Example 3.13

In a simulation model, facilities may be arranged in sequence as shown in Figure 3.16. In this case, if all the servers in facility 2 are busy, a transaction completing service in facility 1 will not be able to depart and is blocked. Under blocking conditions, a server in facility 1 is idle and unable to serve another transaction because its “server” in the facility is occupied by the blocked transaction. Facility blocking aff ects the server’s average utilization in the sense that the average facility uti- lization also includes the average number of blocked servers. As a result, it is more appropriate to use the term average gross utilization to refl ect the eff ect of blocking.

5 10 15 20

Simulation time Busy

servers

1 2 3 4

1 2

3

4 5 A1 + A2 = total busy time for all servers

A3 = total idle time for all servers

A3 = 49

A1 = 25 A2= 6

Figure 3.15 Plot of busy servers versus time.

Figure 3.16 Two facilities in sequence.

Facility 1 Facility 2

To illustrate the eff ect of blocking, suppose that there are two serv- ers in each of facility 1 and facility 2. In facility 1, server 1 starts at t = 1 and ends at t = 8, whereas server 2 starts service at t = 4 and terminates at t = 7. Server 1 in facility 2 starts service at t = 0 and terminates it at t = 10, whereas server 2 commences service at t = 2 and completes it at t = 8. Figure 3.17 illustrates the changes in number of busy service for the two facilities.

We can see from Figure 3.17 that although server 2 in facility 1 fi nished at t = 7, it is blocked until t = 8, when server 2 in facility 2 completes the service. Similarly, server 1 in facility 1 fi nishes at t = 8 but is blocked until t = 10, when server 1 of facility 2 becomes idle. At t = 10, we can compute the following statistics for facility 1:

Average blockage = 1 _____ + 2

10 = 0.3 servers Average gross utilization = 9 _____ + 6

10 = 1.5 servers Average net utilization = 1.5 − 0.3 = 1.2 server

You can see that the sum of blockage times in facility 1 is equal to the shaded area in Figure 3.17. Because blockage occurs twice, we obtain

Average blockage time = 1 _____ + 2

2 = 1.5 time units

You may be tempted to think that the average busy time (gross) is equal to the average service time plus the average blockage time. In facility 1 above, we have the average gross busy time equal to 15/2 = 7.5, average service time equal to (7 + 5)/2 = 6.0, and the average blockage time equal to 1.5. Th is observation is true only when every

5 T

10 2

1

Facility 2 5

T = 0 T

T = 0

10 2

1

Facility 1 Busy servers

Figure 3.17 Example of gross facility utilization with blocking.

transaction that completes service in facility 1 experiences a blockage delay before entering facility 2. In general, the number of blockages is less than the number of service completions. In such a case, the sum of average blockage time and average service time should not be equal to the average gross busy time (per server).

Một phần của tài liệu Simulation of industrial systems (1) (Trang 88 - 93)

Tải bản đầy đủ (PDF)

(538 trang)