Simulation and Modelling 6 Examples of Queueing Systems

  • Slides: 13
Download presentation
Simulation and Modelling (6) Examples of Queueing Systems Simulation (more than one server) Prof.

Simulation and Modelling (6) Examples of Queueing Systems Simulation (more than one server) Prof. Moheb Ramzy Girgis Department of Computer Science Faculty of Science Minia University

Example: The Able-Baker Carhop Problem n n This example illustrates the simulation procedure when

Example: The Able-Baker Carhop Problem n n This example illustrates the simulation procedure when there are more than one server. Consider a drive-in restaurant where carhops take orders and bring food to the car. Cars arrive in the manner shown in Table 3. 5. Time Table 3. 5. Interarrival Distribution of Cars n Between Cumulative Probability Arrivals Probability (Minutes) 1 0. 25 2 0. 40 0. 65 3 0. 20 0. 85 4 0. 15 1. 00 Random Digit Assignment 01 – 25 26 – 65 66 – 85 86 – 00 There are two carhops – Able and Baker. Able works a bit faster than baker. The distribution of their service times is shown in Tables 3. 6 and 3. 7. Modeling & Simulation - Prof. Moheb Ramzy Girgis Dept. of Computer Science - Faculty of Science Minia University 2

Example: The Able-Baker Carhop Problem Table 3. 6. Service Time Distribution of Able Service

Example: The Able-Baker Carhop Problem Table 3. 6. Service Time Distribution of Able Service Time Probability (Minutes) 2 0. 30 3 0. 28 4 0. 25 5 0. 17 Table 3. 7. Service Time Distribution of Baker Service Time Cumulative Probability (Minutes) Probability 3 0. 35 4 0. 25 0. 60 5 0. 20 0. 80 6 0. 20 1. 00 n Cumulative Probability 0. 30 0. 58 0. 83 1. 00 Random Digit Assignment 01 – 30 31 – 58 59 – 83 84 – 00 Random Digit Assignment 01 – 35 36 – 60 61 – 80 81 – 00 The problem is to find how well the current arrangement is working. To estimate the system measures of performance, a simulation of 1 hour of operation is made. Modeling & Simulation - Prof. Moheb Ramzy Girgis Dept. of Computer Science - Faculty of Science Minia University 3

Example: The Able-Baker Carhop Problem n n n The simulation proceeds in a manner

Example: The Able-Baker Carhop Problem n n n The simulation proceeds in a manner similar to Example 3. 1, except that it is more complex because of the two servers. A simplifying rule is that Able gets the customer if both carhops are idle. Perhaps, Able has seniority. (The simulation would be different if the decision were made at random or by any other rule). Here there are more events: q a customer arrives, q a customer completes service from Able, and q a customer completes service from Baker. Modeling & Simulation - Prof. Moheb Ramzy Girgis Dept. of Computer Science - Faculty of Science Minia University 4

Example: The Able-Baker Carhop Problem n The simulation table consists of the following columns:

Example: The Able-Baker Carhop Problem n The simulation table consists of the following columns: A B C D E Customer No. R. D. for Arrival Time Between Arrivals Clock Time of Arrival R. D. for Service 1 2 n Here we provide a few hints for implementing the simulation table in Excel: I Time Service Begins F G Able H Time Service Time Begins Ends J Baker Service Time K L Time Service Ends Time in Queue Ø The row for the first customer is filled in manually, with the random-number function RAND(). Ø After the first customer, the cells for other customers must be based on logic and formulas. Modeling & Simulation - Prof. Moheb Ramzy Girgis Dept. of Computer Science - Faculty of Science Minia University 5

Customer No. 1 2 3 4 5 6 7 8 9 10 11 12

Customer No. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 R. D. for Arrival 26 98 90 26 42 74 80 68 22 48 34 45 24 34 63 38 80 42 56 89 18 51 71 16 92 Time Between Arrivals Clock Time of Arrival R. D. for Service 2 4 4 2 2 3 3 3 1 2 2 2 3 2 2 4 1 2 3 1 4 0 2 6 10 12 14 17 20 23 24 26 28 30 31 33 35 37 40 42 44 48 49 51 54 55 59 95 21 51 92 89 38 13 62 50 49 39 53 88 1 81 53 81 64 1 67 1 47 75 57 87 47 Able Time Service Begins 0 Baker 5 Time Service Ends 5 6 10 3 5 9 15 15 18 20 3 2 4 18 20 24 Service Time 24 27 3 3 27 30 30 5 35 35 39 43 45 49 4 4 2 4 3 Time Service Begins Service Time Service Ends 2 3 5 12 6 18 23 4 27 28 4 32 32 3 35 35 4 39 40 5 45 48 3 51 51 5 56 56 6 62 39 43 45 49 52 54 3 57 59 3 56 62 Modeling & Simulation - Prof. Moheb Ramzy Girgis Dept. of Computer Science - Faculty of Science Minia University Time in Queue 0 0 0 1 1 0 0 0 1 2 0 1 1 0 0 1 0 43 6

Customer No. 1 2 3 4 5 6 7 8 9 10 11 12

Customer No. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 R. D. for Arrival 26 98 90 26 42 74 80 68 22 48 34 45 24 34 63 38 80 42 56 89 18 51 71 16 92 Time Between Arrivals Clock Time of Arrival R. D. for Service 2 4 4 2 2 3 3 3 1 2 2 2 3 2 2 4 1 2 3 1 4 0 2 6 10 12 14 17 20 23 24 26 28 30 31 33 35 37 40 42 44 48 49 51 54 55 59 95 21 51 92 89 38 13 62 50 49 39 53 88 1 81 53 81 64 1 67 1 47 75 57 87 47 Able Time Service Begins 0 Baker 5 Time Service Ends 5 6 10 3 5 9 15 15 18 20 3 2 4 18 20 24 Service Time 24 27 3 3 27 30 30 5 35 35 39 43 45 49 4 4 2 4 3 Time Service Begins Service Time Service Ends 2 3 5 12 6 18 23 4 27 28 4 32 32 3 35 35 4 39 40 5 45 48 3 51 51 5 56 56 6 62 39 43 45 49 52 54 3 57 59 3 56 62 Modeling & Simulation - Prof. Moheb Ramzy Girgis Dept. of Computer Science - Faculty of Science Minia University Time in Queue 0 0 0 1 1 0 0 0 1 2 0 1 1 0 0 1 0 43 7

Example: The Able-Baker Carhop Problem For example, the "Clock Time of Arrival" (column D)

Example: The Able-Baker Carhop Problem For example, the "Clock Time of Arrival" (column D) in the row for the second customer is computed as follows: D 4 = D 3 + C 4, where C 4 is the time between arrivals 1 and 2. This formula is easy generalized for any customer. (Note that Customer 1 is in Row 3). Ø The logic to compute who gets a given customer, and when that service begins, goes as follows: When a customer arrives: if Able is idle then // Di >= MAX(H 3 : Hi-1) the customer begins service immediately with Able // Fi = Di else if Baker is idle then // Di >= MAX(K 3 : Ki-1) the customer begins service immediately with Baker // Ii = Di else if both are busy then the customer begins service with first server to become free Modeling & Simulation - Prof. Moheb Ramzy Girgis Dept. of Computer Science - Faculty of Science Minia University 8

Example: The Able-Baker Carhop Problem Ø To compute when Able and Baker will become

Example: The Able-Baker Carhop Problem Ø To compute when Able and Baker will become free, the Excel functions IF() and MAX() are used. For example, for customer 10, Able will become free at MAX(H 3: H 11), since service completion time is in column H and we need to look at customers 1 – 9. The resulting formula to compute whether and when Able serves customer 10 is as follows: F 12 = IF(D 12 >= MAX(H 3: H 11); D 12; IF(MAX(H 3: H 11) <= MAX(K 3: K 11); MAX(H 3: H 11); "")) Based on this logic, the time Able begins service customer i (column F) is computed as follows: Fi+2 = IF(Di+2 >= MAX(H 3 : Hi+1); Di+2; IF(MAX(H 3: Hi+1) <= MAX(K 3: Ki+1); MAX(H 3: Hi+1); "")) Modeling & Simulation - Prof. Moheb Ramzy Girgis Dept. of Computer Science - Faculty of Science Minia University 9

Example: The Able-Baker Carhop Problem Ø Similarly, the time Baker begins service customer i

Example: The Able-Baker Carhop Problem Ø Similarly, the time Baker begins service customer i (column I) is computed as follows: Ii+2 = IF(Fi+2 <> ""; IF(Di+2 >= MAX(K 3: Ki+1); Di+2; MAX(K 3: Ki+1))) Ø The service times for Able are computed as follows: Gi+2 = IF(Fi+2 > 0; new_service_time; "") where new_service_time is computed by using the service time distribution of Able (Table 3. 6). The time service ends is computed as follows: Hi+2 = IF(Fi+2 > 0; Fi+2 + Gi+2; "") Ø Similarly, the service times and the time service ends for Baker are computed. Modeling & Simulation - Prof. Moheb Ramzy Girgis Dept. of Computer Science - Faculty of Science Minia University 10

Example: The Able-Baker Carhop Problem n 1 2 3 4 5 6 The interarrival

Example: The Able-Baker Carhop Problem n 1 2 3 4 5 6 The interarrival and service times distribution tables as they appear in the excel sheet. Service Time Distribution of Able P Q R Service Time Cumulative Probability (Minutes) Probability 2 0. 30 3 0. 28 0. 58 4 0. 25 0. 83 5 0. 17 1. 00 1 2 3 4 5 6 Interarrival Distribution of Cars M N O Time Between Cumulative Arrivals Probability (Minutes) 1 0. 25 2 0. 40 0. 65 3 0. 20 0. 85 4 0. 15 1. 00 Service Time Distribution of Baker S T U 1 Service Time Cumulative Probability 2 (Minutes) Probability 3 3 0. 35 4 4 0. 25 0. 60 5 5 0. 20 0. 80 6 6 0. 20 1. 00 Modeling & Simulation - Prof. Moheb Ramzy Girgis Dept. of Computer Science - Faculty of Science Minia University 11

Example: The Able-Baker Carhop Problem Formulas for calculating the time between arrivals and service

Example: The Able-Baker Carhop Problem Formulas for calculating the time between arrivals and service times of Able and Baker for Customer i in Row i+2 in the Excel sheet. Time Between Arrivals: Ci+2=IF(Bi+2/100>O 5; M 6; IF(Bi+2/100>O 4; M 5; IF(Bi+2/100>O 3; M 4; M 3))) Service Time of Able: Gi+2=IF(Fi+2<>""; IF(Ei+2/100>R 5; P 6; IF(Ei+2/100>R 4; P 5; IF(Ei+2/100>R 3; P 4; P 3))); "") Service Time of Baker: Ji+2=IF(Ii+2<>""; IF(Ei+2/100>U 5; S 6; IF(Ei+2/100>U 4; S 5; IF(Ei+2/100>U 3; S 4; S 3))); "") n Modeling & Simulation - Prof. Moheb Ramzy Girgis Dept. of Computer Science - Faculty of Science Minia University 12

Example: The Able-Baker Carhop Problem The analysis of the simulation table results in the

Example: The Able-Baker Carhop Problem The analysis of the simulation table results in the following: n Over the 62 -minute period Able was busy 90% of the time, while Baker was busy only 69% of the time. n Nine of the 26 arrivals (about 35%) had to wait. The average waiting time for all customers was only about 0. 42 minutes (25 seconds), which is very small. n These 9 who had to wait, only waited an average of 1. 22 minutes, which is quite low. n In summary, this system seems well balanced. One server cannot handle all the diners, and three servers would probably be too many. Adding and additional server would surely reduce the waiting time to nearly 0. However, the cost of waiting would have to be quite high to justify an additional server. Modeling & Simulation - Prof. Moheb Ramzy Girgis Dept. of Computer Science - Faculty of Science Minia University 13