Discrete Event (time) Simulation. What is a simulation? “Simulation is the process of designing a model of a real system and conducting experiments with.

Slides:



Advertisements
Similar presentations
McGraw-Hill/Irwin Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. A PowerPoint Presentation Package to Accompany Applied Statistics.
Advertisements

Discrete Event (time) Simulation Kenneth.
Introduction into Simulation Basic Simulation Modeling.
Modeling & Simulation. System Models and Simulation Framework for Modeling and Simulation The framework defines the entities and their Relationships that.
Queueing Models and Ergodicity. 2 Purpose Simulation is often used in the analysis of queueing models. A simple but typical queueing model: Queueing models.
Modeling and simulation of systems Slovak University of Technology Faculty of Material Science and Technology in Trnava.
Lecture 3 Concepts of Discrete-Event Simulation. 2 Discrete Event Model  In the discrete approach to system simulation, state changes in the physical.
Classification of Simulation Models
#11 QUEUEING THEORY Systems Fall 2000 Instructor: Peter M. Hahn
Discrete Event Simulation How to generate RV according to a specified distribution? geometric Poisson etc. Example of a DEVS: repair problem.
Simulation with ArenaChapter 2 – Fundamental Simulation Concepts Discrete Event “Hand” Simulation of a GI/GI/1 Queue.
Lecture 11 Queueing Models. 2 Queueing System  Queueing System:  A system in which items (or customers) arrive at a station, wait in a line (or queue),
Data Communication and Networks Lecture 13 Performance December 9, 2004 Joseph Conron Computer Science Department New York University
Simulation Waiting Line. 2 Introduction Definition (informal) A model is a simplified description of an entity (an object, a system of objects) such that.
Introduction to Queuing Theory. 2 Queuing theory definitions  (Kleinrock) “We study the phenomena of standing, waiting, and serving, and we call this.
Lecture 4 Mathematical and Statistical Models in Simulation.
Lab 01 Fundamentals SE 405 Discrete Event Simulation

Graduate Program in Engineering and Technology Management
Computer Simulation A Laboratory to Evaluate “What-if” Questions.
Introduction to Discrete Event Simulation Customer population Service system Served customers Waiting line Priority rule Service facilities Figure C.1.
(C) 2009 J. M. Garrido1 Object Oriented Simulation with Java.
Chapter 1 Introduction to Simulation
Simulation Examples ~ By Hand ~ Using Excel
1 Performance Evaluation of Computer Networks: Part II Objectives r Simulation Modeling r Classification of Simulation Modeling r Discrete-Event Simulation.
General Simulation Principles
Modeling & Simulation: An Introduction Some slides in this presentation have been copyrighted to Dr. Amr Elmougy.
Chapter 10. Simulation An Integrated Approach to Improving Quality and Efficiency Daniel B. McLaughlin Julie M. Hays Healthcare Operations Management.
Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able.
Structure of a Waiting Line System Queuing theory is the study of waiting lines Four characteristics of a queuing system: –The manner in which customers.
Entities and Objects The major components in a model are entities, entity types are implemented as Java classes The active entities have a life of their.
1 Part 2 & 3 Performance evaluation. 2 Goals Understand the complex behavior of systems subject to "random phenomena" Develop intuitive understanding.
Simulation Examples and General Principles
Chapter 10 Verification and Validation of Simulation Models
ECE 466/658: Performance Evaluation and Simulation Introduction Instructor: Christos Panayiotou.
WOOD 492 MODELLING FOR DECISION SUPPORT Lecture 25 Simulation.
Chapter 2 Fundamental Simulation Concepts
CSCI1600: Embedded and Real Time Software Lecture 19: Queuing Theory Steven Reiss, Fall 2015.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
Structure of a Waiting Line System Queuing theory is the study of waiting lines Four characteristics of a queuing system: –The manner in which customers.
Discrete Event Simulation
Dr. Anis Koubâa CS433 Modeling and Simulation
Modeling and Simulation Dr. X. Topics What is Continuous Simulation Why is it useful? Continuous simulation design.
(C) J. M. Garrido1 Objects in a Simulation Model There are several objects in a simulation model The activate objects are instances of the classes that.
1 1 Slide Chapter 12 Waiting Line Models n The Structure of a Waiting Line System n Queuing Systems n Queuing System Input Characteristics n Queuing System.
Queuing Theory.  Queuing Theory deals with systems of the following type:  Typically we are interested in how much queuing occurs or in the delays at.
SIMULATION EXAMPLES. Monte-Carlo (Static) Simulation Estimating profit on a sale promotion Estimating profit on a sale promotion Estimating profit on.
CS433 Modeling and Simulation Lecture 09 – Part 02 Discrete Events Simulation Dr. Anis Koubâa 27 Dec 2008 Al-Imam.
Csci 418/618 Simulation Models Dr. Ken Nygard, IACC 262B
 Simulation enables the study of complex system.  Simulation is a good approach when analytic study of a system is not possible or very complex.  Informational,
1 CS 214 Modeling and Simulation Modeling. TERMINOLOGY lSystem –A group of objects that are joined together in some regular interaction or interdependence.
Introduction The objective of simulation – Analysis the system (Model) Analytically the model – a description of some system intended to predict the behavior.
Simulation Examples And General Principles Part 2
Simple Queueing Theory: Page 5.1 CPE Systems Modelling & Simulation Techniques Topic 5: Simple Queueing Theory  Queueing Models  Kendall notation.
NETW 707: Modeling & Simulation Course Instructor: Tallal Elshabrawy Instructor Office: C3.321 Instructor Teaching.
Modeling and Simulation
Chapter 1 What is Simulation?. Fall 2001 IMSE643 Industrial Simulation What’s Simulation? Simulation – A broad collection of methods and applications.
Introduction To Modeling and Simulation 1. A simulation: A simulation is the imitation of the operation of real-world process or system over time. A Representation.
Monte Carlo Simulation Random Number Generation
OPERATING SYSTEMS CS 3502 Fall 2017
Prepared by Lloyd R. Jaisingh
Modeling and Simulation (An Introduction)
Simulation Statistics
ETM 607 – Spreadsheet Simulations
ADVANTAGES OF SIMULATION
Chapter 10 Verification and Validation of Simulation Models
Lecture 2 Part 3 CPU Scheduling
Discrete Event “Hand” Simulation of a GI/GI/1 Queue
Performance evaluation
MECH 3550 : Simulation & Visualization
Presentation transcript:

Discrete Event (time) Simulation

What is a simulation? “Simulation is the process of designing a model of a real system and conducting experiments with this model for the purpose either of understanding the behavior of the system or of evaluating various strategies (within the limits imposed by a criterion or set of criteria) for the operation of a system.” -Robert E Shannon 1975 “Simulation is the process of designing a dynamic model of an actual dynamic system for the purpose either of understanding the behavior of the system or of evaluating various strategies (within the limits imposed by a criterion or set of criteria) for the operation of a system.” -Ricki G Ingalls

Why? Analysis tool for predicating the effect of changes -Potential changes to the system can be simulated and predicate their im pact on the system. Design tool to predicate the performance of new system -Find adequate parameters before implementation. 3

Why Not? When the problem can be solved by common sense. When the problem can be solved analytically. If it is easier to perform direct experiments. If cost exceed savings. If resource or time are not available. If system behavior is too complex., etc. 4

What types of simulation are there? 5

Simulation Types 1. Static or dynamic models 2. Stochastic or deterministic models 3. Discrete or continuous models 6

Static vs. Dynamic Dynamic State variables change over time (System Dynamics, Discrete Event) Static Snapshot at a single point in time (optimization models, etc.) 7

Deterministic vs. Stochastic Deterministic model The behavior is entire predictable. The system is perfectly understood, then it is possible to predict precisely what will happen. Stochastic model The behavior cannot be entirely predicted. 8

Discrete vs. Continuous Discrete model The state variables change only at a countable number of points in time. These points in time are the ones at which the event occurs/change in state. Continuous The state variables change in a continuous way, and not abruptly from one state to another (infinite number of states). 9

Discrete Event Simulation Dynamic Stochastic Discrete 10

How to Implement a Discrete Event Simulation? Consider an example: Airport System A certain airport contains a single runway on which arriving aircrafts must land. Once an aircraft is cleared to land, it will use the runway, during which time no other aircraft can be cleared to land. Once the aircraft has landed, the runway is available for use by other aircraft. The landed aircraft remains on the ground for a certain period of time before departing. 11

An Example: Airport System Single Server Queue  Customer (aircraft)  Entities utilizing the system/resources  Server (runway)  Resource that is serially reused; serves one customer at a time  Queue  Buffer holding aircraft waiting to land CustomersQueueServer Ground 12

An Example: Airport System Single Server Queue  Performance metrics Average waiting time: average time that an aircraft must wait when arriving at an airport before they are allowed to land. Maximum number of aircraft on the ground: helps to determine the required space of the parking area. CustomersQueueServer Ground 13

Simulation Development Events Stochastic model and system attributes System States Relationship among events Time handling Output statistics 14

An Example: Airport System Single Server Queue  Events: an instantaneous occurrence that changes the state of a system CustomersQueueServer Ground  Departure ( D ) ASsSs SfSf D  Arrival ( A )  Start Service ( S s )  Finish Service ( S f ) 15

Stochastic Model and System Attributes Customers Arrival process: schedule of aircraft arrivals Real trace Probability model: distribution of inter-arrival time i.i.d. Uniform, normal, exponential … Servers How much service time is needed for each customer? Probability model: i.i.d. and exponential distribution How many servers? Single 16

Stochastic Model and System Attributes Queue Service discipline - who gets service next? First-in-first-out (FIFO), Last-in-first-out (LIFO), Priority, Weighted-fairness (WFQ), random … Preemption? Queue capacity? k or infinite Ground Park time Probability model: i.i.d. and exponential distribution 17

Stochastic Model and System Attributes Uniform Given max and min 0 ≦ random() < 1 = min + random() × (max - min) Exponential Given rate of lec1.ppt Normal Google is your friend! 18

How to verify the correctness of distribution generator? ANS: you can verity it by using a program, Excel, Matlab, … 19

How to verify the correctness of distribution generator via Excel? Inputting or generating sample data Generating pdf Applying “Histogram” of “Data Analysis” “Data Analysis” is in “Analysis Toolpack” ( 分析工具箱 ) 20

How to verify the correctness of distribution generator via Excel? Generating Broken-line graph for cdf of x i Generating ground truth of cdf 21

Simulation Development Events Stochastic model and system attributes System States Relationship among events Time handling Output statistics 22

System States State 1 State 2 State 3 Event X Event Y Event X Event Y System state A collection of variables in any time that describe the system Event An instantaneous occurrence that changes the state of a system 23

An Example: Airport System Single Server Queue  System States (Q:3 G:2 B:y)  Q: # of aircrafts waiting for landing  G: # of aircrafts on the ground  B: y/n; y if the runway is busy CustomersQueueServer Ground ASsSs SfSf D 24

SsSs SfSf D An Example: Airport System Single Server Queue CustomersQueueServer Ground A Q:3 G:2 B:y Q:4 G:2 B:y Q:3 G:3 B:n Q:3 G:1 B:y A SfSf D Q:2 G:3 B:y IF Q>0 SsSs 25

Simulation Development Events Stochastic model and system attributes System States Relationship among events Time handling Output statistics 26

Relationships among Events Each Event has a timestamp indicating when it occurs Arrival Event t B? N Start Service Event S t B=YB=Y Finish Service Event S t+ServiceTime() Arrival Event t+ArrivalTime() Y Q+ +  System States  Q: # of aircrafts waiting for landing  G: # of aircrafts on the ground  B: y/n, y if the runway is busy 27

Relationships among Events Departure Event t+ParkTime() Q > 0? Y Start Service Event S t Finish Service Event S t B=NB=N N Q -- Finish Service Event S t+ServiceTime() G+ +  System States  Q: # of aircrafts waiting for landing  G: # of aircrafts on the ground  B: y/n, y if the runway is busy 28

Relationships among Events Departure Event t G --  System States  Q: # of aircrafts waiting for landing  G: # of aircrafts on the ground  B: y/n, y if the runway is busy 29

Simulation Development Events Stochastic model and system attributes System States Relationship among events Time handling Output statistics 30

t = 00:00 Time Handling How to progress Simulation time? Time-slices Approach Simulation time Arrival Event 00:02:19 A time-slice = 5 min Finish Service Event S 00:17:49 Finish Service Event S 01:22:11 Arrival Event 00:48:37 Departure Event 00:59:06 Do Nothing DoDoDo t = 00:05t = 00:10t = 00:15t = 00:20t = 00:25t = 00:30t = 00:35t = 00:40 t = 00:45 t = 00:50 Do Nothing Do  Inefficient  Inaccurate 31

For This Homework DO NOT DO SOMETHING ADOVE!!! 32

For This Homework DO NOT DO SOMETHING ADOVE!!! 33

Time Handling How to progress Simulation time? Event-driven Approach Simulation time Arrival Event 00:02:19 Finish Service Event S 00:17:49 Finish Service Event S 01:22:11 Arrival Event 00:48:37 Departure Event 00:59:06 t = 00:02:19t = 00:17:49 t = 00:48:37 34

Simulation Development Events Stochastic model and system attributes System States Relationship among events Time handling Output statistics 35

Output statistics Simulation time Arrival Event 00:02:19 Finish Service Event S 00:17:49 Finish Service Event S 01:22:11 Arrival Event 00:48:37 Q G B 0 0 NY 00:02:1900:17:49 N 1 00:48:37 Y 00:59:06 0 Departure Event 00:59:06 01:22:11 1 Arrival Event 01:12:28 00:48:

Simulation Flow Chart 37