CDA6530: Performance Models of Computers and Networks. Chapter 8: Discrete Event Simulation (DES)

Similar documents
Simulation & Modeling Event-Oriented Simulations

Discrete-event simulations

Solutions to COMP9334 Week 8 Sample Problems

Queueing Theory and Simulation. Introduction

Discrete Event Simulation

Generation of Discrete Random variables

Introduction to Queueing Theory with Applications to Air Transportation Systems

EE 368. Weeks 3 (Notes)

The University of British Columbia Computer Science 405 Practice Midterm Solutions

CDA6530: Performance Models of Computers and Networks. Chapter 8: Discrete Event Simulation Example --- Three callers problem in homwork 2

Session-Based Queueing Systems

CDA6530: Performance Models of Computers and Networks. Chapter 8: Discrete Event Simulation Example --- Three callers problem in homwork 2

Ways to study a system System

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 "

Chapter 2 Queueing Theory and Simulation

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

CS 798: Homework Assignment 3 (Queueing Theory)

Generating Random Variates II and Examples

Simulation. Where real stuff starts

Design of discrete-event simulations

Simulation. Where real stuff starts

Queueing Theory II. Summary. ! M/M/1 Output process. ! Networks of Queue! Method of Stages. ! General Distributions

Readings: Finish Section 5.2

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

Course Outline Introduction to Transportation Highway Users and their Performance Geometric Design Pavement Design

Performance Evaluation of Queuing Systems

IEOR 4404: Homework 6

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

Dynamic Call Center Routing Policies Using Call Waiting and Agent Idle Times Online Supplement

Since D has an exponential distribution, E[D] = 0.09 years. Since {A(t) : t 0} is a Poisson process with rate λ = 10, 000, A(0.

ISE/OR 762 Stochastic Simulation Techniques

Section 3.3: Discrete-Event Simulation Examples

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

2905 Queueing Theory and Simulation PART IV: SIMULATION

6 Solving Queueing Models

Non Markovian Queues (contd.)

IEOR 6711: Stochastic Models I, Fall 2003, Professor Whitt. Solutions to Final Exam: Thursday, December 18.

Problem. Problem Given a dictionary and a word. Which page (if any) contains the given word? 3 / 26

Simulation Modeling. Random Numbers

Queuing Networks: Burke s Theorem, Kleinrock s Approximation, and Jackson s Theorem. Wade Trappe

Dynamic Call Center Routing Policies Using Call Waiting and Agent Idle Times Online Supplement

Time Reversibility and Burke s Theorem

CDA5530: Performance Models of Computers and Networks. Chapter 4: Elementary Queuing Theory

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

Name of the Student:

QueueTraffic and queuing theory

Multimedia Communication Services Traffic Modeling and Streaming

Queueing Systems: Lecture 6. Lecture Outline

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

Control of Fork-Join Networks in Heavy-Traffic

M/G/1 and Priority Queueing

PBW 654 Applied Statistics - I Urban Operations Research

NEW FRONTIERS IN APPLIED PROBABILITY

reversed chain is ergodic and has the same equilibrium probabilities (check that π j =

IEOR 6711, HMWK 5, Professor Sigman

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

1.225J J (ESD 205) Transportation Flow Systems

CS5314 Randomized Algorithms. Lecture 15: Balls, Bins, Random Graphs (Hashing)

NICTA Short Course. Network Analysis. Vijay Sivaraman. Day 1 Queueing Systems and Markov Chains. Network Analysis, 2008s2 1-1

Math 416 Lecture 11. Math 416 Lecture 16 Exam 2 next time

NATCOR: Stochastic Modelling

Randomized algorithms. Inge Li Gørtz

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

Improper Nesting Example

MAT SYS 5120 (Winter 2012) Assignment 5 (not to be submitted) There are 4 questions.

CSE 202 Homework 4 Matthias Springer, A

Queueing Networks G. Rubino INRIA / IRISA, Rennes, France

Environment (E) IBP IBP IBP 2 N 2 N. server. System (S) Adapter (A) ACV

Stochastic Simulation Discrete simulation/event-by-event

A Starvation-free Algorithm For Achieving 100% Throughput in an Input- Queued Switch

λ λ λ In-class problems

Approximate Queueing Model for Multi-rate Multi-user MIMO systems.

Distributed Systems Fundamentals

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

Electronic Companion Fluid Models for Overloaded Multi-Class Many-Server Queueing Systems with FCFS Routing

CONTENTS. Preface List of Symbols and Notation

M/G/FQ: STOCHASTIC ANALYSIS OF FAIR QUEUEING SYSTEMS

h(x) = f(x)/g(x) = (1 + x)e (1/2)x.

Chapter 11. Performance Modeling

Chapter 3 Balance equations, birth-death processes, continuous Markov Chains

Cumulative Count Curve and Queueing Analysis

CS145: Probability & Computing Lecture 24: Algorithms

Slides for Chapter 14: Time and Global States

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

ISyE 6644 Fall 2016 Test #1 Solutions

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

FDST Markov Chain Models

TCOM 501: Networking Theory & Fundamentals. Lecture 6 February 19, 2003 Prof. Yannis A. Korilis

Chapter 11. Performance Modeling

Algorithm Design and Analysis

L = λ W time average number in Line or system arrival rate W average Waiting time per customer

Computer Networks More general queuing systems

CSE613: Parallel Programming, Spring 2012 Date: May 11. Final Exam. ( 11:15 AM 1:45 PM : 150 Minutes )

Service Engineering January Laws of Congestion

EFFICIENT COMPUTATION OF PROBABILITIES OF EVENTS DESCRIBED BY ORDER STATISTICS AND APPLICATION TO A PROBLEM OFQUEUES

Exercises Solutions. Automation IEA, LTH. Chapter 2 Manufacturing and process systems. Chapter 5 Discrete manufacturing problems

Cyclic Schedules: General Structure. Frame Size Constraints

TOWARDS BETTER MULTI-CLASS PARAMETRIC-DECOMPOSITION APPROXIMATIONS FOR OPEN QUEUEING NETWORKS

Solution: The process is a compound Poisson Process with E[N (t)] = λt/p by Wald's equation.

IEOR 4106: Spring Solutions to Homework Assignment 7: Due on Tuesday, March 22.

Transcription:

CDA6530: Performance Models of Computers and Networks Chapter 8: Discrete Event Simulation (DES)

Simulation Studies Models with analytical formulas Calculate the numerical solutions Differential equations ---- Matlab Simulink Or directly solve if has closed formula solutions Discrete equations --- program code to solve The mean value formulas for stochastic events Solutions are only for the mean values If you derive models in your paper, you must use real simulation to verify that your analytical formulas are accurate 2

Simulation Studies Models without analytical formulas Monte Carlo simulation Generate a large number of random samples Aggregate all samples to generate final result Example: use U(0,1) to compute integral Discrete-time simulation Divide time into many small steps Update system states step-by-step Approximate, assume system unchanged during a time step Discrete event simulation (DES) Accurate Event-driven 3

Discrete-Time Simulation System is assumed to change only at each discrete time tick Smaller time step, more accurate simulation Why use it? Simpler than DES to code and understand Fast, if system states change very quickly 4

Discrete-Time Simulation While (simulation not complete){ 1). Time tick: k ++; 2). For system s node i (i=1,2,) 3). Simulate what could happen for node i during the last time step (k-1 k) based on all nodes status at k-1 4). Update the state of node i if something happens to it 5). Output time tick k s system s states (e.g., status of every node in the system) } 5

Discrete-Time Simulation Note: when computing system node i s state at time tick k, it should be determined only by all other system nodes states at time tick k-1 Be careful in step 4): not use node j s newly updated value at current round Newly updated value represents state at the beginning of next round. 6

Discrete-Time Simulation An example: one line of nodes X i (t)= (U-0.5) + (X i-1 (t-1) + X i+1 (t-1)) / 2 Simul_N = 1000; n=100; X = ones(n,1); for k=1:simul_n, U = rand(n,1); X(1) = (U(1) - 0.5) + X(2)/2; for i=2:n-1, X(i) = (U(i) - 0.5) + (X(i-1) + X(i+1)) / 2; end X(n) = (U(n) - 0.5) + X(n-1) / 2; % display or save X value for time k end What s Wrong? 7

Discrete-Time Simulation Corrected Code: Simul_N = 1000; n=100; X = ones(n,1); Prior_X = ones(n,1); for t=1:simul_n, U = rand(n,1); Prior_X = X; /* save last time s data */ X(1) = (U(1) - 0.5) + Prior_X(2)/2; for i=2:n-1, X(i) = (U(i) - 0.5) + (Prior_X(i-1) + Prior_X(i+1)) / 2; end X(n) = (U(n) - 0.5) + Prior_X(n-1) / 2; % display or save X value for time k end 8

Time Concept physical time: time in the physical system Noon, Oct. 14, 2008 to noon Nov. 1, 2008 simulation time: representation of physical time within the simulation floating point values in interval [0.0, 17.0] Example: 1.5 represents one and half hour after physical system begins simulation wallclock time: time during the execution of the simulation, usually output from a hardware clock 8:00 to 10:23 AM on Oct. 14, 2008 9

Discrete Event Simulation Computation example: air traffic at an airport events: aircraft arrival, landing, departure arrival schedules 8:00 departure landed schedules 9:15 8:05 arrival 9:30 processed event current event unprocessed event simulation time Unprocessed events are stored in a pending event list Events are processed in time stamp order From: http://www.cc.gatech.edu/classes/ay2004/cs4230_fall/lectures/02-des.ppt 10

DES: No Time Loop Discrete event simulation has no time loop There are events that are scheduled. At each run step, the next scheduled event with the lowest time schedule gets processed. The current time is then that time, the time when that event is supposed to occur. Accurate simulation compared to discretetime simulation Key: We have to keep the list of scheduled events sorted (in order) 11

Time variable t Simulation time Variables Add time unit, can represent physical time Counter variables Keep a count of times certain events have occurred by time t System state (SS) variables We focus on queuing systems in introducing DES 12

Interlude: Simulating non-homogeneous Poisson process for first T time Nonhomogeneous Poisson process: Arrival rate is a variable (t) Bounded: (t) < for all t<t Thinning Method: 1. t=0, I=0 2. Generate a random number U 3. t=t-ln(u)/. If t>t, stop. 4. Generate a random number U 5. If U (t)/, set I=I+1, S(I)=t 6. Go to step 2 Final I is the no. of events in time T S(1),, S(I) are the event times Remove step 4 and condition in step 5 for homogeneous Poisson 13

Subroutine for Generating T s Nonhomogeneous Poisson arrival T s : the time of the first arrival after time s. 1. Let t =s 2. Generate U 3. Let t=t-ln(u)/ 4. Generate U 5. If U (t)/, set T s =t and stop 6. Go to step 2 14

Subroutine for Generating T s Homogeneous Poisson arrival T s : the time of the first arrival after time s. 1. Let t =s 2. Generate U 3. Let t=t-ln(u)/ 4. Set T s =t and stop 15

M/G/1 Queue Variables: Time: t Counters: N A : no. of arrivals by time t N D : no. of departures by time t System state: n no. of customers in system at t Events: Arrival, departure (cause state change) Event list: EL = t A, t D t A : the time of the next arrival after time t T D : departure time of the customer presently being served Output: A(i): arrival time of customer i D(i): departure time of customer i 16

Initialize: Set t=n A =N D =0 Set SS n=0 Generate T 0, and set t A =T 0, t D =1 Service time is denoted as r.v. Y t D = Y + T 0 (optional) 17

If (t A t D ) t=t A (we move along to time t A ) N A = N A +1 (one more arrival) n= n + 1 (one more customer in system) Generate T t, reset t A = T t (time of next arrival) If (n=1) generate Y and reset t D =t+y (system had been empty and so we need to generate the service time of the new customer) Collect output data A(N A )=t (customer N A arrived at time t) 18

If (t D <t A ) (Departure happens next) t = t D n = n-1 (one customer leaves) N D = N D +1 ( departure number increases 1) If (n=0) t D =1; (empty system, no next departure time) else, generate Y and t D =t+y (why?) Collect output D(N D )=t 19

Summary Analyzing physical system description Represent system states What events? Define variables, outputs Manage event list Deal with each top event one by one 20