NETW 707 Modeling and Simulation Amr El Mougy Maggie Mashaly.

Slides:



Advertisements
Similar presentations
Chapter 3 General Principles
Advertisements

Modeling & Simulation. System Models and Simulation Framework for Modeling and Simulation The framework defines the entities and their Relationships that.
Lab Assignment 1 COP 4600: Operating Systems Principles Dr. Sumi Helal Professor Computer & Information Science & Engineering Department University of.
 1  Outline  performance measures for a single-server station  discrete-event simulation  hand simulation  process-oriented simulation approach.
Agenda Main concepts in discrete-event simulation
Lecture 3 Concepts of Discrete-Event Simulation. 2 Discrete Event Model  In the discrete approach to system simulation, state changes in the physical.
Simulation. Example: A Bank Simulator We are given: –The number of tellers –The arrival time of each customer –The amount of time each customer requires.
1 6.3 Binary Heap - Other Heap Operations There is no way to find any particular key without a linear scan through the entire heap. However, if we know.
Simulation of multiple server queuing systems
Classification of Simulation Models
DISCRETE-EVENT SIMULATION CONCEPTS and EVENT SCHEDULING ALGORITHM
Components and Organization of Discrete-event Simulation Model
Simscript II.5 Building simulation model with SIMSCRIPT II.5.
Simulation with ArenaChapter 2 – Fundamental Simulation Concepts Discrete Event “Hand” Simulation of a GI/GI/1 Queue.
Simulating Single server queuing models. Consider the following sequence of activities that each customer undergoes: 1.Customer arrives 2.Customer waits.
Queueing and Hand Simulation (Project 03). Queueing Models Probabilistic and stochastic models Important aspects: –Interarrival time –Service time –Waiting.
Simulation Waiting Line. 2 Introduction Definition (informal) A model is a simplified description of an entity (an object, a system of objects) such that.
Queueing Models: Data Collection and Hand Simulation from Prof. Goldsman’s lecture notes.
CPSC 531: DES Overview1 CPSC 531:Discrete-Event Simulation Instructor: Anirban Mahanti Office: ICT Class Location:
Lecture 4 Mathematical and Statistical Models in Simulation.
Lab 01 Fundamentals SE 405 Discrete Event Simulation
 1  Outline  simulating GI/G/1 queues  M/M/1 queues  theoretical results of queueing systems  an inventory system  simulation program with an event.
Slide - 1 Dr Terry Hinton 6/9/05UniS - Based on Slides by Micro Analysis & Design An example of a Simulation Simulation of a bank: Three tasks or processes:
Simulation II IE 2030 Lecture 18. Outline: Simulation II Advanced simulation demo Review of concepts from Simulation I How to perform a simulation –concepts:
Simulation Examples ~ By Hand ~ Using Excel
TK1924 Program Design & Problem Solving Session 2011/2012 L6: Queues.
General Simulation Principles
ETM 607 – Discrete Event Simulation Fundamentals Define Discrete Event Simulation. Define concepts (entities, attributes, event list, etc…) Define “world-view”,
Chapter 3 General Principles Banks, Carson, Nelson & Nicol Discrete-Event System Simulation.
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 QUEUES. 2 Definition A queue is a linear list in which data can only be inserted at one end, called the rear, and deleted from the other end, called.
Data Structures Using C++ 2E Chapter 8 Queues. Data Structures Using C++ 2E2 Objectives Learn about queues Examine various queue operations Learn how.
+ Simulation Design. + Types event-advance and unit-time advance. Both these designs are event-based but utilize different ways of advancing the time.
Dept. Computer Science, Tianjin Uni. 系统仿真 System Simulation 2008.
Chapter 2 – Fundamental Simulation ConceptsSlide 1 of 46 Chapter 2 Fundamental Simulation Concepts.
SIMULATION EXAMPLES QUEUEING SYSTEMS.
SIMULATION OF A SINGLE-SERVER QUEUEING SYSTEM
WOOD 492 MODELLING FOR DECISION SUPPORT Lecture 25 Simulation.
1 Simulation Implementation Using high-level languages.
Chapter 2 Fundamental Simulation Concepts
MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
Network Protocol Simulation: A look at Discrete Event Simulation Grant D. Lanterman 5/21/2004.
Discrete Event Simulation
CDA6530: Performance Models of Computers and Networks Chapter 8: Statistical Simulation ---- Discrete Event Simulation (DES) TexPoint fonts used in EMF.
SIMULATION EXAMPLES. Monte-Carlo (Static) Simulation Estimating profit on a sale promotion Estimating profit on a sale promotion Estimating profit on.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
 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,
Chapter 3 General Principles Banks, Carson, Nelson & Nicol Discrete-Event System Simulation.
Ch. 3 General Principles Discrete-event simulation The basic building blocks of all discrete-event simulation models : entities and attributes, activities.
Unit 4 Simulation software. Introduction Software used to develop simulation models can be divided into 3 categories: – General-purpose programming languages:
MODELING AND SIMULATION CS 313 Simulation Examples 1.
Simulation Examples And General Principles Part 2
Simulation modelling real processes to make predictions.
CDA6530: Performance Models of Computers and Networks Chapter 8: Statistical Simulation ---- Discrete Event Simulation (DES) TexPoint fonts used in EMF.
Discrete-Event System Simulation in Java. Discrete Event Systems New dynamic systems New dynamic systems Computer and communication networks Computer.
Simulation of single server queuing systems
Chapter 2 Simulation Examples. Simulation steps using Simulation Table 1.Determine the characteristics of each of the inputs to the simulation (probability.
Modeling and Simulation
Discrete Event Simulation
Modeling and Simulation CS 313
SIMULATION EXAMPLES QUEUEING SYSTEMS.
More Explanation of an example in chapter4
SIMULATION EXAMPLES QUEUEING SYSTEMS.
Concepts In Discrete-Event Simulation
Discrete Event “Hand” Simulation of a GI/GI/1 Queue
MECH 3550 : Simulation & Visualization
Chapter 4: Simulation Designs
CSI4124/SYS5110– Foundations on Modeling and Simulation
SIMULATION EXAMPLES QUEUEING SYSTEMS.
Presentation transcript:

NETW 707 Modeling and Simulation Amr El Mougy Maggie Mashaly

Lecture (4) The Event Scheduling/ Time Advance Algorithm

The Future Event List (FEL)  FEL: contains all the notices for events scheduled to occur at a future time  At any given time (t), the FEL contains all previously scheduled future events and their associated event times, e.g.: t 1, t 2, t 3, …, etc. See Fig.  The FEL is ordered by event time, i.e. events are arranged chronologically so that the event time satisfies t ≤ t 1 ≤ t 2 ≤ … ≤ t n  At time (t), i.e. CLOCK = t, the event associated with t 1 is called the imminent event. That is, the event that will occur CLOCKSystem State Entities and Attributes Set 1Set 2…..FEL Cumulative Statistics and Counters t(x, y, z,…) (3, t 1 ) – type 3 event to occur at t 1 (1, t 2 ) – type 1 event to occur at t 2.

Advancing Simulation Time and Updating System Image CLOCKSystem StateEntities and AttributesSet 1Set 2…..FEL Cumulative Statistics and Counters t(5, 1, 6) (3, t 1 ) – type 3 event to occur at t 1 (1, t 2 ) – type 1 event to occur at t 2 (1, t 3 ) – type 1 event to occur at t 3. (2, t n ) – type 2 event to occur at t n Event scheduling/time advance algorithm Step 1. Remove the event notice for the imminent event (event 3, time t 1 ) from the FEL Step 2. Advance CLOCK to imminent event time (i.e. advance CLOCK from t to t 1 ) Step 3. Execute imminent event; update system state; change entity attributes; and set membership as needed Step 4. Generate future events (if necessary) and place their event notices on the FEL, ranked by event time, e.g. event 4 to occur at time t *, where t 1 < t * < t 1 Step 5. Update cumulative statistics and counters  Old snapshot at time t

Advancing Simulation Time and Updating System Image  New snapshot at time t 1 CLOCKSystem StateEntities and AttributesSet 1Set 2…..FEL Cumulative Statistics and Counters t(5, 1, 5) (1, t 2 ) – type 1 event to occur at t 2 (4, t * ) – type 4 event to occur at t * (1, t 3 ) – type 1 event to occur at t 3. (2, t n ) – type 2 event to occur at t n

Generation of External Arrival Stream by Bootsrapping 123nn t t*t* …. CLOCK = a*a* Between successive arrival events, other types of events may occur, causing system state to change 0 Arrival Time Arrival Time At simulated time t, assumed to be the instant of the n th arrival, generate interarrival time a *, compute t * = t + a * and schedule future arrival on FEL to occur at future time t *

Stopping a Simulation  At time 0, schedule a stop simulation event at a specified future time T E. The simulation will run over the time interval [0, T E ] -Example: Simulate a shop for 8 hours  Run length T E is determined by the simulation itself. T E is the time of occurrence of some event E. - Example: T E = time of the 100 th service completion

Example: Checkout Counter  Grocery store with one checkout counter. The stopping time is set to 60 minutes  Model Components: System State Entities Events Event Notices Activities Delay LQ(t): number of customers waiting in line at time t LS(t): number being served (0 or 1) at t Servers and customers Arrivals (A) Departures (D) Stopping (E) (A, t): Arrival event to occur at future time t (D, t): Departure event to occur at future time t (E, 60): Stopping event to occur at future time 60 Inter-arrival time Service time Time the customer spends in waiting

Execution of the Arrival Event Arrival event occurs at CLOCK = t Set LS(t) = 1 Increment LQ(t) by 1 LS(t) = 1? Generate service time s*; Schedule new departure event at t + s* Generate service time s*; Schedule new departure event at t + s* Generate interarrival time a*; schedule next arrival event at t + a* Generate interarrival time a*; schedule next arrival event at t + a* Collect statistics Return control to time-advance routine to continue simulation Yes No Step 3 Step 4 Step 5

Execution of the Departure Event Departure event occurs at CLOCK = t Set LS(t) = 0 Decrement LQ(t) by 1 LQ(t) > 0? Generate service time s*; Schedule new departure event at t + s* Generate service time s*; Schedule new departure event at t + s* Collect statistics Return control to time-advance routine to continue simulation Yes No Step 3 Step 4 Step 5

Evolution of the Event List B = Total server busy time MQ = maximum queue length

Experiment Modification  Redesign the simulation to calculate the mean response time and mean proportion of customers who spend 5 or more minutes in the system  Hints: Response time is the length of time the customer spends in the system To calculate the response time for an individual customer, it is necessary to know the arrival and departure times of that customer Therefore, a customer entity with arrival time as an attribute will be added to the list of model components Event notices on the FEL will be expanded to indicate which is affected

Additional Model Components System State Entities Events Event Notices Activities Cumul- ative Stats LQ(t): number of customers waiting in line at time t LS(t): number being served (0 or 1) at t Servers and customers (C i, t): customer i who arrived at time t Arrivals (A) Departures (D) Stopping (E) (A, t): Arrival event to occur at future time t (D, t): Departure event to occur at future time t (A, t, C i ): Arrival of customer (C i ) to occur at future time t (D, t, C j ): Departure of customer (C j ) to occur at future time t (E, 60): Stopping event to occur at future time 60 Inter-arrival time Service time Time the customer spends in waiting S: set of customer response times for all customers who have departed by the current time F: total number of customers who have spent more than 5 minutes in the system N D : total number of departures up to the current time

New Simulation Table