Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost...

55
Metodos Cuantitativos M. En C. Eduardo Bustos Farias 1 Waiting Line Models: Queuing Theory Basics

Transcript of Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost...

Page 1: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 1

Waiting Line Models:Queuing Theory Basics

Page 2: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 2

AgendaQueuing system structurePerformance measuresComponents of queuing systems

Arrival processService process

M/M/1 QueueM/M/s (M/M/k) QueueEconomic analysis of waiting linesWaiting line models extensionsSummary

Page 3: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 3

When you are in queue?In the bank, restaurant, supermarket…In front of restroom during the break of football game

How much is your patience? Waiting costs your patience and your temper and it also costs the business.

Time =

For the business, they have to find the optimal service level that keeps customers happy and makes them profitable.

Page 4: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 4

INTRODUCTIONINTRODUCTIONQueuing models are everywhere. For example, Queuing models are everywhere. For example, airplanes airplanes ““queue upqueue up”” in holding patterns, waiting for in holding patterns, waiting for a runway so they can land. Then, they line up again a runway so they can land. Then, they line up again to take off.to take off.People line up for tickets, to buy groceries, etc. People line up for tickets, to buy groceries, etc. Jobs line up for machines, orders line up to be filled, Jobs line up for machines, orders line up to be filled, and so on.and so on.A. K. Erlang (a Danish engineer) is credited with A. K. Erlang (a Danish engineer) is credited with founding queuing theory by studying telephone founding queuing theory by studying telephone switchboards in Copenhagen for the Danish switchboards in Copenhagen for the Danish Telephone Company.Telephone Company.Many of the queuing results used today were Many of the queuing results used today were developed by Erlang.developed by Erlang.

Page 5: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 5

A A queuing modelqueuing model is one in which you have a is one in which you have a sequence of times (such as people) arriving at a sequence of times (such as people) arriving at a facility for service, as shown below:facility for service, as shown below:

Consider St. LukeConsider St. Luke’’s Hospital in Philadelphia and the s Hospital in Philadelphia and the following three queuing models.following three queuing models.

Model 1: St. LukeModel 1: St. Luke’’s Hematology Labs Hematology Lab St. LukeSt. Luke’’s s treats a large number of patients on an outpatient treats a large number of patients on an outpatient basis (i.e., not admitted to the hospital).basis (i.e., not admitted to the hospital).Outpatients plus those admitted to the 600Outpatients plus those admitted to the 600--bed bed hospital produce a large flow of new patients each hospital produce a large flow of new patients each day.day.

ArrivalsArrivals

0000000000 Service FacilityService Facility

Page 6: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 6

Most new patients must visit the hematology Most new patients must visit the hematology laboratory as part of the diagnostic process. Each laboratory as part of the diagnostic process. Each such patient has to be seen by a technician.such patient has to be seen by a technician.

After seeing a doctor, the patient arrives at the After seeing a doctor, the patient arrives at the laboratory and checks in with a clerk. laboratory and checks in with a clerk.

Patients are assigned on a firstPatients are assigned on a first--come, firstcome, first--served served basis to test rooms as they become available.basis to test rooms as they become available.

The technician assigned to that room performs the The technician assigned to that room performs the tests ordered by the doctor. When the testing is tests ordered by the doctor. When the testing is complete, the patient goes on to the next step in the complete, the patient goes on to the next step in the process and the technician sees a new patient.process and the technician sees a new patient.

We must decide how many technicians to hire.We must decide how many technicians to hire.

Page 7: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 7

WATS (Wide Area Telephone Service) is an acronym WATS (Wide Area Telephone Service) is an acronym for a special flatfor a special flat--rate, long distance service offered rate, long distance service offered by some phone companies.by some phone companies.

Model 2: Buying WATS LinesModel 2: Buying WATS Lines As part of its As part of its remodeling process, St. Lukeremodeling process, St. Luke’’s is designing a new s is designing a new communications system which will include WATS communications system which will include WATS lines. lines.

We must decide how many WATS lines the hospital We must decide how many WATS lines the hospital should buy so that a minimum of busy signals will should buy so that a minimum of busy signals will be encountered.be encountered.

When all the phone lines allocated to WATS are in When all the phone lines allocated to WATS are in use, the person dialing out will get a busy signal, use, the person dialing out will get a busy signal, indicating that the call canindicating that the call can’’t be completed. t be completed.

Page 8: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 8

The equipment includes measuring devices such asThe equipment includes measuring devices such as

Model 3: Hiring RepairpeopleModel 3: Hiring Repairpeople St. LukeSt. Luke’’s hires s hires repairpeople to maintain repairpeople to maintain 2020 individual pieces of individual pieces of electronic equipment. electronic equipment.

If a piece of equipment fails and all the repairpeople If a piece of equipment fails and all the repairpeople are occupied, it must wait to be repaired.are occupied, it must wait to be repaired.

We must decide how many repairpeople to hire and We must decide how many repairpeople to hire and balance their cost against the cost of having broken balance their cost against the cost of having broken equipment.equipment.

electrocardiogram machines electrocardiogram machines

small dedicated computerssmall dedicated computers

CAT scannerCAT scanner

other equipmentother equipment

Page 9: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 9

All three of these models fit the general description All three of these models fit the general description of a queuing model as described below: of a queuing model as described below:

PROBLEMPROBLEM ARRIVALSARRIVALS SERVICE FACILITYSERVICE FACILITY

11 PatientsPatients TechniciansTechnicians22 Telephone CallsTelephone Calls SwitchboardSwitchboard33 Broken Equipment RepairpeopleBroken Equipment Repairpeople

These models will be resolved by using a These models will be resolved by using a combination of analytic and simulation models.combination of analytic and simulation models.

To begin, letTo begin, let’’s start with the basic queuing model. s start with the basic queuing model.

Page 10: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 10

Queuing Systems

...

customers

channel(server)

system

arrival departure

waiting line (queue)

Single Channel Waiting Line System

system

arrival departure

server 2

server k

... ...

server 1 Multi-ChannelWaiting Line System

Page 11: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 11

Bank Customers Teller Deposit etc.

Doctor’s Patient Doctor Treatmentoffice

Traffic Cars Light Controlledintersection passage

Assembly line Parts Workers Assembly

Tool crib Workers Clerks Check out/in tools

Situation Arrivals Servers Service ProcessWaiting Line Examples

Page 12: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 12

THE BASIC MODELTHE BASIC MODELConsider the Xerox machine located in the fourthConsider the Xerox machine located in the fourth--floor secretarial service suite. Assume that users floor secretarial service suite. Assume that users arrive at the machine and form a single line. arrive at the machine and form a single line.

Each arrival in turn uses the machine to perform a Each arrival in turn uses the machine to perform a specific task which varies from obtaining a copy of a specific task which varies from obtaining a copy of a 11--page letter to producing page letter to producing 100100 copies of a copies of a 2525--page page report. report.

This system is called a singleThis system is called a single--server (or singleserver (or single--channelchannel) queue. ) queue.

Page 13: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 13

2.2. The number of people in the queue (waiting The number of people in the queue (waiting for service).for service).

3.3. The waiting time in the system (the interval The waiting time in the system (the interval between when an individual enters the system between when an individual enters the system and when he or she leaves the system).and when he or she leaves the system).

4.4. The waiting time in the queue (the time The waiting time in the queue (the time between entering the system and the between entering the system and the beginning of service).beginning of service).

Questions about this or any other queuing system Questions about this or any other queuing system center on four quantities:center on four quantities:

1.1. The number of people in the system (those The number of people in the system (those being served and waiting in line).being served and waiting in line).

Page 14: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 14

ASSUMPTIONS OF THE BASIC MODELASSUMPTIONS OF THE BASIC MODEL

1.1. Arrival Process.Arrival Process. Each arrival will be called a Each arrival will be called a ““job.job.”” The The interarrival timeinterarrival time (the time between (the time between arrivals) is not known. arrivals) is not known.

Therefore, the Therefore, the exponential probabilityexponential probabilitydistributiondistribution (or (or negative exponential negative exponential distributiondistribution) will be used to describe the ) will be used to describe the interarrival times for the basic model.interarrival times for the basic model.

The exponential distribution is completely The exponential distribution is completely specified by one parameter, specified by one parameter, λλ, the mean , the mean arrival rate (i.e., how many jobs arrive on the arrival rate (i.e., how many jobs arrive on the average during a specified time period).average during a specified time period).

Page 15: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 15

Mean interarrival time is the average time Mean interarrival time is the average time between two arrivals. Thus, for the between two arrivals. Thus, for the exponential distributionexponential distribution

Avg. time between jobs = mean interarrival time = Avg. time between jobs = mean interarrival time = 11λλ

Thus, if Thus, if λλ = 0.05= 0.05

mean interarrival time = = = 20mean interarrival time = = = 2011λλ

110.050.05

2.2. Service Process.Service Process. In the basic model, the time In the basic model, the time that it takes to complete a job (the that it takes to complete a job (the service service timetime) is also treated with the exponential ) is also treated with the exponential distribution. distribution.

The parameter for this exponential distribution The parameter for this exponential distribution is called is called µµ (the (the mean service ratemean service rate in jobs per in jobs per minute).minute).

Page 16: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 16

µµTT is the number of jobs that would be served is the number of jobs that would be served (on the average) during a period of (on the average) during a period of TT minutes minutes if the machine were busy during that time.if the machine were busy during that time.The The meanmean or or averageaverage, , service timeservice time (the (the average time to complete a job) isaverage time to complete a job) is

Avg. service time =Avg. service time = 11µµ

Thus, if Thus, if µµ = 0.10= 0.10

mean service time = = = 10mean service time = = = 1011µµ

110.100.10

3.3. Queue Size.Queue Size. There is no limit on the number There is no limit on the number of jobs that can wait in the queue (an infinite of jobs that can wait in the queue (an infinite queue length).queue length).

Page 17: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 17

4.4. Queue Discipline.Queue Discipline. Jobs are served on a firstJobs are served on a first--come, firstcome, first--serve basis (i.e., in the same order serve basis (i.e., in the same order as they arrive at the queue).as they arrive at the queue).

5.5. Time Horizon.Time Horizon. The system operates as The system operates as described continuously over an infinite described continuously over an infinite horizon.horizon.

6.6. Source Population.Source Population. There is an infinite There is an infinite population available to arrive.population available to arrive.

Page 18: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 18

QUEUE DISCIPLINEQUEUE DISCIPLINEIn addition to the arrival distribution, service In addition to the arrival distribution, service distribution and number of servers, the queue distribution and number of servers, the queue discipline must also be specified to define a queuing discipline must also be specified to define a queuing system.system.So far, we have always assumed that arrivals were So far, we have always assumed that arrivals were served on a firstserved on a first--come, firstcome, first--serve basis (often called serve basis (often called FIFO, for FIFO, for ““firstfirst--in, firstin, first--outout””).).However, this may not always be the case. For However, this may not always be the case. For example, in an elevator, the last person in is often example, in an elevator, the last person in is often the first out (LIFO). the first out (LIFO). Adding the possibility of selecting a good queue Adding the possibility of selecting a good queue discipline makes the queuing models more discipline makes the queuing models more complicated.complicated.These models are referred to as scheduling models.These models are referred to as scheduling models.

Page 19: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 19

Various Type of Queues• Single Channel/Single Phase

• Multi-channel/Single Phase

• Single Channel/Multi-phase

• Queuing Network

Page 20: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 20

Queuing System Structure

Server departurearrival

• Arrival characteristic1. Size of units

- Single- Batch

2. Arrival rate- Constant- Probabilistic

3. Degree of patience- Patient- Impatient

• Arrival characteristic1. Size of units

- Single- Batch

2. Arrival rate- Constant- Probabilistic

3. Degree of patience- Patient- Impatient

• Features of lines1. Length

- Infinite capacity- Limited capacity

2. Number- Single- Multiple

3. Queue discipline- FIFO- Priorities

• Features of lines1. Length

- Infinite capacity- Limited capacity

2. Number- Single- Multiple

3. Queue discipline- FIFO- Priorities

• Service facility1. Structure2. Service rate

- Constant- Probabilistic - random services - State-dependent service time

• Service facility1. Structure2. Service rate

- Constant- Probabilistic - random services - State-dependent service time

• Population Source- Finite- Infinite

• Population Source- Finite- Infinite

• Exit1. Return to service population2. Do not return to service population

• Exit1. Return to service population2. Do not return to service population

Page 21: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 21

Deciding on the Optimum Level of Service

Total expected cost

Negative Cost of waiting time to company

Cost

Low level of service

Optimal service level

High level of service

Minimum total cost

Cost of providing service

Page 22: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 22

Performance Measures

P0 = Probability that there are no customers in the systemPn = Probability that there are n customers in the system

LS = Average number of customers in the systemLQ = Average number of customers in the queue

WS = Average time a customer spends in the systemWQ = Average time a customer spends in the queue

Pw = Probability that an arriving customer must wait for serviceρ = Utilization rate of each server (the percentage of time that

each server is busy)

Page 23: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 23

Arrival Process

X: # of customer arrivals within time interval of length t

Pr(X=n) =

λ = the mean arrival rate per time unitt = the length of the time intervale = 2.7182818 (the base of the natural logarithm)

n! = n(n−1)(n−2) (n−3)… (3)(2)(1)

X: # of customer arrivals within time interval of length t

Pr(X=n) =

λ = the mean arrival rate per time unitt = the length of the time intervale = 2.7182818 (the base of the natural logarithm)

n! = n(n−1)(n−2) (n−3)… (3)(2)(1)

( )!net tn λλ −

Very large population of potential customers• behave independently • in any time instant, at most one arrives• arrive at intervals of average duration 1/λ

Very large population of potential customers• behave independently • in any time instant, at most one arrives• arrive at intervals of average duration 1/λ

X follows Poisson Distribution(λt)Mean = λt

Variance = λtλ = arrival rate = # of arrivals per unit of time

t should be expressed in the same time unit as λ

X follows Poisson Distribution(λt)Mean = λt

Variance = λtλ = arrival rate = # of arrivals per unit of time

t should be expressed in the same time unit as λ

Important

Important

Page 24: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 24

Examples of Poisson Distribution

0.0

0.2

0.4

p(x)Poisson distributionwith parameter 1/2

x0 1 2 3

0.0

0.2

p(x)Poisson distributionwith parameter 2

x0 1 2 3 4 5

Poisson distributionwith parameter 1

0.0

0.2

0.4p(x)

0 1 2 3 4 x

Page 25: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 25

Service ProcessAssume service time is exponentially distributed(µ)

P.D.F. f(t) = µe-µt

Pr(Service ≤ t) = 1 − e-µt

Mean = 1/µVariance = 1/µ2

µ= service rate = # of customers served per unit time

Assume service time is exponentially distributed(µ)

P.D.F. f(t) = µe-µt

Pr(Service ≤ t) = 1 − e-µt

Mean = 1/µVariance = 1/µ2

µ= service rate = # of customers served per unit time

Properties of exponential distribution1. Memoryless (The conditional probability is the same as the unconditional probability.)2. Most customers require short services; few require long service3. If arrival process follows Possion (λ), then inter-arrival time follows exponential(λ)

Properties of exponential distribution1. Memoryless (The conditional probability is the same as the unconditional probability.)2. Most customers require short services; few require long service3. If arrival process follows Possion (λ), then inter-arrival time follows exponential(λ)

Important

Important

Page 26: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 26

Examples of Exponential Distribution

Page 27: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 27

Queuing Theory NotationA standard notation is used in queuing theory to denote the type of system we are dealing with.Typical examples are:

M/M/1 Poisson Input/Poisson Server/1 ServerM/G/1 Poisson Input/General Server/1 ServerD/G/n Deterministic Input/General Server/n ServersE/G/∞ Erlangian Input/General Server/Inf. Servers

The first letter indicates the input process, the second letter is the server process and the number is the number of servers.(M = Memoryless = Poisson)

Page 28: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 28

Terminologyλ = Arrival rate = 1/ Mean arrival intervalµ = Service rate = 1/ Mean service timeρ = λ/ µk = # of Servers

λ = Arrival rate = 1/ Mean arrival intervalµ = Service rate = 1/ Mean service timeρ = λ/ µk = # of Servers

P0 = Probability that there are no customers in the systemPn = Probability that there are n customers in the system

LS = Average number of customers in the systemLQ = Average number of customers in the queue

WS = Average time a customer spends in the systemWQ = Average time a customer spends in the queue

Pw = Probability that an arriving customer must wait for serviceρ = Utilization rate of each server (the percentage of time that each server is busy)

P0 = Probability that there are no customers in the systemPn = Probability that there are n customers in the system

LS = Average number of customers in the systemLQ = Average number of customers in the queue

WS = Average time a customer spends in the systemWQ = Average time a customer spends in the queue

Pw = Probability that an arriving customer must wait for serviceρ = Utilization rate of each server (the percentage of time that each server is busy)

Performance measures

Page 29: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 29

Single Server CasePoisson arrivals, exponential service rate, no priorities, no balking,

steady state)

STATE ENTRY RATE LEAVING RATE0 λP0 µP11 λP0 + µP2 (λ + µ)P12 λP1 + µP3 (λ + µ)P23 λP2 + µP4 (λ + µ)P3: : :

: : :

Pn = (λ/µ)nP0 = ρnP0 for n = 1,2,3,...

1 = 1 if 1

00

0

0 <== −

=

=∑∑ ρρ ρ

P

n

n

nn PP

0 1 2 3 4 ....

λ

µ

λ

µ

λ

µ

λ

µ

ONLY IFλ< µ or λ/µ = ρ <1

Steady state exists!

ONLY IFλ< µ or λ/µ = ρ <1

Steady state exists!

Page 30: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 30

Single Server Case⇒ P0 = 1 − ρ⇒ Pn = ρn (1 − ρ )

LS = E[N] where N = no. of customers in system (denote S)

=

= ρ /(1 − ρ )

LQ = E[Nq] where Nq = no. of customers in queue (denote Q)

=

= ρ2/(1− ρ )

WS = LS/ λWQ = LQ/ λ

∑∞

= 0nnnP

( )∑∞

=

−0

1n

nPn

Little’s LawLS = λ WSLQ= λ WQ

Little’s LawLS = λ WSLQ= λ WQ

Page 31: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 31

Single Server Queue Performance (M/M/1)

P0 = 1 – λ/µ

Pn = (λ/µ)nP0

LQ =

LS = LQ + λ/µ = LQ + ρ = ρ/(1− ρ)

WQ = LQ / λ

WS = WQ + 1/µ

Pw = 1 – P0 = ρ

P0 = 1 – λ/µ

Pn = (λ/µ)nP0

LQ =

LS = LQ + λ/µ = LQ + ρ = ρ/(1− ρ)

WQ = LQ / λ

WS = WQ + 1/µ

Pw = 1 – P0 = ρ

( ) ρρ

λµµλ

−=

− 1

22

Page 32: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 32

The Schips, Inc. Truck Dock Problem

Schips, Inc. is a large department store chain that has six branch stores located throughout the city. The company’s Western Hills store, which was built some years ago, has recently been experiencing some problems in its receiving and shipping department because of the substantial growth in the branch’s sales volume. Unfortunately, the store’s truck dock was designed to handle only one truck at a time, and the branch’s increased business volume has led to a bottleneck in the truck dock area. At times, the branch manager has observed as many as five Schips trucks waiting to be loaded or unloaded. As a result, the manager would like to consider various alternatives for improving the operation of the truck dock and reducing the truck waiting times.

Page 33: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 33

The Schips, Inc. Truck Dock Problem

One alternative the manager is considering is to speed up the loading/unloading operation by installing a conveyor system at the truck dock. As another alternative, the manager is considering adding a second truck dock so that two trucks could be loaded and/or unloaded simultaneously.

What should the manager do to improve the operation of the truckdock? While the alternatives being considered should reduce the truck waiting times, they may also increase the cost of operating the dock. Thus the manager will want to know how each alternative will affect both the waiting times and the cost of operating the dock before making a final decision

Truck arrival information: truck arrivals occur at an average rate of three trucks per hour.

Service information: the truck dock can service an average of four trucks per hour.

Page 34: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 34

The Schips, Inc. Truck Dock Problem

Options:1. Using conveyor to speed up service rate2. Add another dock server

Assumptions:The waiting cost is linearPoisson ArrivalsExponential service time

Page 35: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 35

Schips, Inc. - Current Situation

Page 36: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 36

Schips, Inc. - Alternative IAlternative I: Speed up the loading/unloading operations by installing a conveyor system (costs of different conveyer system are not provided here, but you should consider it when you evaluate the total cost)

Page 37: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 37

M/M/k QueueMultiple server, single queue (Poisson arrivals, I.I.D. exponential service rate, no priority, no balking, steady state)

Server 1

Arrivalλ

Server 2

Server kONLY IF

λ< kµ or λ / kµ = ρ <1 Steady state exists!

ONLY IFλ< kµ or λ / kµ = ρ <1 Steady state exists!

Departurekµ

Page 38: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 38

M/M/k Queue Performance Measures

Page 39: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 39

The Schips, Inc. Problem (continued)

Alternative IAlternative II:k = 2

P0 = 0.4545LQ = 0.123LS = 0.873WQ = 0.041WS = 0.291Pw = 0.2045

Page 40: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 40

Economic Analysis of Queuing System

Cost of waiting vs. Cost of capacity

Cost of waiting vs. Cost of capacity

COST

CAPACITY

CAPACITY

WAITING

TOTAL

Page 41: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 41

The Schips, Inc. Problem (Cost analysis, FYI)

cW = Hourly waiting cost for each customercServer = Hourly cost for each serverLS = Average number of customers in systemk = Number of servers

cW = Hourly waiting cost for each customercServer = Hourly cost for each serverLS = Average number of customers in systemk = Number of servers

Total waiting cost/hour = cWLTotal server cost/hour = cServerkTotal cost per hour = cWL+ cServerk

Total waiting cost/hour = cWLTotal server cost/hour = cServerkTotal cost per hour = cWL+ cServerk

Total Hourly Cost Summary for The Schips Truck Dock ProblemcW = $25/hour, cServer = $30/hour

Incremental cost of using conveyor: $20/hour for every ∆µ = 2

Total Hourly Cost Summary for The Schips Truck Dock ProblemcW = $25/hour, cServer = $30/hour

Incremental cost of using conveyor: $20/hour for every ∆µ = 2System µ Avg. # of Trucks in

system (L)Total Cost/Hour cWL + cSk

1-server 4 3 (25)(3)+(30)(1)=$1051-server+conveyor

6 1 (25)(1) +(30+20)(1) = $75

1-server+conveyor

8 0.6 (25)(0.6) + (30+40)(1) = $85

1-server+conveyor

10 0.43 (25)(0.43) + (30+60)(1) =$100.71

2-server 4 0.873 (25)(0.873) + (30)(2) = $81.83

Page 42: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 42

Discrete distribution

Suppose the bank has only one server, the interarrival and service rate are both discrete distribution. This bank wants to simulate for 150 customers arrival.This bank wants to know the queuing length and waiting time of their current service.

Interarrival distribution Service time distributionValue Prob Value Prob

1 0.05 1 0.152 0.15 2 0.153 0.35 3 0.254 0.35 3 0.205 0.10 4 0.10

Cum. Prob. 1 5 0.056 0.057 0.038 0.02

Cum. Prob. 1

Page 43: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 43

Discrete distributionSingle server queueing simulation (starting empty and idle)

Customer IA_Time Arrival_Time Service_Time Queue_Time Start_Time Depart_Time Before entry After entry Before entry After entry1 1 1 3 0 1 4 0 3 0 02 3 4 3 0 4 7 0 3 0 03 3 7 3 0 7 10 0 3 0 04 3 10 2 0 10 12 0 2 0 05 3 13 2 0 13 15 0 2 0 06 4 17 3 0 17 20 0 3 0 07 4 21 6 0 21 27 0 6 0 08 4 25 3 2 27 30 2 5 0 19 1 26 3 4 30 33 4 7 1 2

10 4 30 7 3 33 40 3 10 0 111 3 33 3 7 40 43 7 10 0 112 2 35 3 8 43 46 8 11 1 213 4 39 3 7 46 49 7 10 2 314 4 43 3 6 49 52 6 9 1 215 3 46 1 6 52 53 6 7 1 2

Number in queueServer work

Waiting Times in Queue

0

2

4

6

8

10

12

14

1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96 101 106 111 116 121 126 131 136 141 146

Customer

Queue Length Versus Time(Shown only at times just after arrivals)

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

0 50 100 150 200 250 300 350 400 450 500

Customer Arrival Times

Page 44: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 44

Discrete distributionIf the arrival rate keeps the same, but the service rate is faster…

Service time distributionValue Prob

1 0.252 0.253 0.203 0.204 0.105 0.006 0.007 0.008 0.00

Cum. Prob. 1

Waiting Times in Queue-Faster Service Rate

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96 101 106 111 116 121 126 131 136 141 146

Customer

Queue Length Versus Time- Faster Service(Shown only at times just after arrivals)

0

0.5

1

1.5

2

2.5

0 50 100 150 200 250 300 350 400 450 500

Customer Arrival Times

Page 45: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 45

Discrete distribution :L5-QSim2-3servers

Interarrival distribution Service time distributionValue Prob Value Prob

1 0.80 1 0.152 0.15 2 0.153 0.03 3 0.254 0.01 3 0.25 0.01 4 0.1

1 5 0.056 0.057 0.038 0.02

1

If the bank has more frequent arrival, they definitely need more servers. Now they have 3 servers.

Page 46: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 46

Discrete distribution : L5-QSim2-3servers (con’t)

The waiting time and queuing length with 3 servers…

Waiting Times in Queue-3 servers

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96 101 106 111 116 121 126 131 136 141 146

Customer

Queue Length Versus Time- 3 servers(Shown only at times just after arrivals)

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

0 50 100 150 200 250

Customer Arrival Times

Queue Length Versus Time- 2 servers(Shown only at times just after arrivals)

0

5

10

15

20

25

30

0 50 100 150 200 250

Customer Arrival Times

If you change to 2 servers, then….Waiting Times in Queue-2 servers

0

5

10

15

20

25

30

35

40

45

50

1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96 101 106 111 116 121 126 131 136 141 146

Customer

Page 47: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 47

Waiting Line Models Extensions

Notation for Classifying Waiting Line Models

M = Designates a Poisson probability distribution for the arrivals or an exponential probability distribution for service time

D = Designates that the arrivals or the service time is deterministic or constant

G = Designates that the arrivals or the service time has a general probability distribution with a known mean and variance

Code indicatingarrival

distribution

Code indicatingservice time distribution

Number of parallelservers

others

Page 48: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 48

Waiting Line Models Extensions

Notation for Classifying Waiting Line Models

M/M/1M/M/kM/G/1 (M/D/1 is a special case, D for deterministic service time)G/M/1 And more….G/G/1G/G/k

Code indicatingarrival

distribution

Code indicatingservice time distribution

Number of parallelservers

others

Page 49: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 49

M/G/1 Queue Performance Measures

M/G/1 System: Steady state results (λ<µ)P0 = 1−ρ (ρ = λ/µ)

LQ =

LS = LQ + λ/µ = LQ + ρWQ = LQ / λ

WS = WQ + 1/µ

Pw = 1 – P0 = ρ

)1(2

222

ρρσλ

−+

µ = service rate 1/ µ = mean service timeσ2 = variance of service time distribution

M/D/1 Queue: σ2 = 0

LQ =

µ = service rate 1/ µ = mean service timeσ2 = variance of service time distribution

M/D/1 Queue: σ2 = 0

LQ = )1(2

2

ρρ−

Page 50: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 50

An Example: Secretary HiringSuppose you must hire a secretary and you have to select one of two candidates.

Secretary 1 is very consistent, typing any document in exactly 15 minutes.

Secretary 2 is somewhat faster, with an average of 14 minutes per document, but with times varying according to the exponential distribution.

The workload in the office is 3 documents per hour, with interarrival times varying according to the exponential distribution. Which secretary will give you shorter turnaround times on documents?

Page 51: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 51

Secretary Hiring - Queuing Model

Page 52: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 52

M/M/s with Finite PopulationThe number of customers in the system is not permitted to exceed some specified number

Example: Machine maintenance problem

Page 53: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 53

M/M/s with Limited Waiting Room

Arrivals are turned away when the number waiting in the queue reaches a maximum level

Example: Walk-in Dr.s office with limited waiting space

Page 54: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 54

Remember: λ & µ Are Rates

λ = Mean number of arrivals per time period

e.g., 3 units/hourµ = Mean number of people or items served per time period

e.g., 4 units/hour1/µ = 15 minutes/unit

© 1984-1994 T/Maker Co.

If average service time is 15 minutes, then µ is 4 customers/hour

Page 55: Queuing Theory Basics - Angelfire: Welcome to Angelfire Level of Service Total expected cost Negative Cost of waiting time to company Cost Low level of service Optimal service level

MetodosCuantitativos M. En C. Eduardo Bustos Farias 55

SummaryQueuing system design has an important impact on the service provided by an enterpriseSteady state performance measures can provide useful information in assessing service and developing optimal queuing systemsThe general procedure of solving a queuing problem:

Many queuing systems do not have closed-form solutions. Simulation is a powerful tool of analyzing those systems.

Identify Queue Type

Identify Queue Type

Estimate Arrival & Service Processes

Estimate Arrival & Service Processes

Calculate Performance

Measures

Calculate Performance

Measures

ConductEconomic Analysis

ConductEconomic Analysis