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|
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.
From the given distribution of arrivals, the random numbers can be assigned to the arrival times as shown in table 1.
|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.
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|
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.
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.
|Demand / week (thousands)||Probability||Cumulative Probability||Random Numbers|
|Lead time (weeks)||Probability||Cumulative Probability||Random Numbers|
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.
|Week||Opening Balance Inventory (‘000)||Demand||Closing Balance Inventory (‘000)||Lead Time||Quantity Ordered (‘000)||Costs|
|Random Numbers||Weeks||Holding Cost (Rs.)||Shortage Cost (Rs.)|
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.