02 basics of queueing theory

Upload: jayanth8

Post on 09-Mar-2016

220 views

Category:

Documents


0 download

DESCRIPTION

Digital Simulation - Operations Research

TRANSCRIPT

Randomness in Simulation

Basics of Queueing TheoryMaterial from Chapter 2 of Simio and Simulation: Modeling, Analysis, Applications as well as external sourcesIn general, randomness makes systems difficult to model and analyze.

1IntroductionMost (not all) simulations are of queueing systems, or networks of queues, modeling real systemsCustomers show up, wait for service, get served, maybe go elsewhere, wait again, get served again, etc., maybe leaveChapter 2Basics of Queueing Theory2SystemCustomersServersManufacturingPartsMachines, people, transportUrgent-care clinicPatientsDoctors, nurses, other staff, roomsSupply chainParcels, loads, trucksDocks, warehouse space, trucksBankCustomersTellers, loan officers, drive-throughsAmusement parkGuestsRides, food stands, urgent-care clinicComputer labStudentsComputers, printers, help staffTelecommunicationsMessages, packetsTerminals, relays, switchesTraffic intersectionVehicles, pedestriansSegments of space in the intersectionA Single-Server Queueing SystemChapter 2Basics of Queueing Theory3RegistrationQueueReg. DeskArrivingpatientsDepartingpatientsPatient beingregisteredOften interested in output performance measures (metrics), likeTotal number of patients going from entry to exit over a fixed time periodAverage time in queue (waiting time), not counting service timeMaximum time in queueTime-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 periodAverage patient time in systemMaximum patient time in systemUtilization 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)Urgent-Care ClinicChapter 2Basics of Queueing Theory4

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)?Random arrivals (no appointments)Branching probabilities (independent)Why Study Queueing Theory with Simulation?Chapter 2Basics of Queueing Theory5Terminology, logic similar to many simulation modelsIn 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 timesModify 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!

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, its an open system, otherwise if they never leave its closed)Queueing network could consist of several separate queueing stations, each of which is a single- or multiple-server queueIf 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 objectsPriority Shortest Job First (SJF); or Maximum Value First (MVF)Queueing-System Structure and TerminologyChapter 2Basics of Queueing Theory6Queueing-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 busyChapter 2Basics of Queueing Theory7Urgent Care Clinic

1/1/2014Basics of Queueing Theory8Kelton et al., 2011, p. 21Example Single-server Queueing System1/1/2014Basics of Queueing Theory9RegistrationQueueReg. DeskArrivingpatientsDepartingpatientsPatient beingregisteredSimple queueing system. Generally interested in things like:Total production over a fixed periodAverage time in queue (waiting time)Maximum time in queueTime-average number of parts in queueMaximum number of parts in queue over a fixed periodAverage time in systemMaximum time in systemUtilization of the drill press

We will generally be interested in networks of queues as we saw in the previous slide.9Patient Arrival/Registration Time DataPatientArrival TimeIATST100223353412473351472616277193382672935911038371/1/2014Basics of Queueing Theory10IAT Interarrival timeST Service Time

101/1/2014Basics of Queueing Theory11Queuing SystemsCommon assumptions:c servers with a single queue with FIFO orderingA1, A2, , An are IID random variables (interarrival times) l is the arrival rateS1, S2, , Sn are IID random variables (service times) m is the service rateAs and Ss are independent r = l/cm is the utilizationA/B/c/k queuing system (Kendalls notation) M/M/1M/M/cM/G/cGI/G/c11As are the interarrival times and Ss are the service times

Kendalls notation (A/B/c/k arrival process, service process, num servers, capacity (if not infinite)).

Rates vs. times show the timeline with arrivals and distinguish between arrival times, interarrival times and arrival rate.1/1/2014Basics of Queueing Theory12Queuing SystemsDefine the following performance measures:Wqi is the delay in the queue for the ith customerWi = Wqi + Si is the waiting time in the system for the ith customerLq(t) is the number of customers in the queue at time tL(t) is the number of customers in the system at time t (Lq(t) plus the number being served at time t)

Steady state averagedelay in the queueSteady state averagewaiting time in the system12What do we mean by steady state?1/1/2014Basics of Queueing Theory13Queuing Systems

Steady state time-averagenumber in the queueSteady state time-averagenumber in the systemConservation equations

131/1/2014Basics of Queueing Theory14M/M/c Queuing Formulae

Askin, R. G. and C. R. Standridge, Modeling and Analysis of Manufacturing Systems, John Wiley & Sons, New York, NY, 1993.14As well see throughout the rest of the semester, queueing analysis is very important for validation/verification.

I give you this formula table for exams. Make sure that you know how to use the formulae.M/G/1 Queuing Formulae1/1/2014Basics of Queueing Theory15Exponentially distributed interarrival times with rate lGeneral service times with rate m and variance sS2

15Queueing NetworksConsist of nodes, each of which is a G/G/c station, connected by arcs representing possible entity travel between nodesCan also have entity arrivals from outside the network, and entities can exit from any node to outside the systemWhen an entity leaves a node, it can go out on any of the arcs emanating from that node, with arc probabilities summing to 1Assume:All arrival processes from outside haveexponential interarrival times (a.k.a.Poisson processes), and are independentof each otherAll service times are independentexponential (so each node is an M/M/c)All queue capacities are infiniteUtilization (a.k.a. traffic intensity) locally at each node is < 1Chapter 2Basics of Queueing Theory16Called a Jackson network with these assumptions; much is known about itQueueing Networks1/1/2014Basics of Queueing Theory17

Kelton et al., 2011, p. 21If we assume:All arrival processes from outside are independent with exponential IAT (Poisson)All service times are exponentially distributed and are independentAll queue capacities are infiniteThe utilization, rho, at each node is strictly less than 1.We have a Jackson Network.

Under these assumptions, each station can be analyzed independently and the results combined.

17Queueing 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 earlierJust have to compute Poisson arrival input/output rates using decomposition, superposition of Poisson processesLet SignIn be the (Poisson) arrival rate into the Sign In station, assume exponential service times throughout:Chapter 2Basics of Queueing Theory18

Analyze each node independently as:Sign In: M/M/2, arrival rate SignIn Registration: M/M/1, arrival rate 0.9SignInTrauma Rooms: M/M/2, arrival rate 0.1SignInExam Rooms: M/M/4, arrival rate 0.9SignInTreatment Rooms: M/M/2, arrival rate (0.9)(0.6)SignIn + 0.1SignIn = 0.64SignInQueueing Network Example1/1/2014Basics of Queueing Theory19Bl = 20/hrSTA ~ expo(1.875) minACSTB ~ expo(4.0) minSTC ~ expo(6.667) min60%40%Discuss times vs rates (IAT vs arrival rate, ST vs service rate)

Discuss time units (arrival rate given in hours, service times in minutes)

Analyze individually as M/M/1

A (20, 32, 1)B (12, 15, 1)C (8, 9, 1)

Avg. num in sys: 13.667Avg. time in sys: 0.683

Issues with queueing analysis:AssumptionsExponentialFIFOInfinite queuesProbabilistic branchingSteady-state analysis19Queueing Theory vs. SimulationQueueing-theoretic results have the advantage of being exact, i.e., no statistical uncertainty/variationSimulation results have statistical uncertainty/variation, which needs to be acknowledged and appropriately addressedBut queueing theory has its own shortcomings:Strong assumptions that may be unrealistic, like exponential service times (mode = 0?), making model validity questionableNearly always only for steady-state long-run behavior, so dont address what happens in the short runNot 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 facilitatedCan address short-term time frames in fact, steady-state is harder for simulation (long runs, initialization bias) than for queueing theoryJust have to be mindful of proper statistical design/analysis

Chapter 2Basics of Queueing Theory20