Ch2 SIM
Ch2 SIM
Simulation Examples
• Three steps of the simulations
• Determine the characteristics of each of the inputs to the simulation. Quite often, these may be
modeled as probability distributions, either continuous or discrete.
• Construct a simulation table. Each simulation table is different, for each is developed for the problem at
hand.
• For each repetition i, generate a value for each of the p inputs, and evaluate the function, calculating a
value of the response yi. The input values may be computed by sampling values from the distributions
determined in step 1. A response typically depends on the inputs and one or more previous responses.
2.1 Simulation of Queueing Systems (1)
Server
Waiting Line
Calling population
• Arrivals and services are defined by the distribution of the time between arrivals and the
distribution of service times, respectively.
• For any simple single- or multi-channel queue, the overall effective arrival rate must be less than
the total service rate, or the waiting line will grow without bound.
• In some systems, the condition about arrival rate being less than service rate may not guarantee
stability
2.1 Simulation of Queueing Systems (4)
• System state : the number of units in the system and the status of the server(busy or idle).
• Event : a set of circumstances that cause an instantaneous change in the state of the system.
• In a single-channel queueing system there are only two possible events that can affect the state of the
system.
• If a unit has just completed service, the simulation proceeds in the manner shown in the flow
diagram of Figure 2.2.
• Note that the server has only two possible states : it is either busy or idle.
Departure
Event
Arrival
Event
• The interarrival times and service times must be meshed to simulate the
single-channel queueing system.
• Table 2.4 was designed specifically for a single-channel queue which serves
customers on a first-in, first-out (FIFO) basis.
2.1 Simulation of Queueing Systems (12)
• Figure 2.6 depicts the number of customers in the system at the various clock times.
2.1 Simulation of Queueing Systems (14)
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 )
2.1 Simulation of Queueing Systems (22)
a b 1 8
E ( A) 4.5 (min)
2 2
The longer the simulation, the closer the average will be to E ( A)
The average waiting time of those who wait : 4.3 minutes
total time customers wait in queue 56
average waiting time of those who wait 4.3 (min)
total numbers of customers who wiat 13
2.1 Simulation of Queueing Systems (23)
average time customer spends in the system = 2.8 + 3.4 = 6.2 (min)
2.1 Simulation of Queueing Systems (24)
A b le
B aker
A drive-in restaurant where carhops take orders and bring food to the car.
Assumptions
• Cars arrive in the manner shown in Table 2.11.
• Two carhops Able and Baker - Able is better able to do the job and works a bit
faster than Baker.
• The distribution of their service times is shown in Tables 2.12 and 2.13.
2.1 Simulation of Queueing Systems (25)
R ep airp erso n