Discrete-Event Simulation



Similar documents
1: B asic S imu lati on Modeling

Discrete-Event Simulation

Chapter 3 General Principles in Simulation

Copyright. Network and Protocol Simulation. What is simulation? What is simulation? What is simulation? What is simulation?

TEACHING SIMULATION WITH SPREADSHEETS

Network Design Performance Evaluation, and Simulation #6

2 Simulation Examples

White Paper Business Process Modeling and Simulation

Veri cation and Validation of Simulation Models

Modeling Stochastic Inventory Policy with Simulation

Malay A. Dalal Madhav Erraguntla Perakath Benjamin. Knowledge Based Systems, Inc. (KBSI) College Station, TX 77840, U.S.A.

LECTURE 16. Readings: Section 5.1. Lecture outline. Random processes Definition of the Bernoulli process Basic properties of the Bernoulli process

A SIMULATION STUDY FOR DYNAMIC FLEXIBLE JOB SHOP SCHEDULING WITH SEQUENCE-DEPENDENT SETUP TIMES

What is Modeling and Simulation and Software Engineering?

Mathematical Modeling of Inventory Control Systems with Lateral Transshipments

HSR HOCHSCHULE FÜR TECHNIK RA PPERSW I L

Chapter 2. Simulation Examples 2.1. Prof. Dr. Mesut Güneş Ch. 2 Simulation Examples

INTRUSION PREVENTION AND EXPERT SYSTEMS

12.5: CHI-SQUARE GOODNESS OF FIT TESTS

Queuing Theory. Long Term Averages. Assumptions. Interesting Values. Queuing Model

Optimal Hiring of Cloud Servers A. Stephen McGough, Isi Mitrani. EPEW 2014, Florence

SINGLE-STAGE MULTI-PRODUCT PRODUCTION AND INVENTORY SYSTEMS: AN ITERATIVE ALGORITHM BASED ON DYNAMIC SCHEDULING AND FIXED PITCH PRODUCTION

Analysis of a Production/Inventory System with Multiple Retailers

A SIMULATION MODEL FOR RESOURCE CONSTRAINED SCHEDULING OF MULTIPLE PROJECTS

High-Mix Low-Volume Flow Shop Manufacturing System Scheduling

INTRODUCTION TO MATHEMATICAL MODELLING

Introduction to Engineering System Dynamics

Cumulative Diagrams: An Example

Branch-and-Price Approach to the Vehicle Routing Problem with Time Windows

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

A Simple Inventory System

Simulation Software 1

Dimensioning an inbound call center using constraint programming

8. KNOWLEDGE BASED SYSTEMS IN MANUFACTURING SIMULATION

Process simulation. Enn Õunapuu

- 1 - intelligence. showing the layout, and products moving around on the screen during simulation

CHAPTER 3 CALL CENTER QUEUING MODEL WITH LOGNORMAL SERVICE TIME DISTRIBUTION

Scheduling Algorithms for Downlink Services in Wireless Networks: A Markov Decision Process Approach

Hydrodynamic Limits of Randomized Load Balancing Networks

Synchronization in. Distributed Systems. Cooperation and Coordination in. Distributed Systems. Kinds of Synchronization.

UNIT 2 QUEUING THEORY

TAYLOR II MANUFACTURING SIMULATION SOFTWARE

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r.

Analysis Of Shoe Manufacturing Factory By Simulation Of Production Processes

AS-D1 SIMULATION: A KEY TO CALL CENTER MANAGEMENT. Rupesh Chokshi Project Manager

PART III. OPS-based wide area networks

IST 301. Class Exercise: Simulating Business Processes

Waiting Times Chapter 7

Performance Analysis of a Telephone System with both Patient and Impatient Customers

Ready Time Observations

Structure Preserving Model Reduction for Logistic Networks

ISyE 2030 Test 2 Solutions

LECTURE 1 SERVICE INVENTORY MANAGEMENT

Performance Workload Design

Deployment of express checkout lines at supermarkets

Stochastic Models for Inventory Management at Service Facilities

The Master s Degree with Thesis Course Descriptions in Industrial Engineering

CHAPTER 2 Estimating Probabilities

In this presentation, you will be introduced to data mining and the relationship with meaningful use.

Algorithm and Flowchart Structured Programming 1

Available online at ScienceDirect. Procedia Computer Science 52 (2015 )

MCA 504 Modelling and Simulation

Steps for Implementation: Least-to-Most Prompts

Local Sidereal Time is the hour angle of the First Point of Aries, and is equal to the hour angle plus right ascension of any star.

Stochastic Processes and Queueing Theory used in Cloud Computer Performance Simulations

Arena 9.0 Basic Modules based on Arena Online Help

A Load Balancing Algorithm based on the Variation Trend of Entropy in Homogeneous Cluster

Simulation - A powerful technique to improve Quality and Productivity

CHAPTER 6: Continuous Uniform Distribution: 6.1. Definition: The density function of the continuous random variable X on the interval [A, B] is.

The problem with waiting time

Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

HEALTHCARE SIMULATION

Chapter 11 Monte Carlo Simulation

Real-Time Component Software. slide credits: H. Kopetz, P. Puschner

University of Paderborn Software Engineering Group II-25. Dr. Holger Giese. University of Paderborn Software Engineering Group. External facilities

SIMATIC HMI. WinCC flexible 2008 Getting Started - First-Time Users Getting Started. Printout of the Online Help 06/2008 A5E

SIMULATION-BASED ANALYSIS OF THE BULLWHIP EFFECT UNDER DIFFERENT INFORMATION SHARING STRATEGIES

Local Area Networks transmission system private speedy and secure kilometres shared transmission medium hardware & software

USING OPNET TO SIMULATE THE COMPUTER SYSTEM THAT GIVES SUPPORT TO AN ON-LINE UNIVERSITY INTRANET

Dr. Seuss Comes to Middle School Math Class by Carrie DeFrancisco From Online Newsletter Issue Number 1, Spring 2001

PROCESS FLOW IMPROVEMENT PROPOSAL OF A BATCH MANUFACTURING SYSTEM USING ARENA SIMULATION MODELING

Introduction to time series analysis

Simulation Model of an Ultra-Light Overhead Conveyor System; Analysis of the Process in the Warehouse

Introduction. Continue to Step 1: Creating a Process Simulator Model. Goal: 40 units/week of new component. Process Simulator Tutorial

Queuing Theory II 2006 Samuel L. Baker

Rx Medical. SMD Utility. Task Scheduler Configuration

Simulation in a Nutshell

Compliance and Requirement Traceability for SysML v.1.0a

Lean Six Sigma Analyze Phase Introduction. TECH QUALITY and PRODUCTIVITY in INDUSTRY and TECHNOLOGY

QNAT. A Graphical Queuing Network Analysis Tool for General Open and Closed Queuing Networks. Sanjay K. Bose

Homework 1 (Time, Synchronization and Global State) Points

Transcription:

Discrete-Event Simulation 14.11.2001 Introduction to Simulation WS01/02 - L 04 1/40 Graham Horton

Contents Models and some modelling terminology How a discrete-event simulation works The classic example - the queue in the bank Example for a discrete-event simulation Introduction to Simulation WS01/02 - L 04 2/40 Graham Horton

Simulation A definition of simulation: 1. Imitation of the operation of a real-world system 2. Generation of an artificial history of a system 3. Observation of the artificial history Simulation is performed using a model Introduction to Simulation WS01/02 - L 04 3/40 Graham Horton

Advantages of Simulation Simulation has many advantages: study new designs without interrupting real system study new designs without needing extra resources Improve understanding of system Manipulate time Less dangerous / expensive / intrusive Introduction to Simulation WS01/02 - L 04 4/40 Graham Horton

Model A model: is a set of assumptions about the operation of the system These assumptions can be: algorithmic (sequence of steps) mathematical (equations) logical (conditions) This model can be "run" in order to study the real system Introduction to Simulation WS01/02 - L 04 5/40 Graham Horton

Abstraction & Idealisation There are two main techniques for building models: -Abstraction - Idealisation Abstraction means leaving out unnecessary details - Represent only selected attributes of a customer Idealisation means replacing real things by concepts - Replace a set of measurements by a function Introduction to Simulation WS01/02 - L 04 6/40 Graham Horton

Systems System System environment A group of objects that interact System boundary Placing the system boundary is the first difficult task in modelling Introduction to Simulation WS01/02 - L 04 7/40 Graham Horton

Systems Example: Modelling a bank: System environment System Customers Cashiers System boundary Time of day Special events Introduction to Simulation WS01/02 - L 04 8/40 Graham Horton

Systems Example: Modelling the Earth's orbit: System environment Earth System Sun Pluto? System Moon boundary Asteroids? Introduction to Simulation WS01/02 - L 04 9/40 Graham Horton

Entities, Attributes & Activities An entity is an object of interest in the system customer manager cashier An attribute is a (relevant) property of an entity account balance gender skills Attributes are state variables Introduction to Simulation WS01/02 - L 04 10/40 Graham Horton

Activities & Delays An activity...... is a duration of known length check balance drink coffee serve customer Activities form part of the model specification A delay...... is a duration of unknown length Waiting time in queue Delays form part of the simulation result Introduction to Simulation WS01/02 - L 04 11/40 Graham Horton

State, State Variables The (system) state...... is a description which is - complete and - minimal at any point in time A state variable... length of queue (0, 1, 2,...)... is a variable needed to describe the state current activity of manager (sleeping, drinking coffee,... Introduction to Simulation WS01/02 - L 04 12/40 Graham Horton

Events An event...... is an occurrence which is instantaneous may change the state of the system Customer arrives from outside Manager wakes up Service is completed Introduction to Simulation WS01/02 - L 04 13/40 Graham Horton

Steps in a Simulation Study Problem formulation Set objectives and plan Conceptual model Collect data Validation Documentation & report Production runs & analysis Experimental design Create simulation model Verification Introduction to Simulation WS01/02 - L 04 14/40 Graham Horton

Validation & Verification Validation...... means creating a correct model ("building the right model") Conceptual model Validation Collect data Verification...... means writing a correct program ("building the model right") Create simulation model Verification Introduction to Simulation WS01/02 - L 04 15/40 Graham Horton

Input-Output Transformation View the (real or simulated) system as a "black box" Input variables System Output variables Black box transforms input variables into output variables Input variables are obtained by observing the real system Output variables are obtained by observing the real system and from the simulation experiment Introduction to Simulation WS01/02 - L 04 16/40 Graham Horton

Model Specification Discrete-event modelling raises the following questions: How does each event affect the system state and attributes? How are activities defined? What events mark the beginning and the end? What conditions (if any) must hold? How are delays defined? How must the simulation be initialised? Introduction to Simulation WS01/02 - L 04 17/40 Graham Horton

A Simulation Classic The single-server queue: Bank Service Queue Introduction to Simulation WS01/02 - L 04 18/40 Graham Horton

A Simulation Classic One possible problem formulation: "Customers have to wait too long in my bank" A typical objective: Determine the effect of an additional cashier on the mean queue length Data needed: Inter-arrival times of customers Service times Introduction to Simulation WS01/02 - L 04 19/40 Graham Horton

A Simulation Classic A typical simulation result: N Q 6 5 4 3 2 1 0 T Introduction to Simulation WS01/02 - L 04 20/40 Graham Horton

Event Notice, Event List Event notice...... A data record specifying an event The event notice must contain all the information necessary to execute the event (in particular the time it is scheduled to occur) (Future) event list... A list of event notices for future events The event list is the main data structure in a discrete-event simulator Introduction to Simulation WS01/02 - L 04 21/40 Graham Horton

The Event List The (future) event list (FEL) controls the simulation The FEL contains all future events that are scheduled The FEL is ordered by increasing time of event notice Example FEL (at some simulation time t 1 ): (t 1, Event 1 ) (t 2, Event 2 ) (t 3, Event 3 ) (t 4, Event 4 ) t 1 t 2 t 3 t 4 Introduction to Simulation WS01/02 - L 04 22/40 Graham Horton

Conditional and Primary Events A primary event...... An event whose occurrence is scheduled at a certain time Arrivals of customers A conditional event...... An event which is triggered by a certain condition becoming true Customer moving from queue to service Introduction to Simulation WS01/02 - L 04 23/40 Graham Horton

Conditional and Primary Events Primary event: WHENEVER T >= TArrive DO NQueue^ := NQueue + 1; TArrive^ := T + IArrive; END Conditional event: WHENEVER (NServer = 0) AND (NQueue > 0) DO NQueue^ := NQueue - 1; NServer^ := NServer + 1; TService^ := T + IService; END Introduction to Simulation WS01/02 - L 04 24/40 Graham Horton

The Event List Example: Simulation of the Mensa: Some state variables: # people in line 1 # people at meal line 1 & 2 # people at cashier 1 & 2 # people eating at tables (t 1, Arrival) (t 2, Service completion at cashier 2) (t 3, Service completion at meal 1) (t 4, Finish eating) (t 5, Finish eating) Introduction to Simulation WS01/02 - L 04 25/40 Graham Horton

The Event List Operations on the FEL: Insert an event into FEL (at appropriate position!) Remove first event from FEL for processing Delete an event from the FEL The FEL is thus usually stored as a linked list Introduction to Simulation WS01/02 - L 04 26/40 Graham Horton

The Event List The simulator spends a lot of time processing the FEL In some cases, up to 40% of overall simulation time! Efficiency is thus very important Sequential search when inserting must be avoided: O(n) Solution: more advanced data structures (trees): O(log n) Introduction to Simulation WS01/02 - L 04 27/40 Graham Horton

The Event List Example: Event "Customer arrives" in the bank model: # Customer arrives WHENEVER T >= TArrive DO NQueue^ := NQueue + 1; TArrive^ := T + IArrive; DISPLAY ("T= %f Customer arrives\n",t); END Executing this event at time T causes the event (T + IArrive, Customer arrives) to be inserted into the FEL Introduction to Simulation WS01/02 - L 04 28/40 Graham Horton

The Simulation Algorithm yes FEL empty? no Remove and process 1st primary event Remove and process conditional event yes Conditional event enabled? no Introduction to Simulation WS01/02 - L 04 29/40 Graham Horton

The Simulation Algorithm Remove and process 1st primary event: Remove 1st primary event from FEL Advance simulation time Update state variables Enter new future events into FEL Compute statistics Every discrete-event simulator works like this (even if the programming model looks different!) Introduction to Simulation WS01/02 - L 04 30/40 Graham Horton

The Simulation Algorithm (t 1, Arrival) (t 1, Move up) (t 2, Arrival) (t 2, Arrival) (t 4, Arrival) (t 3, Service complete) (t 3, Service complete) Introduction to Simulation WS01/02 - L 04 31/40 Graham Horton

Timing Sometimes, activities last for an exact amount of time: The clock cycle in a computer Each phase of a traffic light A certain operation in a manufacturing line Such exact times are deterministic Introduction to Simulation WS01/02 - L 04 32/40 Graham Horton

Timing Usually, activities last for varying amounts of time: Inter-arrival times at bank Service times at bank Time to failure for a machine Time that a user program runs Such times are random or stochastic Introduction to Simulation WS01/02 - L 04 33/40 Graham Horton

Random Variables If any quantity in a simulation is random, then...... the simulation result must also be random This can make things complicated: - The simulator will need to use random variables - We will need to do some statistics Introduction to Simulation WS01/02 - L 04 34/40 Graham Horton

Random Variables The best-known random variable: Discrete and uniformly distributed on [1,6] Discrete and uniformly distributed on [1,4] Introduction to Simulation WS01/02 - L 04 35/40 Graham Horton

Simulating the Bank by Hand Simulation clock: 11 12 14 15 0567 9 Arrival interval Customer arrives Begin service Service duration Service complete 5 5 5 2 7 1 6 7 4 11 3 9 11 3 14 3 12 14 1 15 Introduction to Simulation WS01/02 - L 04 36/40 Graham Horton

Computing Statistics Average waiting time for a customer: 1.25 Arrival interval Customer arrives Begin service Service duration Service complete 5 5 5 2 7 1 6 7 4 11 3 9 11 3 14 3 12 14 1 15 Introduction to Simulation WS01/02 - L 04 37/40 Graham Horton

Computing Statistics P(customer has to wait): 0.75 Arrival interval Customer arrives Begin service Service duration Service complete 5 5 5 2 7 1 6 7 4 11 3 9 11 3 14 3 12 14 1 15 Introduction to Simulation WS01/02 - L 04 38/40 Graham Horton

Computing Statistics P(Server busy): 0.66 Arrival interval Customer arrives Begin service Service duration Service complete 5 5 5 2 7 1 6 7 4 11 3 9 11 3 14 3 12 14 1 15 Introduction to Simulation WS01/02 - L 04 39/40 Graham Horton

Computing Statistics Average queue length: 0.33 Arrival interval Customer arrives Begin service Service duration Service complete 5 5 5 2 7 1 6 7 4 11 3 9 11 3 14 3 12 14 1 15 Introduction to Simulation WS01/02 - L 04 40/40 Graham Horton