Вы находитесь на странице: 1из 6

Example: Single-Channel Queue A small grocery store has only one checkout counter.

Customers arrive at this checkout counter at random from 1 to 8 minutes apart. Each possible value of interarrival time has the same probability of occurrence as 0.125. The service times vary from 1 to 6 minutes with the probabilities shown in the table. The problem is to analyze the system by simulating the arrival and service of 20 customers. DISTRIBUTION OF TIME BETWEEN ARRIVALS Time Probability Cumulative Random between Probability digit Arrivals assignment (minutes) 1 2 3 4 5 6 7 8 0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.250 0.375 0.500 0.625 0.750 0.875 1.000 001 126 251 376 501 626 751 876 125 250 375 500 625 750 875 000 SERVICE-TIME DISTRIBUTION Service Probability Cumulative Random Time Probability digit (minutes) assignment 1 2 3 4 5 6 0.10 0.20 0.30 0.25 0.10 0.05 0.10 0.30 0.60 0.85 0.95 1.00 01 11 31 61 86 96 10 30 60 85 95 00

TIME-BETWEEN-ARRIVAL DETERMINATION
Customer Random digits Time between Arrivals (minutes) 8 6 1 8 3 8 7 2 3 Customer Random digits Time between Arrivals (minutes) 1 1 5 6 3 8 1 2 4 5

1 2 3 4 5 6 7 8 9 10

913 727 015 948 309 922 753 235 302

11 12 13 14 15 16 17 18 19 20

109 093 607 738 359 888 106 212 493 535

SERVICE TIME GENERATED


Customer Random digits 1 2 3 4 5 6 7 8 9 10 84 10 74 53 17 79 91 67 89 38 Service Time (minutes) 4 1 4 3 2 4 5 4 5 3 Customer Random digits 32 94 79 05 79 84 52 55 30 50 Service Time (minutes) 3 5 4 1 5 4 3 3 2 3

11 12 13 14 15 16 17 18 19 20

SIMULATION TABLE FOR QUEUING PROBLEM


Customer Time since last arrival (minutes) Arrival time Service time (minutes) Time service begins Time customer waits in queue (minutes) 0 0 0 3 0 0 0 0 2 4 6 8 8 6 4 1 4 5 4 1 56 Time service ends Time customer spends in system (minutes) 4 1 4 6 2 4 5 4 7 7 9 13 12 7 9 5 7 8 6 4 124 Idle time of server (minutes)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

8 6 1 8 3 8 7 2 3 1 1 5 6 3 8 1 2 4 5

0 8 14 15 23 26 34 41 43 46 47 48 53 59 62 70 71 73 77 82

4 1 4 3 2 4 5 4 5 3 3 5 4 1 5 4 3 3 2 3 68

0 8 14 18 23 26 34 41 45 50 53 56 61 65 66 71 75 78 81 83

4 9 18 21 25 30 39 45 50 53 56 61 65 66 71 75 78 81 83 86

0 4 5 0 2 1 4 2 0 0 0 0 0 0 0 0 0 0 0 0 18

Some of the findings from this short term simulation are as follows: 1. The average waiting time for a customer is 2.8 minutes. This is determined in the following manner: Average waiting time (minutes) = Total time customers wait in queue (minutes) Total number of customers = 56 = 2.8 minutes 20 2. The probability that a customer has to wait in the queue is 0.65. This is determined in the following manner: Probability (wait) = number of customers who wait Total number of customers = 13/20 =0.65 3. The proportion of idle time of the server is 0.21. This is determined in the following manner: Probability of idle server = total run time of server (minutes) Total run time of simulation (minutes) = 18 / 86 = 0.21 The probability of the server being busy is the complement of 0.21, or 0.79. 4. The average service time is 3.4 minutes. This is determined in the following manner: Average service time (minutes) = total service time (minutes) Total number of customers = 68 / 20 = 3.4 minutes

This result can be compared with the expected service time by finding the mean of the service-time distribution using the equation E (S) = sp(s) Applying the expected value equation to the distribution in SERVICE-TIME DISTRIBUTION table gives Expected service time = 1(0.10)+2(0.20)+3(0.30)+4(0.25)+5(0.10)+6(0.05) = 3.2 minutes The expected service time is slightly lower than the average service time in the simulation. The longer the simulation, the closer the average will be to E(S). 5. The average time between arrivals is 4.3 minutes. This is determined in the following manner: Average time between arrivals (minute) = Sum of all times between arrivals (minutes) Number of arrivals 1 = 82 / 19 = 4.3 minutes One is subtracted from the denominator because the first arrival is assumed to occur at time 0. This result can be compared to the expected time between arrivals by finding the mean of the discrete uniform distribution whose end points are a=1 & b=8. The mean is given by E(A) = a+b = (1+8)/2 = 4.5 minutes 2 The expected time between arrivals is slightly higher than the average. However, in a longer simulation the average value of the time between arrivals should approach the theoretical mean, E(A).

6. The average waiting time of those who wait is 4.3 minutes. This is determined in the following manner: Average waiting time of those who wait (minute) = Total time customers wait in queue (minutes) Total number of customers = 56 / 13 = 4.3 minutes 7. The average time a customer spends in the system is 6.2 minutes. This can be determined in 2 ways. First, the computation can be achieved by the following relationship: Average time customer spends in the system (min) = Total time customer spends in the system (min) Total number of customers = 124 / 20 = 6.2 minutes The 2nd way of computing the same result is to realize that the following relationship must hold: Average time customer spends in the system (min)=Average time customer spends waiting in the queue (min) + Average time customer spends in service (min) Findings 1 & 4 of the list above provide the data for the right hand side of this equation to give the following: Average time customer spends in the system (min)= 2.8 + 3.4 = 6.2 minutes

Вам также может понравиться