Simulation - Modeling-Lecture-06 - 07 QueuingSystems - Problem
Simulation - Modeling-Lecture-06 - 07 QueuingSystems - Problem
SIMULATION EXAMPLES
Simulation of Queuing Systems
This lecture presents several examples of simulation that can be performed by devising
a simulation table either manually or with a spreadsheet. The simulation table provides a
systematic method for tracking system state over time.
Methodology of discrete-system simulation
1. Determine the characteristics of each of the inputs to the simulation.
These are often modeled as probability distributions, either continuous or
discrete.
2. Construct a simulation table.
Each simulation table is different, for each is developed for the problem at hand.
For each repetition or trial there are a set of inputs and one response.
3. 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
chosen in step 1.
A response typically depends on the inputs and one or more previous responses.
There are a series of problems in the chapter involving queuing (single-server and two-
server), inventory, reliability, and network analysis.
The inventory example has a closed-form (mathematical) solution to compare to the simulation
solution.
Keep the customer entertained: Relevant distractions can improve the customer's
waiting experience. By placing entertainment media in the waiting area such as a TV,
music or games, you can transform passive waiting into an active waiting.
Ensure that the customer is informed: Make it easy for the customers to know where
to go, where to wait, and how long the expected waiting times are. Use monitors and
digital screens to provide this information.
Take the opportunity to enlighten the customer: When customers are waiting, there
is an excellent opportunity for you to advertise your products or services on monitors
and digital screens. By enlightening the customer on your offering, he or she is likely to
be more receptive to cross-sell and up-sell.
3. Queue
It represents a certain number of customers waiting for service (of course the queue
may be empty). Typically, the customer being served is considered not to be in the
queue. Sometimes the customers form a queue literally (people waiting in a line for a
bank teller). Sometimes the queue is an abstraction (planes waiting for a runway to
land). There are two important properties of a queue: Maximum Size and Queuing
Discipline.
The two extreme values of the waiting time variance are for the FIFO queue
(minimum) and the LIFO queue (maximum).
Theoretical models (without priorities) assume only one queue. This is not
considered as a limiting factor because practical systems with more queues (bank
with several tellers with separate queues) may be viewed as a system with one
queue, because the customers always select the shortest queue. Of course, it is
assumed that the customers leave after being served. Systems with more queues (and
more servers) where the customers may be served more times are called Queuing
Networks.
4. Service Mechanism
It represents some activity that takes time and that the customers are waiting for.
Again, take it very generally. It may be a real service carried on persons or machines,
but it may be a CPU time slice, connection created for a telephone call, being shot
down for an enemy plane, etc. Typically, a service takes random time. Theoretical
models are based on random distribution of service duration also called Service
Pattern. Another important parameter is the number of servers. Systems with one
server only are called Single Channel Systems, systems with more servers are
called Multi Channel Systems.
5. Output represents the way customers leave the system. Output is mostly ignored by
theoretical models, but sometimes the customers leaving the server enter the queue
again ("round robin" time-sharing systems).
Queueing systems require the concepts of system state, events, and simulation
clock
1. The state of the system is the number of units in the system and the status of the
server, busy or idle.
2. An event is a set of circumstances that causes an instantaneous change in the state
of the system.
In a single-channel queueing system there are only two possible events that affect
the state of the system. They are as follows
The queueing system includes the server, the unit being serviced (if there is one), and
the units in the queue (if any).
The simulation clock is used to track simulated time. It also calculates arrival time,
departure time and awaiting time.
It is the time between two successive arrival in a queueing system. That means the time
between when one customer arrives at a queue and when the next customer arrives.
What’s the Difference Between Arrival Rates and Inter Arrival Times?
The neat trick with this equation is that if you invert the arrival rate your answer is the
inter arrival time which can then be used in your simulation.
For example;
If 12 customers enter a store per hour, the time between each arrival is;
= 1/12
= 0.083(hours)
= 0.083 x 60 minutes
= 5 (minutes)
Therefore, from the arrival rate of 12 per hour, the time between each arrival is 5 minutes.
What happens when the arrival event is occurred? Or What happens when a unit
enters the system?
The arrival event occurs when a unit enters the system. The flow diagram
for the arrival event is shown in Figure 4. The unit may find the server either
idle or busy; therefore, either the unit begins service immediately, or it enters the
queue for the server. The unit follows the course of action shown in Figure 5.
What is required for determining what happens next in the queuing systems? Or
How uncertainty in real life is imitated?
Simulations of queueing systems generally require the maintenance of an event list for
determining what happens next. The event list tracks the future times at which the
different types of events occur. Simulation clock times for arrivals and departures are
computed in a simulation table customized for each problem.
Why random numbers are needed in the queuing systems and how can it generate?
Data sheet
Time
Inter Service Service Idle
Customer Arrival Service Waiting spent
arrival time time time of
list time time time in
time begin end server
system
1 - 0 4 0 0 4 4 0
2 8 8 1 8 0 9 1 4
3 6 14 4 14 0 18 4 5
4 1 15 3 18 3 21 6 0
5 8 23 2 23 0 25 2 2
6 3 26 4 26 0 30 4 1
Mr. Srinivasan will implement the plan if the average waiting time of customers in the
system is less than 5 minutes. Before implementing the plan, Mr. Srinivasan would like to
know the following:
i. Mean waiting time of customers, before service.
ii. Average service time.
iii. Average idle time of service.
iv. The time spent by the customer in the system.
Simulate the operation of the facility for customer arriving sample of 20 cars when the
restaurant starts at 7.00 pm every day and find whether Mr. Srinivasan will go for the
plan.
Use the following sequence of random numbers
SL.--→ 1 2 3 4 5 6 7 8 9 10 11 12 13 14
For 87 37 92 52 41 05 56 70 70 07 86 74 31 71
arrivals
For 36 16 81 08 51 34 88 88 15 53 01 54 03 54
service
time
SL.--→ 15 16 17 18 19 20
For arrivals 57 85 39 41 18 38
For service time 56 05 01 45 11 76
Solution
Arrival time and random digits assignment and the service time and random
digits assignment
Cumulative Random digits
Inter-arrival time probability
probability assignment
2 0.15 0.15 0 - 15
3 0.25 0.40 16 - 40
4 0.20 0.60 41 - 60
5 0.25 0.85 61 - 85
6 0.15 1.00 86 - 100
4. Dentist Schedule
Dr. Watson, a dentist schedules all his patients for 30-minute appointments. Some of the
patients take more or less than 30 min depending on the type of dental work to be done.
The following table shows the summary of the various categories of work, their
probabilities and time actually needed to complete the work.
Assuming the dentist clinic starts at 8.00 am, the arrival pattern and the service category
are shown in below table.
Data sheet
The average waiting time of patients = Total waiting time/ total patients
= 285/8
= 35.625 minutes