290 likes | 1.3k Views
Basics of Queueing Theory. Material from Chapter 2 of Simio and Simulation: Modeling, Analysis, Applications as well as external sources. Introduction. Most (not all) simulations are of queueing systems, or networks of queues, modeling real systems
E N D
Basics of Queueing Theory Material from Chapter 2 of Simio and Simulation: Modeling, Analysis, Applications as well as external sources
Introduction • Most (not all) simulations are of queueing systems, or networks of queues, modeling real systems • “Customers” show up, wait for “service,” get served, maybe go elsewhere, wait again, get served again, etc., maybe leave Basics of Queueing Theory
A Single-Server Queueing System Registration • Often interested in output performance measures (metrics), like • Total number of patients going from entry to exit over a fixed time period • Average time in queue (waiting time), not counting service time • Maximum time in queue • Time-average number of parts in queue (area under number-in-queue function, divided by length of time period) • Maximum number of patients in queue over a fixed time period • Average patient time in system • Maximum patient time in system • Utilization of the server (proportion of time busy) • Could be a node in a larger queueing network … Interarrival times, service times random (need to specify probability distributions) Reg. Desk Arriving patients Departing patients Patient being registered Queue Basics of Queueing Theory
Urgent-Care Clinic • Random arrivals (no appointments) • Branching probabilities (independent) • Some questions: • How many staff of which type during which time periods? • How big should the waiting room(s) be? • What would be the effect on patient waits if doctors and nurses tended to decrease or increase the time they spend with patients? • What if 10% more patients arrived (arrival rate increased by 10%)? • Should we serve patients in order of their acuity, or just first-in-first-out (FIFO)? Basics of Queueing Theory
Why Study Queueing Theory with Simulation? • Terminology, logic similar to many simulation models • In some cases, can derive exact closed-form formulas for output performance metrics, use to verify (debug) simulation models: • Have simulation model of complex system that does not meet queueing-theory assumptions … but it would if we made some (over-)simplifying extra assumptions like exponential distributions for inter-arrival and service times • Modify the simulation model so that it meets these extra assumptions, run it for a very long time … queueing-theoretic results are typically available only for steady state (a.k.a. long run, infinite horizon) • Compare simulation output with queueing-theoretic results … if they (approximately) agree, then confidence in the simulation is improved. • Restore your simulation model back the way it should be! Basics of Queueing Theory
Queueing-System Structure and Terminology • Entities (like customers, patients, jobs) arrive, get served either at a single station or at several stations, may wait in queue(s), and may leave the system (if they do, it’s an open system, otherwise if they never leave it’s closed) • Queueing network could consist of several separate queueing stations, each of which is a single- or multiple-server queue • If multiple server, usually assume that a single queue “feeds” all the parallel servers, and that the servers are identical in service speeds: • Queue disciplines – when an entity can leave the queue and start service, which entity gets to be the next one to be served? • First-in, first-out (FIFO), a.k.a. first-come, first-served (FCFS) • Last-in, first-out (LIFO) – a “stack” of physical or logical objects • Priority – Shortest Job First (SJF); or Maximum Value First (MVF) Basics of Queueing Theory
Queueing-System Performance Metrics • (Wq) Time in queue (excluding service time); if in a network, either overall (added up for all queueing waits) or at individual stations • (W) Time in system, including time in queue plus service time (again over the network or at a node) • (Lq) Number of entities in queue (a.k.a. queue length), not including any entities in service (again, over the network or at a node) • (L) Number of entities in system, including in queue plus in service (over network or at a node) • (ρ) Utilization of a server, or of a group of parallel identical servers, the time-average number of individual servers in the group who are busy Basics of Queueing Theory
Urgent Care Clinic Kelton et al., 2011, p. 21 Basics of Queueing Theory
Example Single-server Queueing System Registration Reg. Desk Departing patients Arriving patients Queue Patient being registered Basics of Queueing Theory
Patient Arrival/Registration Time Data Basics of Queueing Theory
Queuing Systems • Common assumptions: • c servers with a single queue with FIFO ordering • A1, A2, …, An are IID random variables (interarrival times) • l is the arrival rate • S1, S2, …, Sn are IID random variables (service times) • m is the service rate • A’s and S’s are independent • r = l/cm is the utilization • A/B/c/k queuing system (Kendall’s notation) • M/M/1 • M/M/c • M/G/c • GI/G/c Basics of Queueing Theory
Queuing Systems • Define the following performance measures: • Wqi is the delay in the queue for the ith customer • Wi = Wqi + Si is the waiting time in the system for the ith customer • Lq(t) is the number of customers in the queue at time t • L(t) is the number of customers in the system at time t (Lq(t) plus the number being served at time t) Steady state average delay in the queue Steady state average waiting time in the system Basics of Queueing Theory
M/M/c Queuing Formulae Askin, R. G. and C. R. Standridge, Modeling and Analysis of Manufacturing Systems, John Wiley & Sons, New York, NY, 1993. Basics of Queueing Theory
Queueing Networks • Consist of nodes, each of which is a G/G/c station, connected by arcs representing possible entity travel between nodes • Can also have entity arrivals from outside the network, and entities can exit from any node to outside the system • When an entity leaves a node, it can go out on any of the arcs emanating from that node, with arc probabilities summing to 1 • Assume: • All arrival processes from outside haveexponential interarrival times (a.k.a.Poisson processes), and are independentof each other • All service times are independentexponential (so each node is an M/M/c) • All queue capacities are infinite • Utilization (a.k.a. traffic intensity) locally at each node is < 1 Called a Jackson network with these assumptions; much is known about it Basics of Queueing Theory
Queueing Networks Kelton et al., 2011, p. 21 Basics of Queueing Theory
Queueing Networks (cont.) • Use all of this to analyze each node in a Jackson network as a stand-alone M/M/c queue, using formulae given earlier • Just have to compute Poisson arrival input/output rates using decomposition, superposition of Poisson processes • Let SignIn be the (Poisson) arrival rate into the Sign In station, assume exponential service times throughout: Analyze each node independently as: Sign In: M/M/2, arrival rate SignIn Registration: M/M/1, arrival rate 0.9SignIn Trauma Rooms: M/M/2, arrival rate 0.1SignIn Exam Rooms: M/M/4, arrival rate 0.9SignIn Treatment Rooms: M/M/2, arrival rate (0.9)(0.6)SignIn + 0.1SignIn = 0.64SignIn Basics of Queueing Theory
Queueing Network Example 60% STB ~ expo(4.0) min l = 20/hr B A C 40% STA ~ expo(1.875) min STC ~ expo(6.667) min Basics of Queueing Theory
Queueing Theory vs. Simulation • Queueing-theoretic results have the advantage of being exact, i.e., no statistical uncertainty/variation • Simulation results have statistical uncertainty/variation, which needs to be acknowledged and appropriately addressed • But queueing theory has its own shortcomings: • Strong assumptions that may be unrealistic, like exponential service times (mode = 0?), making model validity questionable • Nearly always only for steady-state long-run behavior, so don’t address what happens in the short run • Not available for all inter-arrival/service distributions, or (more importantly) for complex systems (Jackson network is simple, restrictive) • Despite output uncertainty, simulation has major advantages: • No restrictions on input distributions, model form, or complexity … so model validity is facilitated • Can address short-term time frames … in fact, steady-state is harder for simulation (long runs, initialization bias) than for queueing theory • Just have to be mindful of proper statistical design/analysis Basics of Queueing Theory