Monte Carlo Simulation Example for Queuing Analysis
Determine the optimal number of servers in a facility with the following
data on the frequency of arrival rate of customers and service time
interarrival of customers
time between arrivals (min) occurences
1 200
2 250
3 300
4 150
5 100
service time (min) occurences
1 100
2 150
hourly wage of server is 400 pesos and the
opportunity loss due to waiting by customer is estmated at 60 pesos per hour
Simulation with 1 server
Conversion of arrival rate of customers into per hour unit hour
1
customer arrival rate/hour frequency probability Cumm.prob. range of rand # 2
60 200 0.20 0.20 1 to 20 3
120 250 0.25 0.45 21 to 45 4
180 300 0.30 0.75 46 to 75 5
240 150 0.15 0.90 76 to 90 6
300 100 0.10 1.00 91 to 100 7
8
conversion of service rate into per hour unit
customers served per hour frequency probability Cumm.prob. range of rand #
60 100 0.40 0.40 1 to 40 Simulation with 2 servers
120 150 0.60 1.00 41 to 100
hour
1
2
3
4
5
6
7
8
Simulation with 3 servers
hour
1
2
3
4
5
6
7
8
Simulation with 1 server
rand# customers arrived total # of customers rand # customers served customers waiting
83 240 240 58 120 120
97 300 420 73 120 300
48 180 480 95 120 360
79 240 600 33 60 540
55 180 720 10 60 660
88 240 900 18 60 840
83 240 1080 37 60 1020
76 240 1260 53 120 1140
service cost 3200
waiting cost 298800
total cost 302000
Simulation with 2 servers
server 1 server 2
rand# customers arrived total # of customers rand # customers served rand #
83 240 240 58 120 92
97 300 300 73 120 76
48 180 240 95 120 33
79 240 300 33 60 52
55 180 300 10 60 16
88 240 420 18 60 21
83 240 540 37 60 61
76 240 600 53 120 99
service cost 6400
waiting cost 86400
total cost 92800
Simulation with 3 servers
server 1 server 2
rand# customers arrived total # of customers rand # customers served rand #
83 240 240 58 120 92
97 300 300 73 120 76
48 180 180 95 60 33
79 240 240 33 60 52
55 180 180 10 60 16
88 240 240 18 60 21
83 240 240 37 60 61
76 240 240 53 120 99
service cost 9600
waiting cost 0
total cost 9600
based on the total cost, the optimal number of servers is 3
customers served customers waiting
120 0
120 60
60 60
120 120
60 180
60 300
120 360
120 360
server 3
customers served rand # customers served customers waiting
120 68 120 0
120 86 120 0
60 68 120 0
120 46 120 0
60 49 120 0
60 78 120 0
120 20 60 0
120 61 120 0