 1  Outline  simulating GI/G/1 queues  M/M/1 queues  theoretical results of queueing systems  an inventory system  simulation program with an event.

Slides:



Advertisements
Similar presentations
Introduction into Simulation Basic Simulation Modeling.
Advertisements

IE 429, Parisay, January 2003 Review of Probability and Statistics: Experiment outcome: constant, random variable Random variable: discrete, continuous.
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.
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.
 1  Outline  terminating and non-terminating systems  analysis of terminating systems  generation of random numbers  simulation by Excel  a terminating.
Operations Management Waiting Lines. 2 Ardavan Asef-Vaziri Dec-2010Operations Management: Waiting Lines1  Questions: Can we process the orders? How many.
Chapter 13 Queuing Theory
MODELING AND ANALYSIS OF MANUFACTURING SYSTEMS Session 6 SCHEDULING E
Components and Organization of Discrete-event Simulation Model
Queuing and Transportation
Simulation with ArenaChapter 2 – Fundamental Simulation Concepts Discrete Event “Hand” Simulation of a GI/GI/1 Queue.
from Prof. Goldsman’s lecture notes
Simulating Single server queuing models. Consider the following sequence of activities that each customer undergoes: 1.Customer arrives 2.Customer waits.
Module C10 Simulation of Inventory/Queuing Models.
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:
Fundamental Simulation Concepts
Lecture 4 Mathematical and Statistical Models in Simulation.
Lab 01 Fundamentals SE 405 Discrete Event Simulation
Graduate Program in Engineering and Technology Management
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 Examples ~ By Hand ~ Using Excel
1 Chapter 2 Fundamental Simulation Concepts. Simulation with Arena Fundamental Simulation Concepts C2/2 What We’ll Do... Underlying ideas, methods, and.
1 Chapter 2 Fundamental Simulation Concepts Dr. Jason Merrick.
Simulation with ArenaChapter 2 – Fundamental Simulation ConceptsSlide 1 of 46 Fundamental Simulation Concepts Chapter 2.
ETM 607 – Discrete Event Simulation Fundamentals Define Discrete Event Simulation. Define concepts (entities, attributes, event list, etc…) Define “world-view”,
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.
1 Slides used in class may be different from slides in student pack Chapter 5 Process Analysis  Process Analysis  Process Flowcharting  Categories of.
Queueing Theory What is a queue? Examples of queues: Grocery store checkout Fast food (McDonalds – vs- Wendy’s) Hospital Emergency rooms Machines waiting.
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.
TexPoint fonts used in EMF.
Example simulation execution The Able Bakers Carhops Problem There are situation where there are more than one service channel. Consider a drive-in restaurant.
+ Simulation Design. + Types event-advance and unit-time advance. Both these designs are event-based but utilize different ways of advancing the time.
1 Chapters 8 Overview of Queuing Analysis. Chapter 8 Overview of Queuing Analysis 2 Projected vs. Actual Response Time.
Chapter 2 – Fundamental Simulation ConceptsSlide 1 of 46 Chapter 2 Fundamental Simulation Concepts.
CSC 205 Programming II Lecture 22 Carwash Simulation.
Slide 1 of 46 Fundamental Simulation Concepts Last revision June 7, 2003.
Chapter 2 – Fundamental Simulation ConceptsSlide 1 of 46 Fundamental Simulation Concepts.
Slide 1 of 46 Fundamental Simulation Concepts Chapter 2.
SIMULATION EXAMPLES QUEUEING SYSTEMS.
SIMULATION OF A SINGLE-SERVER QUEUEING SYSTEM
Simulation Examples and General Principles
NETW 707 Modeling and Simulation Amr El Mougy Maggie Mashaly.
1 Simulation Implementation Using high-level languages.
MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,
Discrete Event Simulation
(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.
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.
 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,
Random Variables r Random variables define a real valued function over a sample space. r The value of a random variable is determined by the outcome of.
Mohammad Khalily Islamic Azad University.  Usually buffer size is finite  Interarrival time and service times are independent  State of the system.
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.
Queuing Theory Simulation & Modeling.
Chapter 2 Simulation Examples. Simulation steps using Simulation Table 1.Determine the characteristics of each of the inputs to the simulation (probability.
Managerial Decision Making Chapter 13 Queuing Models.
Chapter 1 What is Simulation?. Fall 2001 IMSE643 Industrial Simulation What’s Simulation? Simulation – A broad collection of methods and applications.
Simulation of Inventory Systems
ETM 607 – Spreadsheet Simulations
Demo on Queuing Concepts
SIMULATION EXAMPLES QUEUEING SYSTEMS.
SIMULATION EXAMPLES QUEUEING SYSTEMS.
Discrete Event “Hand” Simulation of a GI/GI/1 Queue
Fundamental Simulation Concepts
Chapter 4: Simulation Designs
SIMULATION EXAMPLES QUEUEING SYSTEMS.
Presentation transcript:

 1  Outline  simulating GI/G/1 queues  M/M/1 queues  theoretical results of queueing systems  an inventory system  simulation program with an event calendar  hand simulation

 2  To Simulate an GI/G/1 Queue  definition of variables definition of variables  definition of events definition of events  pseudo code pseudo code  flow chart of program flow chart of program NKL TaTa TsTs TNOW TMAX distribution of inter-arrival times distribution of service times

 3  Flow Chart for Simulating an GI/G/1 Queue N = L = K = T = 0; T a = random inter- arrival time; T s = infinity Yes ouput L/T now and L/K L = L + (T s - T now )N; T now = T s ; N = N - 1 L = L + (T a - T now )N; T now = T a ; N = N + 1; K = K +1; T a = T now + random inter-arrival time T s = T now + random service time T now  T max No next event service N = 0 T s = T now + random service time No Yes T s = infinity arrival N = 1 No

 4  To Simulate an GI/G/1 Queue  definition of variables  definition of events  pseudo code  flow chart of program  Java program Java program

 5  Variations of GI/G/1 Queues  M/M/1-based queue  standard: Java programJava program  with queue limit: Java programJava program

 6  Terms Associated with a Customer  for customer i  arrival time, t ai  time to start service, t si  time to leave system, t di  time in queue, D i = t si – t ai  service time, S i = t di – t si  time in system, W i = t di – t ai other names of time in queue = waiting time in queue = delay time other names of time in system = waiting time in system = total time in system

 7  Machine (Server) Queue (FIFO) Theoretical Result: Conservation of Time n n-1n-2... nn-1... n n n-1 n-2n-3... for each customer, his time in system = time in queue + service time ave. time in system = ave. time in queue + E(service time) tag nth customer

 8  Sample-Path Results of a Queueing System  state: N(t), number of customers in system N(t)N(t) t average # of customers up to t = 26:

 9  Sample-Path Results of a Queueing System  total length of rectangular boxes of the same color = waiting time of the corresponding customer in system average # in system = (arrival rate) (average waiting time)

 10  Theoretical Result: Little ’ s Formula  very general result  for any system: L = w  L = average # of customers in system  = arrival rate of customers  w = average time in system

 11  Theoretical Result: Little ’ s Formula  GI/G/1 queue  the whole system  average # in system = (arrival rate) (average time in system)  the waiting queue as the system  average # in queue = (arrival rate) (average time in queue)  the server as the system  utilization of server = (arrival rate) E(service time)

 12  An Inventory System Day n demand of the Day n D n ~ Geo(0.1) at the beginning of Day n: update inventory if ordered quantity arrives lost sales, no back order $0.1 per unit on hand at the beginning of a day after receiving any outstanding order (Q, s) policy: order Q items at the end of a day if inventory on hand  s at most one outstanding order leadtime of orders: equally likely to be 0 to 4 days (i.e., the ordered quantity can possibly arrive the next day) ordering cost: $20 per order penalty: $1 per piece lost

 13  Inventory System  inventory system inventory system  definition of variables definition of variables  definition of events definition of events  pseudo code pseudo code  flow chart flow chart  Java program Java program

 14  Simulating Complex Systems  simple system (up to now)  chess piece, machine, GI/G/1 queue, inventory system  tailor-made programs for these problems  complex problems  generic program structure  event scheduled by an event calendar

 15  Generic Program Structure for Complex Systems  Initialization Event while (not stopping (e.g., TNOW < TTERM) ) { switch (Next Event Type) { case 1: tasks of type 1 event; break;.... case n: tasks of type n event; break; } } Termination Event need to keep track of the timing of events

 16  Conceptual Structure of an Event Calendar  event: (time, type, tasks to do)  event calendar: a link list with scheduled future events in ascending order of time  example  four events scheduled at epoch 0  event 1: (24.3, type = 4, tasks to do)  event 2: (35.6, type = 1, tasks to do)  event 3: (41.3, type = 2, tasks to do)  event 4: (5000, type = END, tasks to do = end program)

 17  Event Calendar of a Simulation Program Event. Cal. TNOW = 0: type 4 tasks to do type 1 tasks to do type 2 tasks to do END End simulation

 18  35.6type 1 tasks to do 41.3type 2 tasks to do 5000END End simulation 35.6type 1 tasks to do 41.3type 2 tasks to do 5000END End simulation 24.3type 4 tasks to do 35.6type 1 tasks to do 41.3type 2 tasks to do 5000END End simulation Event Calendar of a Simulation Program Event. Cal. move time to TNOW = type 1 tasks to do 41.3type 2 tasks to do 5000END End simulation suppose that no new event is created by a type 4 event execute first event and update event calendar 35.6type 1 tasks to do 41.3type 2 tasks to do 5000END End simulation TNOW = 0:

 19  24.3type 4 tasks to do 35.6type 1 tasks to do 41.3type 2 tasks to do 5000END End simulation Event Calendar of a Simulation Program Event. Cal. move time to TNOW = suppose that a new event is created by an type 4 event at 39.1 execute first event and update event calendar TNOW = 0: 35.6type 1 tasks to do 41.3type 2 tasks to do 5000END End simulation 39.1type 4 tasks to do 35.6type 1 tasks to do 41.3type 2 tasks to do 5000END End simulation 39.1type 4 tasks to do 35.6type 1 tasks to do 41.3type 2 tasks to do 5000END End simulation 39.1type 4 tasks to do

 20  Operations of the Event Calendar  delete an event that has (just) occurred  after completing all tasks at TNOW, remove the first event in the event calendar  insert a new event  get the event time of the new event  check where to insert the event  move backward one rank for events occurring after the new event  insert the new event Describe concept only; actual implementation depends on the data structure used

 21  A Crude Pseudo-Code of GI/G/1 Queue with Event Calendar  1  initialization  set TNOW = 0; initialize variables; set termination event; set initial events  2  get next event type  3  while { next event != termination } {  get next event time and next event details  set TNOW to next event time  update the Event Calendar  execute next event, including updating variables and possibly adding new events to Event Calendar  get next event type }}  4  execute the termination Event

 22  An GI/G/1 Queue with the Event Calendar  inter-arrival times ~ exp of mean 10  service times ~ exp of mean 5  Java Program Java Program

 23  Simulation by Hand  simulate the system for 20 time units to get  total # of customers served (in the time horizon)  average and maximum waiting time in queue  time-average and maximum number in queue  average and maximum total time in system  utilization (proportion of busy time of station)

 24  Input Data  Initially (time 0) empty and idle  Part NumberArrival TimeInterarrival TimeService Time  Stop when 20 minutes of (simulated) time have passed

 25  hand simulation