Simulation Modeling
Simulation of Queuing System
Example 1: Simulation of Queuing System
People arrive at the New Delhi Railway station to buy tickets according to the following distribution.
Inter-arrival Time (Min.) | Frequency |
2 | 10 |
3 | 20 |
4 | 40 |
5 | 20 |
6 | 10 |
The service time is 5 minutes and there is only one ticket counter. The Railway station incharge is interested in predicting the operating characteristics of this counter during a typical operating day from 10.00 a.m. to 11.00 a.m. Use simulation to determine the average waiting time before service and average time a person spends in the system.
Solution.
From the given distribution of arrivals, the random numbers can be assigned to the arrival times as shown in table 1.
Table 1
Inter-arrival Time (Min.) |
Frequency | Probability | Cumulative Probability |
R.No. |
2 | 10 | 0.10 | 0.10 | 0 – 09 |
3 | 20 | 0.20 | 0.30 | 10 – 29 |
4 | 40 | 0.40 | 0.70 | 30 – 69 |
5 | 20 | 0.20 | 0.90 | 70 – 89 |
6 | 10 | 0.10 | 1.00 | 90 – 99 |
The first random number generated is 17, which corresponds to the inter-arrival time of 3 minutes. This implies that the first person arrives 3 minutes after the service window opens, as shown in table 2. Since the first person arrives at 10.03 a.m., therefore, the server has to wait for 3 minutes. The server takes 5 minutes and thus, the first person leaves the system at 10.08 a.m. (10.03 + .05). Similarly, other values can be calculated.
Table 2
S.No. | R.No. | Inter- Arrival Time |
Arrival Time |
Service Starts | Service Ends |
Waiting Time | |
Server | Person | ||||||
1 | 17 | 3 | 10.03 | 10.03 | 10.08 | 3 | – |
2 | 86 | 5 | 10.08 | 10.08 | 10.13 | – | – |
3 | 84 | 5 | 10.13 | 10.13 | 10.18 | – | – |
4 | 79 | 5 | 10.18 | 10.18 | 10.23 | – | – |
5 | 33 | 4 | 10.22 | 10.23 | 10.28 | – | 1 |
6 | 55 | 4 | 10.26 | 10.28 | 10.33 | – | 2 |
7 | 6 | 2 | 10.28 | 10.33 | 10.38 | – | 5 |
8 | 42 | 4 | 10.32 | 10.38 | 10.43 | – | 6 |
9 | 93 | 6 | 10.38 | 10.43 | 10.48 | – | 5 |
10 | 38 | 4 | 10.42 | 10.48 | 10.53 | – | 6 |
11 | 58 | 4 | 10.46 | 10.53 | 10.58 | – | 7 |
12 | 71 | 5 | 10.51 | 10.58 | 11.03 | – | 7 |
Total | 39 |
Average waiting time before service.
= Total waiting time (person)/Total no. of arrivals
= 39/12 = 3.25 minutes.
Average time a person spends in the system.
= Service time + Average waiting time before service
= 5 + 3.25 = 8.25 minutes.
Simulation and Inventory Control
Zicom Electronics wants to determine the order size for calculators. The demand and lead time are probabilistic and their distributions are given below:
Demand / week (thousands) | Probability | Lead time | Probability |
0 | 0.2 | 2 | 0.3 |
1 | 0.4 | 3 | 0.4 |
2 | 0.3 | 4 | 0.3 |
3 | 0.1 |
The cost of placing an order is Rs. 100 per order and the holding cost for 1000 calculators is Rs. 2 per week. The shortage cost is Rs. 20 per thousand. Whenever the inventory level is equal to or below 2000, an order is placed equal to the difference between the current inventory balance and specified maximum replenishment level equal to 4000.
Simulate the policy for 10 weeks. Assume the following
- the beginning inventory is 3000 units
- no back orders are permitted
- each order is placed at the beginning of the week following the drop in inventory level to (or below) the reorder point
- the replenishment orders are received at the beginning of the week.
Solution.
Using the daily demand and lead time distributions, we assign a set of random numbers to represent the range of values of variables as shown in table 1 & table 2.
Table 1
Demand / week (thousands) | Probability | Cumulative Probability | Random Numbers |
0 | 0.2 | 0.2 | 00-19 |
1 | 0.4 | 0.6 | 20-59 |
2 | 0.3 | 0.9 | 60-89 |
3 | 0.1 | 1.0 | 90-99 |
Table 2
Lead time (weeks) | Probability | Cumulative Probability | Random Numbers |
2 | 0.3 | 0.3 | 00-29 |
3 | 0.4 | 0.7 | 30-69 |
4 | 0.3 | 1.0 | 70-99 |
At the start of simulation, the first random number 31 generates a demand of 1000 units, as shown in table 3. The demand is determined from the cumulative probability values in table 1. At the end of first week, the closing balance is 2000 units, which is equal to the reorder level; therefore, an order for 2000 (4000-2000) units is placed. The random number generated is 29, so the lead time is 2 weeks. The lead time is determined from the cumulative probability values in table 2. Since closing balance is 2000 units, the holding cost is Rs. 4
In the second week, the random number 70 generates a demand of 2000 units. Therefore, the closing balance at the end of second week is reduced to zero units.
In the third week, the demand for 1000 units can’t be fulfilled because the available inventory is zero. This results in the shortage cost of Rs. 20.
The 2000 units ordered in the first week are received at the beginning of fourth week. The random number 86 generates a demand of 2000 units, and, hence closing stock is zero. Therefore, an order for 4000 (4000-0) units is placed. The random number generated is 83, so the lead time is 4 weeks. Therefore, the second shortage occurs in the fifth week. The units ordered at the end of fourth week are received in the beginning of ninth week.
Table 3
Week | Opening Balance Inventory (‘000) | Demand | Closing Balance Inventory (‘000) | Lead Time | Quantity Ordered (‘000) | Costs | |||
Random Numbers | Units (‘000) |
Random Numbers | Weeks | Holding Cost (Rs.) | Shortage Cost (Rs.) | ||||
1 | 3 | 31 | 1 | 2 | 29 | 2 | 2 | 4 | – |
2 | 2 | 70 | 2 | 0 | – | – | – | – | – |
3 | 0 | 53 | 1 | -1 | – | – | – | – | 20 |
4 | 2* | 86 | 2 | 0 | 83 | 4 | 4 | – | – |
5 | 0 | 32 | 1 | -1 | – | – | – | – | 20 |
6 | 0 | 78 | 2 | -2 | – | – | – | – | 40 |
7 | 0 | 26 | 1 | -1 | – | – | – | – | 20 |
8 | 0 | 64 | 2 | -2 | – | – | – | – | 40 |
9 | 4* | 45 | 1 | 3 | – | – | – | 6 | – |
10 | 3 | 12 | 0 | 3 | – | – | – | 6 | – |
Total | 13 | 6 |
Note: * includes order quantity just received.
Average Inventory = 8000/10 = 800 units.
The average inventory is calculated by adding the closing inventory balances (ignoring negative balances) and dividing by the number of weeks.
Weekly average cost = Ordering Cost + Inventory Holding Cost + Shortage Cost
Ordering Cost = (100 X 2)/10
= Rs. 20
Inventory Holding Cost = (800 X 2)/1000
= Rs. 1.60
Shortage Cost = [20 X (1 + 1 + 2 + 1 + 2)]/10 = Rs. 14
Weekly average cost = Rs. 20 + Rs. 1.60 + Rs. 14
= Rs. 35.60
It should be noted that the shortage cost is high as compared to holding cost. The shortage cost can be reduced by increasing the reorder level.
Average lead time = 6/2 = 3 weeks
Average demand per week = 13000/10 = 1300 units
Average demand during lead time = 3 X 1300 = 3900 units
Maximum lead time = 4 weeks
Maximum weekly demand = 2000 units
Maximum demand during lead time = 4 x 2000 = 8000 units
Thus, the best reorder point should be somewhere between 3900 to 8000 units.
2 Comments »