Section 1.2: A Single Server Queue

Similar documents
Section 3.3: Discrete-Event Simulation Examples

CPSC 531: System Modeling and Simulation. Carey Williamson Department of Computer Science University of Calgary Fall 2017

NATCOR: Stochastic Modelling

Queueing Theory I Summary! Little s Law! Queueing System Notation! Stationary Analysis of Elementary Queueing Systems " M/M/1 " M/M/m " M/M/1/K "

Queueing Review. Christos Alexopoulos and Dave Goldsman 10/6/16. (mostly from BCNN) Georgia Institute of Technology, Atlanta, GA, USA

Slides 9: Queuing Models

Queueing Theory. VK Room: M Last updated: October 17, 2013.

Queueing Systems: Lecture 3. Amedeo R. Odoni October 18, Announcements

Networking = Plumbing. Queueing Analysis: I. Last Lecture. Lecture Outline. Jeremiah Deng. 29 July 2013

Richard C. Larson. March 5, Photo courtesy of Johnathan Boeke.

Queueing Review. Christos Alexopoulos and Dave Goldsman 10/25/17. (mostly from BCNN) Georgia Institute of Technology, Atlanta, GA, USA

11 The M/G/1 system with priorities

Massachusetts Institute of Technology

PBW 654 Applied Statistics - I Urban Operations Research

Queues and Queueing Networks

Chapter 6 Queueing Models. Banks, Carson, Nelson & Nicol Discrete-Event System Simulation

5/15/18. Operations Research: An Introduction Hamdy A. Taha. Copyright 2011, 2007 by Pearson Education, Inc. All rights reserved.

IEOR 6711, HMWK 5, Professor Sigman

ISyE 2030 Practice Test 1

Queueing Theory and Simulation. Introduction

Class 11 Non-Parametric Models of a Service System; GI/GI/1, GI/GI/n: Exact & Approximate Analysis.

Computer Networks More general queuing systems

Computer Science, Informatik 4 Communication and Distributed Systems. Simulation. Discrete-Event System Simulation. Dr.

Photo: US National Archives

Introduction to Queueing Theory with Applications to Air Transportation Systems

Performance Evaluation of Queuing Systems

CPU scheduling. CPU Scheduling

Advanced Computer Networks Lecture 3. Models of Queuing

Chapter 2 Queueing Theory and Simulation

M/G/1 and Priority Queueing

EE 368. Weeks 3 (Notes)

BIRTH DEATH PROCESSES AND QUEUEING SYSTEMS

Queuing Theory. Using the Math. Management Science

Queueing systems. Renato Lo Cigno. Simulation and Performance Evaluation Queueing systems - Renato Lo Cigno 1

1.225 Transportation Flow Systems Quiz (December 17, 2001; Duration: 3 hours)

Exact Simulation of the Stationary Distribution of M/G/c Queues

Queuing Theory. The present section focuses on the standard vocabulary of Waiting Line Models.

Fluid Models of Parallel Service Systems under FCFS

Systems Simulation Chapter 6: Queuing Models

Continuous Time Processes

Queuing Theory. Queuing Theory. Fatih Cavdur April 27, 2015

Single-Server Service-Station (G/G/1)

Queuing Analysis. Chapter Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

QUEUING SYSTEM. Yetunde Folajimi, PhD

Module 5: CPU Scheduling

Lecture 7: Simulation of Markov Processes. Pasi Lassila Department of Communications and Networking

Chapter 6: CPU Scheduling

Analysis of Software Artifacts

CPU Scheduling. CPU Scheduler

Classification of Queuing Models

Contents Preface The Exponential Distribution and the Poisson Process Introduction to Renewal Theory

Fuzzy Queues with Priority Discipline

IOE 202: lectures 11 and 12 outline

Section 7.3: Continuous RV Applications

GI/M/1 and GI/M/m queuing systems

4.7 Finite Population Source Model

Elementary queueing system

Non Markovian Queues (contd.)

57:022 Principles of Design II Final Exam Solutions - Spring 1997

Scheduling I. Today Introduction to scheduling Classical algorithms. Next Time Advanced topics on scheduling

Kendall notation. PASTA theorem Basics of M/M/1 queue

Introduction to Queueing Theory

Queueing. Chapter Continuous Time Markov Chains 2 CHAPTER 5. QUEUEING

Generation of Discrete Random variables

Control of Fork-Join Networks in Heavy-Traffic

UNIVERSITY OF YORK. MSc Examinations 2004 MATHEMATICS Networks. Time Allowed: 3 hours.

Verification and Validation. CS1538: Introduction to Simulations

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

The Transition Probability Function P ij (t)

Figure 10.1: Recording when the event E occurs

Stationary remaining service time conditional on queue length

6 Solving Queueing Models

2/5/07 CSE 30341: Operating Systems Principles

THE STRUCTURE AND PERFORMANCE OF OPTIMAL ROUTING SEQUENCES. Proefschrift

Sandwich shop : a queuing net work with finite disposable resources queue and infinite resources queue

Solutions to COMP9334 Week 8 Sample Problems

Data analysis and stochastic modeling

Intro to Queueing Theory

Scheduling I. Today. Next Time. ! Introduction to scheduling! Classical algorithms. ! Advanced topics on scheduling

Lecture 20: Reversible Processes and Queues

A Fuzzy Approach to Priority Queues

Introduction to queuing theory

Simulation of Process Scheduling Algorithms

Queuing Theory. 3. Birth-Death Process. Law of Motion Flow balance equations Steady-state probabilities: , if

CSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song

Homework 1 - SOLUTION

Chapter 1. Introduction. 1.1 Stochastic process

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.265/15.070J Fall 2013 Lecture 22 12/09/2013. Skorokhod Mapping Theorem. Reflected Brownian Motion

The Queue Inference Engine and the Psychology of Queueing. ESD.86 Spring 2007 Richard C. Larson

Introduction to Markov Chains, Queuing Theory, and Network Performance

I, A BRIEF REVIEW ON INFINITE QUEUE MODEL M.

Chapter 10. Queuing Systems. D (Queuing Theory) Queuing theory is the branch of operations research concerned with waiting lines.

Routing and Staffing in Large-Scale Service Systems: The Case of Homogeneous Impatient Customers and Heterogeneous Servers 1

NEW FRONTIERS IN APPLIED PROBABILITY

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

λ, µ, ρ, A n, W n, L(t), L, L Q, w, w Q etc. These

Solutions to Homework Discrete Stochastic Processes MIT, Spring 2011

THE HEAVY-TRAFFIC BOTTLENECK PHENOMENON IN OPEN QUEUEING NETWORKS. S. Suresh and W. Whitt AT&T Bell Laboratories Murray Hill, New Jersey 07974

10.2 For the system in 10.1, find the following statistics for population 1 and 2. For populations 2, find: Lq, Ls, L, Wq, Ws, W, Wq 0 and SL.

7. Queueing Systems. 8. Petri nets vs. State Automata

Transcription:

Section 12: A Single Server Queue Discrete-Event Simulation: A First Course c 2006 Pearson Ed, Inc 0-13-142917-5 Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 1/ 30

Section 12: A Single-Server Queue arrivals queue server departures service node A single-server service node consists of a server plus its queue If there is only one service technician, the machine shop model from section 11 is a single-server queue Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 2/ 30

Queue Discipline Queue discipline: the algorithm used when a job is selected from the queue to enter service FIFO first in, first out LIFO last in, first out SIRO serve in random order Priority typically shortest job first (SJF) Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 3/ 30

Assumptions FIFO is also known as first come, first serve (FCFS) The order of arrival and departure are the same This observation can be used to simplify the simulation Unless otherwise specified, assume FIFO with infinite queue capacity Service is non-preemptive Once initiated, service of a job will continue until completion Service is conservative Server will never remain idle if there is one or more jobs in the service node Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 4/ 30

Specification Model For a job i: The arrival time is a i The delay in the queue is d i The time that service begins is b i = a i + d i The service time is s i The wait in the node is w i = d i + s i The departure time is c i = a i + w i w i d i s i time a i b i c i Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 5/ 30

Arrivals The interarrival time between jobs i 1 and i is where, by definition, a 0 = 0 r i = a i a i 1 r i a i 2 a i 1 a i a i+1 Note that a i = a i 1 + r i and so (by induction) time a i = r 1 + r 2 + + r i i = 1,2,3, Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 6/ 30

Algorithmic Question Given the arrival times and service times, can the delay times be computed? For some queue disciplines, this question is difficult to answer If the queue discipline is FIFO, d i is determined by when a i occurs relative to c i 1 There are two cases to consider: Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 7/ 30

Cases If a i < c i 1, job i arrives before job i 1 completes: d i 1 s i 1 a i 1 b i 1 c i 1 a i b i c i r i d i s i If a i c i 1, job i arrives after job i 1 completes: d i 1 s i 1 a i 1 b i 1 c i 1 r i s i a i c i t t Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 8/ 30

Calculating Delay for Each Job Algorithm 121 c 0 = 00; /* assumes that a 0 = 00 */ i = 0; while ( more jobs to process ) { i++; a i = GetArrival(); if (a i < c i 1 ) d i = c i 1 a i ; else d i = 00; s i = GetService(); c i = a i + d i + s i ; } n = i; return d 1, d 2,, d n ; Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 9/ 30

Example 122 Algorithm 121 used to process n = 10 jobs i 1 2 3 4 5 6 7 8 9 10 read from file a i 15 47 71 111 123 152 166 226 310 320 from algorithm d i 0 11 23 17 35 44 70 41 0 26 read from file s i 43 36 34 30 38 40 31 29 36 30 For future reference, note that for the last job a n = 320 c n = a n + d n + s n = 320 + 26 + 30 = 376 Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 10/ 30

Output Statistics The purpose of simulation is insight gained by looking at statistics The importance of various statistics varies on perspective: Job perspective: wait time is most important Manager perspective: utilization is critical Statistics are broken down into two categories Job-averaged statistics Time-averaged statistics Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 11/ 30

Job-Averaged Statistics Job-averaged statistics: computed via typical arithmetic mean Average interarrival time: r = 1 n n i=1 r i = a n n 1/r is the arrival rate Average service time: s = 1 n n i=1 s i 1/s is the service rate Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 12/ 30

Example 123 For the 10 jobs in Example 122 average interarrival time is r = a n /n = 320/10 = 320 seconds per job average service is s = 347 seconds per job arrival rate is 1/r 0031 jobs per second service rate is 1/s 0029 jobs per second The server is not quite able to process jobs at the rate they arrive on average Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 13/ 30

Job-Averaged Statistics The average delay and average wait are defined as d = 1 n n i=1 d i Recall w i = d i + s i for all i w = 1 n n i=1 w i w = 1 n n w i = 1 n i=1 n (d i + s i ) = 1 n i=1 n d i + 1 n i=1 n s i = d + s i=1 Sufficient to compute any two of w, d, s Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 14/ 30

Example 124 From the data in Example 122, d = 267 From Example 123, s = 347 Therefore w = 267 + 347 = 614 Recall verification is one (difficult) step of model development Consistency check: used to verify that a simulation satisfies known equations Compute w, d, and s independently Then verify that w = d + s Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 15/ 30

Time-Averaged Statistics Time-averaged statistics: defined by area under a curve (integration) For SSQ, need three additional functions l(t): number of jobs in the service node at time t q(t): number of jobs in the queue at time t x(t): number of jobs in service at time t By definition, l(t) = q(t) + x(t) l(t) = 0,1,2, q(t) = 0,1,2, x(t) = 0,1 Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 16/ 30

Time-Averaged Statistics All three functions are piece-wise constant 4 3 l(t) 2 1 0 0 376 t Figures for q( ) and x( ) can be deduced q(t) = 0 and x(t) = 0 if and only if l(t) = 0 Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 17/ 30

Time-Averaged Statistics Over the time interval (0,τ): time-averaged number in the node: l = 1 τ time-averaged number in the queue: q = 1 τ time-averaged number in service: x = 1 τ Since l(t) = q(t) + x(t) for all t > 0 l = q + x τ 0 τ 0 τ 0 l(t)dt q(t)dt x(t)dt Sufficient to calculate any two of l, q, x Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 18/ 30

Example 125 From Example 122 (with τ = c 10 = 376), l = 1633 q = 0710 x = 0923 The average of numerous random observations (samples) of the number in the service node should be close to l Same holds for q and x Server utilization: time-averaged number in service (x) x also represents the probability the server is busy Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 19/ 30

Little s Theorem How are job-averaged and time-average statistics related? Theorem (Little, 1961) If (a) queue discipline is FIFO, (b) service node capacity is infinite, and (c) server is idle both at t = 0 and t = c n then cn 0 l(t)dt = n i=1 w i and cn 0 q(t)dt = n i=1 d i and cn 0 x(t)dt = n i=1 s i Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 20/ 30

Little s Theorem Proof Proof For each job i = 1, 2,, define an indicator function { 1 ai < t < c ψ i (t) = i 0 otherwise Then and so l(t) = n ψ i (t) i=1 0 < t < c n cn 0 l(t)dt = cn 0 n ψ i (t)dt = i=1 n cn i=1 0 ψ i (t)dt = n (c i a i ) = n i=1 i=1 w i The other two equations can be derived similarly Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 21/ 30

Example 126 10 9 8 7 6 5 4 3 2 1 0 w 1 cumulative number w 2 of arrivals w 3 w 4 w 5 w 6 0 376 w 7 w 8 cumulative number of departures w 9 w 10 t 376 0 l(t)dt = 10 i=1 w i = 614 Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 22/ 30

Little s Equations Using τ = c n in the definition of the time-averaged statistics, along with Little s Theorem, we have c n l = cn 0 l(t)dt = n w i = nw i=1 We can perform similar operations and ultimately have ( n l = c n ) ( ) ( ) n n w and q = d and x = s c n c n Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 23/ 30

Computational Model The ANSI C program ssq1 implements Algorithm 121 Data is read from the file ssq1dat consisting of arrival times and service times in the format a1 s 1 a 2 s 2 a n s n Since queue discipline is FIFO, no need for a queue data structure Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 24/ 30

Example 128 Running program ssq1 with ssq1dat 1/r 010 and 1/s 014 If you modify program ssq1 to compute l,q, and x x 028 Despite the significant idle time, q is nearly 2 Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 25/ 30

Traffic Intensity Traffic intensity: ratio of arrival rate to service rate 1/r 1/s = s r = s ( ) a n /n = cn x a n Assuming c n /a n is close to 10, the traffic intensity and utilization will be nearly equal Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 26/ 30

Case Study Sven and Larry s Ice Cream Shoppe owners considering adding new flavors and cone options concerned about resulting service times and queue length Can be modeled as a single-server queue ssq1dat represents 1000 customer interactions Multiply each service time by a constant In the following graph, the circled point uses unmodified data Moving right, constants are 105, 110, 115, Moving left, constants are 095, 090, 085, Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 27/ 30

Sven and Larry 120 100 q 80 60 40 20 00 04 05 06 07 08 09 10 x Modest increase in service time produces significant increase in queue length Non-linear relationship between q and x Sven and Larry will have to assess the impact of the increased service times Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 28/ 30

Graphical Considerations 120 100 q 80 60 40 20 00 04 05 06 07 08 09 10 x Since both x and q are continuous, we could calculate an infinite number of points Few would question the validity of connecting the dots Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 29/ 30

Guidelines If there is essentially no uncertainty and the resulting interpolating curve is smooth, connecting the dots is OK Leave the dots as a reminder of the data points If there is essentially no uncertainty but the curve is not smooth, more dots should be generated If the dots correspond to uncertain (noisy) data, then interpolation is not justified Use approximation of a curve or do not superimpose at all Discrete data should never have a solid curve Discrete-Event Simulation: A First Course Section 12: A Single Server Queue 30/ 30