0% found this document useful (0 votes)
13 views23 pages

Queues

Uploaded by

narcismarti144
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views23 pages

Queues

Uploaded by

narcismarti144
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Transport

Plan
Plan de Systems
de Formación
Formación (40h)
(40h)

Lecture 3. Queues

Learning
• Learning goals: Ability to estimate, describe and charcaterize how
vehicles, people and goods overcome time by a transport system with one or
more bottlenecks. Ability to calculate waiting times, service times and queue
lenghts in queueing systems from cumulative-time diagrams.
• Previous knowledge: Probability. Distribution of arrival times, expected
values and variance of random variables with a known distribution. Markov
chains.
• Exercices or cases: Queues in highways, Management of vehicles in a
concrete plant, toll-booths in highways.

1
Index
• Introduction to operations
• Queueing systems
– Components
– Diagrams
– Processes
– Disciplines
• Little’s formula
• Examples and applications
• Stochastic queues theory
• Duality (s-t) vs (N-t)

Real queues

2
Real queues

Queues in the supermarket


𝛍

Wq Ws

Queueing theory is the study of waiting times in a system by means of models


to determine how we have to operate a system in the most effective way. 6

3
Queue system: Components
SYSTEM

STORAGE SPACE
ARRIVALS CONSTRAINT DEPARTURE
POPULATION QUEUE

Components:
• Customer EXAMPLES:

• Server (constraint) - AIRPLANES AND RUNWAYS


- CONTAINERS AND GRANTRY CRANES
• Queue (storage space)
- PAINTING OF WAGONS OF FFCC
• Arrival process - CARS IN A PARKING
• Service process - TAXI AND CUSTOMER

• Queue discipline 7

Customers, arrival and service processes


 CUSTOMERS
- Someone or something that requires a service
- Generated from an Entrance Source/Population:
- Finite (limited group), arrivals affected by customers on the queue
- Infinite (unlimited group), no impact derived from queue length

 ARRIVAL PROCESS Cum #


- Temporal distribution about how customers arrive (N)
- Four main characteristics: A(t)
- Structure (controlled or uncontrolled)
- Size of arrival units (individual-car or group-bus)
- Arrival rate (inverse of time between two consecutive arrivals)
- Level of patience (waiting any time to be served or leaving before being served) time
- Continuous approximations & Smoothing (overlap of events)
- Poisson: Δ independents; Δ stationary; Order;
MONEY (% customers queuing = % time server occupied)
Prob
 SERVICE (dpf)
Service
- Service time: mean and variance; service rate (frequency)
- Number of servers
time
- Configuration of servers (queueing system): series, parallel
time
8

4
Cumulative diagrams

CUMULATIVE DIAGRAMS (N, t)

CUMULATIVE
NUMBER OF
CUSTOMERS

Waiting

In service

“GAME RULES” TIME


- CONSERVATION
- ARRIVAL PROCESS
- NUMBER OF SERVERS
- SERVICE TIME DISTRIBUTION
- QUEUE DISCIPLINE
- SIMULATION AND EXACT SOLUTION, EASY
- APPROXIMATED EQUATIONS, DIFFICULT

FOR ONE SERVER:

CUSTOMERS 1
IN SERVICE
0 TIME
9

Arrival and Departure rates

1
N (t)
(Cumulative
number of Q 𝑑𝐴(𝑡)
customers) 𝜆(𝑡) =
A(t) D(t) 𝑑𝑡

N
𝑑𝐷(𝑡)
𝜇(𝑡) =
1 𝑑𝑡

time T

10

5
System configuration
Queue

ONE SERVER IN PARALEL WITH A SINGLE QUEUE (FCFS)

Fast lane

Regular queues

IN PARALEL, SERVERS/QUEUES NON UNIFORMS

SERIES COMBINATION

11

Queue disciplines
 DISCIPLINE  BEHAVIOUR
- Emergency - Abandonment
- Priority - Jump
- FCFS / FIFO - Cycle
Same E(W), with
- LCFS / LIFO different var(W) - Combination
- SIRO - Division
- SST (shortest service time) - …
- EDDF (earliest due date first)
- SWST (shortest weighted service time)
- RR (round Robin)

DISCIPLINE SERVER PROPERTIES


FCFS MINIMIZES THE VARIANCE OF THE WAITING TIME
SST MINIMIZES WAITING TIME IN THE SYSTEM AND IN THE
QUEUE
EDDF MINIMIZES THE MAXIMUM DELAY
SWST MINIMIZES THE PONDERATE WAITING TIME
RR MINOR WAITING TIME IN THE SYSTEM OF FCFS IF THE
SERVICE TIMES VARY A LOT
12

6
Queue length and Waiting time

Queue length:
Lq (t): Number of cutomers on the queue at time t. Lq(t)= A(t)-Dq(t)
Ls(t): Number of customers in the system at time t. Ls(t)=A(t)-Ds(t)
W s(t): Total waiting time in the system, 𝑊𝑠 𝑡 = ∫ 𝐴 𝑡 − 𝐷 (𝑡) 𝑑𝑡
Then: A(t) ≥ Dq(t) ≥ Ds(t) t≥0

Maximum length (longest vertical distance) and waiting time (longest horizontal distance)

A-1(n) , Dq-1(n) , Ds-1(n) are arrival time, departure time from the queue, departure time
from the system for the customer n. 13

Trajectories (s-t) + queues (N-t)

Transport operations s
• Trajectories (in movement)
– Speed, acceleration, etc. Dual analysis of
movement
t
• Queues (waiting)
– Waiting time, average
and maximum queue,
N
etc. (Acum.
A(t)
number)

Ds(t) N
A(t): Acumulated arrivals of clients from 0 to t
Ds(t): Acumulated departures of clients from 0 to t

T time 14

7
Trajectories and 3D acumulated diagrams

Trajectories and queues are


dual and complementary

15

Costs and Decisions


 PERFORMANCE METRICS:
CUSTOMER SERVER

- QUEUING TIME - RATE OF ARRIVALS


- SERVICE TIME - SERVICE TIME
- WAITING COST - USE
- % SERVICE FINISHED ON - THROUGHPUT
TIME - QUEUE LENGTH
- DELAY - % ABANDONMENTS

 DECISIONS:  COSTS:
- ADEQUATE LEVEL OF SERVICE SERVICE
- NUMBER OF SERVERS - CONSTRUCTION/INVESTMENT
- EFFICIENCY OF SERVERS - OPERATION
- PRIORITY OF SERVICE - MAINTENANCE, ETC.
- OPENING HOURS WAITING
- STORAGE SPACE (MAX. QUEUE LENGTH) - VALUE OF TIME
16

8
Optimization
Cost

Optimization:
• Cost of resources TOTAL
COST
• Cost of the queue Cost of
service
MIN

Cost of
waiting

Optimal LoS Level of


service

17

Deterministic and Stochastic systems

Deterministic models Stochastic models


To guarantee:    
No queues, or reduction of Queues could appear, but they disappear, due
If it is the case:
the existing ones. to randomness.
Analytical solutions, approximated and difficult.
Analyzed with: N-t diagrams
Simulation, exact solution and simpler.

µ > λ Recovering the system, reducing the queue length

λ > µ Uncontrolled system, the queue length always grows

Utilization factor: ρ = λ/µ

Equilibrium ρ < 1

Increasing queue ρ > 1

18

9
Deterministic queues

Queue generation :

Arrival rate (customers/min) Service rate (customers/min)

19

Little’s law (1961)


Deterministic queue.
If it vanishes at t=0 and at t=T, we can calculate the
total delay = area between A(t) and D(t)

1
N (t)
(Cumulative
number)
Dq(t)
A(t) Ds(t)
Average queue = Total Delay/T
N
Average waiting = Total Delay/N
1

𝐿 =𝜆𝑤
𝐿 =𝜆𝑤 Time
0 T

20

10
Serial Queues (tandem)

A(t) Dn(t)
D1(t)=A2(t) D2(t)

The system optimization (throughput) implies


identical service rates : µ1= µ2= … = µn

Examples:

- Continuous production line


- Mail classification, packages, etc.
- Urban artery with road works

Avoid queues inside the system: if µk are


different, µmax at the end (surplus of capacity)
21

Serial queue with capacity


C1 C2 Cn

Initial queue
...UNTIL ONE CAPACITY
CONSTRAINT IS VIOLATED

Cum.
Num.

µ3 is the minimum D3(t) well defined

Time
22

11
Parallel servers (I)

Queue Server
Arrivals

Server

Queue

Server

Queue
Arrivals
Server

Queue

Server

23

Parallel servers (II)


ARRIVALS
CUSTOMER’S
QUEUE DEPARTURES

POINT
OF SERVICE
SERVER’S QUEUE

As(t)
Cumulated
Number Ds(t)
Ac(t)

D(t) = min{Ac(t) , As(t)} = min{Ac(t) , m+µ(t-s)}


2m m
m Identical time of service
s
Time
24

12
Deterministic queues
Examples

25

Example of optimal decision

Cost

TOTAL
COST
Cost of service
MIN

Cost of waiting

Optimal Level Level of


service

EJ.: BUSES OPERATIONS


- LEVEL OF SERVICE = FREQUENCY H=1/F
- AVERAGE WAITING = 1/2 E(H) [ 1+C2(H)]  H/2
- BUS BUNCHING
- TOTAL COST PER MINUTE = 𝜷
𝜶𝑭 +
𝑭
- OPTIMAL FREQUENCY: F* = (β/α)1/2
26

13
Bus bunching
Cumulative 1
number of pax λ
Hn

H3
𝑇𝑜𝑡𝑎𝑙 𝑑𝑒𝑙𝑎𝑦 (𝑎𝑟𝑒𝑎 𝑜𝑓 𝑎𝑙𝑙 𝑡𝑟𝑖𝑎𝑛𝑔𝑙𝑒𝑠)
<𝑤 >=
H2 𝑃𝑎𝑠𝑠𝑒𝑛𝑔𝑒𝑟𝑠 𝑡ℎ𝑎𝑡 𝑤𝑎𝑖𝑡𝑒𝑑 𝑖𝑛 𝑡ℎ𝑒 𝑏𝑢𝑠 𝑠𝑡𝑜𝑝

Var ( X )  E ( X 2 )  E 2 ( X ) H1 Time
2  
2
n 1    
 2  H i2 
  Hi 

   H i    H i 
 2
w  in   i  i   i 
 H  var( H )
n 2 H
  Hi 2  Hi
i 1 i 1

Average waiting time:

<𝑤 >= 1+ ≥
27

Bus bunching
Bus bunching offers worst service….
…. at same cost
Trajectory bunching: Do not open
bus doors
Waiting time increases with CV2
of the headway
Variable headways increase the
user’s waiting time even though
the average headway remains
constant
Variable compensation of delay
controllers (3%) to minimize
headways variance (TMB)

PPO to bus drivers (absenteeism)


PPO to controllers (fraud)

28

14
Accident in highway
Additional queue due to an accident
Cumulative
number of A(t)
vehicles

Incident Time
2 lanes in use
Reestablishment
of 3 lanes

Numerical example: 5 lanes


20,250
in highway USA (C=9,000
10 ’
veh/h) then change to 4
lanes (C=7,200 veh/h) for 10
min.

Delay = 600 veh-h.


L = 277 veh average queue
10 ’
7:00 8:00 9:00 Time
29

Queues at traffic lights

Cumulative
vehicles
n’
n
λ µmax

r g r t

CYCLE: C = r + g (50” - 100”)


n’ = λ C ; r = n/ λ - n/ µmax n = r λ µmax /(µmax - λ)

AVERAGE DELAY OF THE DELAYED VEHICLES (n): r/2


AVERAGE DELAY OF ALL VEHICLES (delayed or not) (n’):

𝐴 𝑟𝑛/2 𝜇 𝑟 /2
𝑤= = =
𝑛′ 𝑛′ 𝐶(𝜇 − 𝜆)
30

15
Queues at traffic lights

INTERSECTION
(i=1)

(i=2)

μ r 2
w  1 i i
i 2 C (μ  λ )
i i

(i=1,2) As λiC ≤ µigi (LITTLE: Queues vanished in each cycle)

Cycle : C = g1 + g2 + l
l: amber + clearance (all red)
r1= g2 + l/2 ; r2= g1 + l/2

31

Queues at traffic lights


PML:
2
min Z = i1
 i C w i TOTAL Delay

s.t. (1) µigi  λi (g1 + g2 + l) Little (queues vanished)


(2) gi  gimin Pedestrians: minimum to cross (non negativity)
(3) g1 + g2 + l ≤ Cmax Maximum cycle for safety reasons to avoid long waiting times (120”)

PROFESSIONAL PRACTICE:
LoS w
i
λ
i
μ A <5”
g  (C  l)
i 2 B 5-15”
 λ j μ j
j1

E 40-60” HCM
Proportional to utilization factor F >60”
Flows for the quarter of rush hour

32

16
Serial servers: Double-deck bus stop
A bus stop with two platforms: In case of one platform:

BUS 0
BUS 2

BUS 1
𝐸 𝐻 = 𝐸 𝑅 + 𝐸 𝑃 + 𝐸(𝐷)

𝐶=  capacity
Service Service ( )
position 2 position 1

In case of 2 platforms:

a) Bus 1 finishes first: b) Bus 2 finishes first


Distance

Distance
Service Service
position 1 position 1
Service Bus 0 Service Bus 0
position 2 position 2
Waiting Bus 1 Waiting Bus 1
position 1 position 1
Waiting Bus 2 Waiting
Bus 2
position 2 position 2
R’1 R’2 P’2 D’2 R’1 P’1 D’1 R’2

H’ H’
Time Time

𝐻′ = max( 𝑅 + 𝑅 +𝑃 + 𝐷 , 𝑅 + 𝑅 +𝑃 + 𝐷 )

𝐶 = ∆𝐶 = −1= − 1= −1
∆ ,

Given two stop times Di independents, function of distribution of the maximum value is:
𝐹 , 𝑥 = 𝑃 max 𝐷 , 𝐷 ≤ 𝑥 = 𝑃 𝐷 ≤ 𝑥 𝑃 𝐷 ≤ 𝑥 = 𝐹 𝑥 then,

𝐸 max 𝐷 , 𝐷 = ∫ 𝑡 𝑓 , 𝑡 𝑑𝑡 = 2 ∫ 𝑡 𝐹(𝑡) 𝑓(𝑡) 𝑑𝑡


33

Serial servers: Double-deck bus stop


Increase of capacity of one double bus stop depends on the distribution of service time!!

Histogram of data observed


18

16 Adjustment of values of pick up and drop off passengers at stop


14 (dwell time)
Number of observations

12

10

8 Lognormal density function


μ=2.88 σ=0.42
6

0
0 10 20 30 40 50
Dwell time (seconds)

70

65
E(S)=30 s
60
Increase of Capacity (%)

25 s
55

50 20 s

45 15 s

40
10 s
35

30
0 5 10 15 20 25 30 35 40 45
Standard Deviation of Dwell Time (seconds)

34

17
Queues at PT stops
Loading: all links of the chain are important
1
 CAPACITY test before Olympics’92 Cum. # 

 High frequency but loading process deficient:


“Queues at bus stop grow but buses are 1 pax
empty...” Press 1992 2”

 Buses with H=30 seconds in Pl. España


 Time needed for loading = 2 min
 We need a loading dock with 4 buses in 30” 60” 90” seg.
parallel
Serial loading: only 8 pax have Parallel loading: full buses
the time to get into the bus having 2 min to load pax
(reaction time + acceleration +
deceleration time = 10 seconds)

We need to “design” the services as well! 35

Stochastic models

 = Arrival rate (customers/min)  = Traffic intensity


 = Service rate (customers/min) (light traffic, heavy traffic)

36

18
Total time in the system
“It is better to have stochastic service time than stochastic arrivals”

Total time in
the system

S/S
S/D
D/S
1/µ
D/D
ρ
0 1 Traffic intensity
D: DETERMINISTIC; S: STOCHASTIC

Total time in
the system
M/M/n
n Number of servers
1/µ

1 ρ

“Only with infinite channels stochastic queues will be eliminated”


37

Stochastic models
- Unknown numerically arrival and departure curves.

- Need of probability distributions to describe real arrival and departure


processes.

- There is no general model for all possible cases: enough complex to


represent the real world, but enough simple to work mathematically.

- Development of compact formulations and probabilistic descriptions of


arrivals and departures:

- State of system (n): number of customers in the system N(t) at


time t.
- Queue length.
- Pn(t): Probability of n customers in the system at time t.
Utilization rate - c: number of servers.
ρ = λ / cµ - λn: average arrival rate of new customers when there are n
customers in the system. (if constant for any system state n, λn
= λ)
- µn: average service rate of the whole system when there are n
customers in the system. (if constant for any server, µn = nµ for
n>c or µn = cµ for n<c) 38

19
Stochastic Models
 NOMENCLATURE A: arrival process; B: service time distribution

A/B/c/d/e + queue discipline

# channels capacity population

Distributions (A/B): M (Markov); D (deterministic); G (general); Ek (k-Erlang); H (hyperexponential)

 PROBABILITY OF STATE AND EQUATIONS OF EQUILIBRIUM

Pn = prob. of n customers in the system


𝐿= 𝑛𝑃

𝐿 = (𝑛 − 𝑐)𝑃

 EXACT EQUATIONS (EXPLICIT) ONLY FOR M/M/m AND M/D/1


39

Queueing management

40

20
Queuing management

Reduction of delays
 CHANGES IN SERVICE
- SERVICE IN TEAM: Free server helps
- FLEXIBLE ASSIGNMENT
- AUTOMATIZED SERVICE
- REDUCTION OF CUSTOMER PARTICIPATION
- CUSTOMER PARTICIPATION: e.g. gas station, forms, packing in supermarket.
- SIMULTANEOUS SERVICE: meanwhile a customer decides or participates.
- SERVICE IN GROUPS: similar customers e.g. Medical prescriptions in Social Security
services
- ALTERNATION OF CUSTOMER TYPES: e.g. Pick up + delivery “messengers”
- INCREASING THE NUMBER OF SERVERS: Part-Time
- ELIMINATION OF PREDICTABLE QUEUES
- TEMPORARY INCREMENT OF CAPACITY (RESOURCES ASSIGNMENT)
41

Queuing management
Reduction of delays
 CHANGES IN ARRIVALS
- RESERVATIONS AND APPOINTMENTS e.g. Restaurant, doctor
- PRICE e.g. Automatic discounts on Sunday from 8 to 12 h (Macy’s, USA)
- UNDERLYING ARRIVAL PROCESS: Flextime
- ABANDONMENT: Info. traffic dynamics, radio

-PSYCHOLOGY
- Entertainment: comfort, performances
- Information: reasons+ info.+ remember they have not been forgotten
- Equity
- PHYSIOLOGY
- Noise
 DESIGN - Lighting
- Ventilation / temperature: water in queues under the sun
- Agglomerations
-QUEUING DISCIPLINE
- Passive maintenance
- Active maintenance
- QUEUE DESIGN Avoid demoralization
42

21
Conclusions

-“TRADE-OFF” BETWEEN COST AND LEVEL OF SERVICE


-“BUSINESS UNITS” OF DIFFERENT COSTS (MONEY + COST OF DELAY)
- DELAY DECREASING DOES NOT MEAN MORE COST
- USE IN STRATEGIC AND OPERATIONAL PLANNING
- ANALYSIS GUARANTEES FUNCTIONALITY....
- …AND CAN SAVE A LOT OF MONEY
- PSYCHOLOGICAL ASPECTS
- APPLYCABILITY IN TRANSPORT BUT ALSO IN OTHER PROFESSIONAL FIELDS
(PUBLIC WORKS AND CONSTRUCTION, COMPANYIES OPERATIONS, ETC.)

43

Referencias

• Hillier, F.S. y Lieberman, G.J. (2002) Introduction to operations


research. ISBN970-10-3486-4
• Hall, R. W. (1991) Queueing methods for services and manufacturing.
Prentice-Hall, Englewood cliffs, USA.
• Newell,G. F. (1982) Applications of queueing theory. Chapman and
Hall, Cambridge, United Kingdom.

44

22
Transport
Plan
Plan de Systems
de Formación
Formación (40h)
(40h)

Lecture 3. Queues

23

You might also like