Section 5.2: Next Event Simulation Examples

Similar documents
Next-Event Simulation

CHAPTER 5 NEXT-EVENT SIMULATION

Discrete-Event Simulation:

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

OPERATING SYSTEMS. Systems with Multi-programming. CS 3502 Spring Chapter 4

Module 7:Application of stochastic processes in queueing theory Lecture 29:Application of stochastic processes in Queueing Theory

Chapters 1, 2 & 3: A Brief Introduction. Barry L. Nelson Northwestern University July 2017

SIMULATION OF A SINGLE-SERVER QUEUEING SYSTEM

Queuing Systems. 1 Lecturer: Hawraa Sh. Modeling & Simulation- Lecture -4-21/10/2012

Precedence Graphs Revisited (Again)

13 Sensor networks Gathering in an adversarial environment

Performance Evaluation

Discrete-event simulation

Implementing Scheduling Algorithms. Real-Time and Embedded Systems (M) Lecture 9

Role of OS in virtual memory management

Section 4.2: Discrete Data Histograms

Source EE 4770 Lecture Transparency. Formatted 16:43, 30 April 1998 from lsli

Page Replacement Algorithms

Memory management, part 2: outline. Operating Systems, 2017, Danny Hendler and Amnon Meisels

Worst-case Ethernet Network Latency for Shaped Sources

Resource Allocation Strategies for Multiple Job Classes

Real-time operating systems and scheduling

Memory management, part 2: outline

Modeling and Performance Analysis with Discrete-Event Simulation

Connection-Level Scheduling in Wireless Networks Using Only MAC-Layer Information

Topic 4a Router Operation and Scheduling. Ch4: Network Layer: The Data Plane. Computer Networking: A Top Down Approach

Simulation Models for Manufacturing Systems

Section 5.3: Event List Management

Start of Lecture: February 10, Chapter 6: Scheduling

High level scheduling: Medium level scheduling: Low level scheduling. Scheduling 0 : Levels

Distributed Floor Control Protocols for Computer Collaborative Applications on Overlay Networks

UNIT 4: QUEUEING MODELS

nalysis, Control, and Design of Stochastic Flow Systems Limited Storage

Performance Analysis of WLANs Under Sporadic Traffic

Subject Name: System Modeling & Simulation. Prepared By : Ms. Pramela Devi( ASCP) Department : Computer Science & Engineering

SIGMA Tutorial. March, 2013 VMS Technology, Inc.

SET DEFINITION 1 elements members

Message-Efficient Uniform Timed Reliable Broadcast Yu Ma and Scott D. Stoller 21 September Introduction In distributed database systems,

Simulation Studies of the Basic Packet Routing Problem

Page Replacement. 3/9/07 CSE 30341: Operating Systems Principles

ECE SPRING NOTE; This project has two parts which have different due dates.

CS370 Operating Systems

Subject : Computer Science. Paper: Data Structures. Module: Priority Queue and Applications. Module No: CS/DS/14

1. Background. 2. Demand Paging

Slides 11: Verification and Validation Models

III Data Structures. Dynamic sets

Overview of the Simulation Process. CS1538: Introduction to Simulations

Wireless Networks (CSC-7602) Lecture 8 (15 Oct. 2007)

Episode 5. Scheduling and Traffic Management

Chair for Network Architectures and Services Prof. Carle Department of Computer Science TU München. Übungsblatt 2

Virtual Memory Outline

Chapter 11. I/O Management and Disk Scheduling

iscrete-event System Simulation of Queues with Spreadsheets Combined with Simple VBA Code: A Teaching Case

CPU Scheduling. Daniel Mosse. (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013)

Quality of Service (QoS)

Lecture 14: M/G/1 Queueing System with Priority

Chapter 3 General Principles. Banks, Carson, Nelson & Nicol Discrete-Event System Simulation

Episode 5. Scheduling and Traffic Management

Queues. Lesson 4. CS 32: Data Structures Dept. of Computer Science

6.1 Motivation. Fixed Priorities. 6.2 Context Switch. Real-time is about predictability, i.e. guarantees. Real-Time Systems

CS370 Operating Systems

Temporally Adaptive A* Algorithm on Time Dependent Transportation Network

Lecture 1. 1 Notation

Deterministic Variable Demand Inventory. Chen Zhou Assoc. Prof For Prof. Reveliotis Sept 11, 2008

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

Optimal Resource Allocation for Pervasive Health Monitoring Systems with Body Sensor Network

Performance Analysis of Storage-Based Routing for Circuit-Switched Networks [1]

Processes and Threads

Global Scheduling in Multiprocessor Real-Time Systems

NEW STABILITY RESULTS FOR ADVERSARIAL QUEUING

The Typed λ Calculus and Type Inferencing in ML

Markov Chains and Multiaccess Protocols: An. Introduction

Modeling and Simulation (An Introduction)

An Approach to Task Attribute Assignment for Uniprocessor Systems

Stretch-Optimal Scheduling for On-Demand Data Broadcasts

Module 9: Virtual Memory

Introduction to Queueing Theory for Computer Scientists

Operating System Concepts

DDSS: Dynamic Dedicated Servers Scheduling for Multi Priority Level Classes in Cloud Computing

ACE Tutorial. October, 2013 Byoung K. Choi and Donghun Kang

Dynamic traffic models

ASAND: Asynchronous Slot Assignment and Neighbor Discovery Protocol for Wireless Networks

Chapter 9. Uniprocessor Scheduling

Topology I Test 1 Solutions October 13, 2008

B-Trees and External Memory

2. The shared resource(s) in the dining philosophers problem is(are) a. forks. b. food. c. seats at a circular table.

Mechanical Engineering 101

Mechanical Engineering 101

B-Trees and External Memory

Topology notes. Basic Definitions and Properties.

RESOURCE GRAPHS FOR MODELING LARGE-SCALE, HIGHLY CONGESTED SYSTEMS

Clock Synchronization. Synchronization. Clock Synchronization Algorithms. Physical Clock Synchronization. Tanenbaum Chapter 6 plus additional papers

Congestion Avoidance

Topic 1 Uninformed Search

Chapter 4 Network Layer: The Data Plane

Scheduling Algorithms to Minimize Session Delays

Section 2.3: Monte Carlo Simulation

Numerical approach estimate

Hardware-Software Codesign. 6. System Simulation

Discrete-Event Simulation:

Transcription:

Section 52: Next Event Simulation Examples Discrete-Event Simulation: A First Course c 2006 Pearson Ed, Inc 0-13-142917-5 Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 1/ 18

Outline Two next-event simulation models will be developed Simple inventory system with delivery lag Multi-server service node Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 2/ 18

A Simple Inventory System with Delivery Lag Two changes relative to sis2 Uniform(0,1) lag between inventory review and order delivery More realistic demand model S Demand instances for a single item occur at random Average rate is λ demand instances per time interval Time between demand instances is Exponential(1/λ) l(t) s 0 o 2 o 5 δ 3 δ 6 0 1 2 3 4 5 6 t Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 3/ 18

Comparison of Demand Models sis2 used an aggregate demand for each time interval, generated as an Equilikely(10,50) random variate Aggregate demand per time interval is random Within an interval, time between demand instances is constant Example: if aggregate demand is 25, inter-demand time is 004 Now using Exponential(1/λ) inter-demand times Demand is modeled as an arrival process Average demand per time interval is λ Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 4/ 18

Specification Level: States and Notation The simulation clock is t (real-valued) The terminal time is τ (integer-valued) Current inventory level is l(t) (integer-valued) Amount of inventory on order, if any, is o(t) (integer-valued) Necessary due to delivery lag l(t) and o(t) provide complete state description Initial state is assumed to be l(0) = S and o(0) = 0 Terminal state is assumed to be l(τ) = S and o(τ) = 0 Cost to bring l(t) to S at simulation end (with no lag) must be included in accumulated statistics Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 5/ 18

Specification Level: Events Three types of events can change the system state A demand for an item at time t l(t) decreases by 1 An inventory review at integer-valued time t If l(t) s, then o(t) becomes 0 If l(t) < s, then o(t) becomes S l(t) An arrival of an inventory replenishment order at time t l(t) increases by o(t) o(t) becomes 0 Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 6/ 18

Algorithm 521, initialization Time variables used for event list: t d : next scheduled inventory demand t r : next scheduled inventory review t a : next scheduled inventory arrival denotes impossible events Initialization Step of Algorithm 521 l = S; /* initialize inventory level */ o = 0; /* initialize amount on order */ t = 00; /* initialize simulation clock */ t d = GetDemand(); /* initialize event list */ t r = t + 10; /* initialize event list */ t a = ; /* initialize event list */ Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 7/ 18

Main Loop of Algorithm 521 while (t < τ) { t = min(t d, t r, t a); /* scan the event list */ if (t == t d ) { /* process an inventory demand */ l--; t d = GetDemand(); } else if (t == t r) { /* process an inventory review */ if (l < s) { o = S - l; δ = GetLag(); t a = t + δ; } t r += 10; } else { /* process an inventory arrival */ l += o; o = 0; t a = ; } } Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 8/ 18

Program sis3 Implements Algorithm 521 tdemand, treview and tarrive correspond to t d, t r, t a State variables inventory and order correspond to l(t) and o(t) sumhold and sumshort accumulate the time-integrated holding and shortage integrals Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 9/ 18

The single-server service node is extended to support multiple servers This is a natural generalization Multi-server service nodes have both practical and theoretical importance The event list size depends on the number of servers For large numbers of servers, the event list data structure becomes important Extensions of the multi-server node (immediate feedback, finite capacity, non-fifo) are left as exercises Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 10/ 18

Conceptual Level Definition 521: A multi-server service node consists of A single queue (if any) Two or more servers operating in parallel At any instant in time, Each server is either busy or idle The queue is either empty or not empty If one or more servers is idle, the queue must be empty If the queue is not empty, all servers must be busy Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 11/ 18

Conceptual Level 1 2 arrivals queue departures c servers When a job arrives If all servers are busy, the job enters the queue Else an idle server is selected and the job enters service When a job departs a server If the queue is empty, the server becomes idle Else a job is removed from the queue, served by server Servers process jobs independently Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 12/ 18

Server Selection Rule Definition 522: The algorithm used to select an idle server is called the server selection rule Common selection rules Random selection: at random from the idle servers Selection in order: lowest-numbered idle server Cyclic selection: first available, starting after last selected (circular search may be required) Equity selection: use longest-idle or lowest-utilized Priority selection: choose the best idle server (modeler specifies how to dermine best ) Random, cyclic, equity: designed to achieve equal utilizations If servers are statistically identical and independent, the selection rule has no effect on average performance of the service node The statistically identical assumption is useful for mathematicians; unnecessary for discrete-event simulation Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 13/ 18

Specification Level: States and Notation Servers in a multi-server service node are called service channels c is the number of servers (channels) The server index is s = 1, 2,, c l(t) denotes the number of jobs in the service node at time t If l(t) c, all servers are busy and q(t) = l(t) c If l(t) < c, some servers are idle If servers are distinct, need to know which servers are idle For s = 1,2,,c define x s (t) : the number of jobs in service (0 or 1) at server s at time t The complete state description is l(t), x 1 (t), x 2 (t),, x c (t) q(t) = l(t) c x s (t) s=1 Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 14/ 18

Specification Level: Events What types of events can change state variables l(t),x 1 (t),x 2 (t),,x c (t)? An arrival at time t l(t) increases by 1 If l(t) c, an idle server s is selected, and x s (t) becomes 1 Else all servers are busy A completion of service by server s at time t l(t) decreases by 1 If l(t) c, a job is selected from the queue to enter service Else x s (t) becomes 0 There are c + 1 event types Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 15/ 18

Specification Level: Additional Assumptions The initial state is an empty node l(0) = 0 x 1 (0) = x 2 (0) = = x c (0) = 0 The first event must be an arrival The arrival process is turned off at time τ The node continues operation after time τ until empty The terminal state is an empty node The last event is a completion of service For simplicity, all servers are independent and statistically identical Equity selection is the server selection rule All of these assumptions can be relaxed Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 16/ 18

Event List 0 t x arrival 1 t x completion of service by server 1 2 t x completion of service by server 2 3 t x completion of service by server 3 4 t x completion of service by server 4 Can be organized as an array of c + 1 event types Field t: scheduled time of next occurrence for the event Field x: current activity status of the event Superior alternative to using to denote impossible events For 0 th event type, x denotes if arrival process is on or off For other event types, x denotes if server is busy or idle For large c, consider alternate event-list structures (see section 53) Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 17/ 18

Program msq Implements this next-event multi-server service node simulation model State variable l(t) is number State variables x 1 (t),x 2 (t),,x c (t) are part of the event list Time-integrated statistic t 0 l(θ)dθ is area Array sum records for each server the sum of service times the number served Function NextEvent searches the event list to find the next event Function FindOne searches the event list to find the longest-idle server (because equity selection is used) Discrete-Event Simulation: A First Course Section 52: Next Event Simulation Examples 18/ 18