Agenda General guideline of simulations Discrete event simulation

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

Introduction into Simulation Basic Simulation Modeling.
+ Validation of Simulation Model. Important but neglected The question is How accurately does a simulation model (or, for that matter, any kind of model)
Modeling & Simulation. System Models and Simulation Framework for Modeling and Simulation The framework defines the entities and their Relationships that.
Nur Aini Masruroh Queuing Theory. Outlines IntroductionBirth-death processSingle server modelMulti server model.
#11 QUEUEING THEORY Systems Fall 2000 Instructor: Peter M. Hahn
Simulation.
CHAPTER 6 Statistical Analysis of Experimental Data
Lecture Slides Elementary Statistics Twelfth Edition
Lecture 4 Mathematical and Statistical Models in Simulation.
Lab 01 Fundamentals SE 405 Discrete Event Simulation
Model Calibration and Model Validation
Monté Carlo Simulation MGS 3100 – Chapter 9. Simulation Defined A computer-based model used to run experiments on a real system.  Typically done on a.
Stevenson and Ozgur First Edition Introduction to Management Science with Spreadsheets McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies,
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:
Introduction to Management Science
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.
1 Validation & Verification Chapter VALIDATION & VERIFICATION Very Difficult Very Important Conceptually distinct, but performed simultaneously.
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.
Verification & Validation
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Review and Preview This chapter combines the methods of descriptive statistics presented in.
Management of Waiting Lines McGraw-Hill/Irwin Copyright © 2012 by The McGraw-Hill Companies, Inc. All rights reserved.
Simulation Prepared by Amani Salah AL-Saigaly Supervised by Dr. Sana’a Wafa Al-Sayegh University of Palestine.
1 OM2, Supplementary Ch. D Simulation ©2010 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible.
Discrete Distributions The values generated for a random variable must be from a finite distinct set of individual values. For example, based on past observations,
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 Systems Analysis Methods Dr. Jerrell T. Stracener, SAE Fellow SMU EMIS 5300/7300 NTU SY-521-N NTU SY-521-N SMU EMIS 5300/7300 Queuing Modeling and Analysis.
Waiting Lines and Queuing Models. Queuing Theory  The study of the behavior of waiting lines Importance to business There is a tradeoff between faster.
Example simulation execution The Able Bakers Carhops Problem There are situation where there are more than one service channel. Consider a drive-in restaurant.
Chapter 2 – Fundamental Simulation ConceptsSlide 1 of 46 Chapter 2 Fundamental Simulation Concepts.
شبیه سازی سیستمهای گسسته-پیشامد جری بنکس – جان کارسن ترجمه هاشم محلوجی.
Modeling and Simulation Discrete-Event Simulation
Simulation Examples and General Principles
Chapter 10 Verification and Validation of Simulation Models
Chapter 2 Fundamental Simulation Concepts
Simulation is the process of studying the behavior of a real system by using a model that replicates the system under different scenarios. A simulation.
MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,
Chapter 2 Simulation Examples
1 1 Slide © 2009 South-Western, a part of Cengage Learning Slides by John Loucks St. Edward’s University.
1 1 Slide Simulation Professor Ahmadi. 2 2 Slide Simulation Chapter Outline n Computer Simulation n Simulation Modeling n Random Variables and Pseudo-Random.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
Simulation Chapter 16 of Quantitative Methods for Business, by Anderson, Sweeney and Williams Read sections 16.1, 16.2, 16.3, 16.4, and Appendix 16.1.
(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.
CS433 Modeling and Simulation Lecture 09 – Part 02 Discrete Events Simulation Dr. Anis Koubâa 27 Dec 2008 Al-Imam.
 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,
Management of Waiting Lines Copyright © 2015 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent.
MODELING AND SIMULATION CS 313 Simulation Examples 1.
Simulation Examples And General Principles Part 2
Simulation. Types of simulation Discrete-event simulation – Used for modeling of a system as it evolves over time by a representation in which the state.
Building Valid, Credible & Appropriately Detailed Simulation Models
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
OPERATING SYSTEMS CS 3502 Fall 2017
Prepared by Lloyd R. Jaisingh
Modeling and Simulation (An Introduction)
5.3 The Central Limit Theorem
ADVANTAGES OF SIMULATION
Single-Server Queue Model
Modeling and Simulation CS 313
Chapter 10 Verification and Validation of Simulation Models
Professor S K Dubey,VSM Amity School of Business
More Explanation of an example in chapter4
Single-Server Queue Model
Concepts In Discrete-Event Simulation
5.3 The Central Limit Theorem
Presentation transcript:

Part 2: Simulation Examples 4/17/2017 Part 2: Simulation Examples

Agenda General guideline of simulations Discrete event simulation Steps to follow Simulation of Queueing systems 4.1 Single Channel Queue 4.2 Queueing with Multiple Channels Simulation of a bombing mission

1. General guideline of simulations (1)

1. General guideline of simulations (2)

1. General guideline of simulations (3) Problem formulation: Every study should begin with a statement of the problem. Setting of objectives and overall project plan: The objectives indicate the questions to be answered by simulation. A determination should be made concerning whether simulation is the appropriate methodology for the problem as formulated and objectives as stated. Model conceptualization: The construction of a model of a system is probably as much art as science. The art of modeling is enhanced by an ability to abstract the essential features of a problem, to select and modify basic assumptions that characterize the system, and then to enrich and elaborate the model until a useful approximation results Data collection: There is a constant interplay between the construction of the model and the collection of the needed input data

1. General guideline of simulations (4) Model translation: Most real-world systems result in models that require a great deal of information storage and computation, so the model must be entered into a computer-recognizable format. General purpose or special purpose simulation languages or packages to be used is determined here. Verified?: Verification pertains to the computer program prepared for the simulation model. Is the computer program performing properly? Validated?: Validation usually is achieved through the calibration of the model, an iterative process of comparing the model against actual system behavior and using the discrepancies between the two, and the insights gained, to improve the model. Experimental design: The alternatives that are to be simulated must be determined. Often, the decision concerning which alternatives to simulate will be a function of runs that have been completed and analyzed. For each system design that is simulated, decisions need to be made concerning the length of the initialization period, the length of simulation runs, and the number of replications to be made of each run.

1. General guideline of simulations (5) Production runs and analysis: Production runs, and their subsequent analysis, are used to estimate measures of performance for the system designs that are being simulated. More Runs?: Given the analysis of runs that have been completed, the analyst determines whether additional runs are needed and what design those additional experiments should follow. Documentation and reporting: There are two types of documentation: program and progress. Program documentation is necessary for numerous reasons. If the program is going to be used again by the same or different analysts, it could be necessary to understand how the program operates and what parameters used. The result of all the analysis should be reported clearly and concisely in a final report. This will enable the model users (now, the decision makers) to review the final formulation, the alternative systems that were addressed, the criterion by which the alternatives were compared, the results of the experiments, and the recommended solution to the problem

2. Discrete event simulation This course is about Discrete Event Simulations. Therefore, the models considered are discrete, dynamic, and stochastic Discrete-event systems simulation is the modeling of systems in which the state variable changes only at a discrete set of points in time The simulation models are analyzed by numerical methods rather than by analytical methods

3. Steps to follow (1) An activity time associated with model input Determine the characteristics of each of the inputs to the simulation. Quite often, these are modeled as probability distributions, either continuous or discrete. Construct a simulation table. Each simulation table is different, for each is developed for the problem at hand. Each column in the table is one of the following: An activity time associated with model input Any other random variable defined by a model input A system state An event, or the clock tie of an event A model output A model response

Activities and system states 3. Steps to follow (2) A Generic simulation Table: Let there are p inputs, xij, j = 1,2,... ,p, and one response, Yi, for each of repetitions (or, trials) i = 1,2, . . . , n. Initialize the table by filling in the data for repetition 1 For each repetition i, generate a value for each of the p inputs, and evaluate the function, calculating a value of the response Yi. The input values may be computed by sampling values from the distributions chosen in step 1. A response typically depends on the inputs and one or more previous responses. Step Activities and system states Output xi1 xi2 xi3 … xij… .xip yi 1 n 9

4. Simulation of Queueing Systems (1) A queueing system is described : by its calling population, the nature of arrivals, the service mechanism, the system capacity and the queue and any priorities within the queue or service 10

4. 1 Single Channel (Server) Queue (1) In the single-channel queue, the calling population is infinite; that is, if a unit leaves the calling population and joins the waiting line or enters service, there is no change in the arrival rate of other units that could need service. Arrivals for service occur one at a time in a random fashion; once they join the waiting line, they are eventually served. In addition, service times are of some random length according to a probability distribution which does not change over time. The system capacity has no limit, meaning that any number of units can wait in line Finally, units are served in the order of their arrival (often called FIFO: first in, first out) by a single server or channel. Arrivals and services are defined by the distribution of the time between arrivals and the distribution of service times, respectively. For any simple single or multi-channel queue, the overall effective arrival rate must be less than the total service rate, or the waiting line will grow without bound. When queues grow without bound, they are termed "explosive" or unstable. 11

4.1 Single Server Queue (2) Prior to our introducing several simulations of queueing systems, it is necessary to understand the concepts of system state, events, and simulation clock. The state of the system is the number of units in the system and the status of the server, busy or idle. An event is a set of circumstances that causes an instantaneous change in the state of the system. In a single-channel queueing system, there are only two possible events that can affect the state of the system. The entry of a unit into the system (the arrival event) The completion of service on a unit (the departure event). The queueing system includes the server, the unit being serviced (if one is being serviced), and the units in the queue (if any are waiting). The simulation clock is used to track simulated time 12

4.1 Single Channel Queue (3) – Departure Event If a unit has just completed service, the simulation proceeds in the manner shown in this flow diagram Server has only two possible states: It is either busy or idle. 13

4.1 Single Channel Queue (4) – Arrival Event The arrival event occurs when a unit enters the system. The flow diagram for the arrival event is shown below. 14

4.1 Single Channel Queue (5)- Unit Status Arrival Event Departure Event 15

4.1 Single Channel Queue (6)- Simulated Clock How can the events described above occur in simulated time? Simulations of queueing systems generally require the maintenance of an event list for determining what happens next. The event list tracks the future times at which the different types of events occur. Simulations using event lists are described in Chapter 3. Here the simulation is simplified by tracking each unit explicitly. In simulation, events usually occur at random times, the randomness imitating uncertainty in real life The randomness needed to imitate real life is made possible through the use of “Random Numbers” Random numbers are distributed uniformly and independently on the interval (0, 1) 16

4.1 Single Channel Queue (7) -Random Numbers Random numbers also can be generated in simulation packages and in spreadsheets (such as Excel). For example, Excel has a macro function called RAND() that returns a "random" number between 0 and 1. When numbers are generated by using a procedure, they are often referred to as pseudo-random numbers Because the procedure is fully known, it is always possible to predict the sequence of numbers that will be generated prior to the simulation We will discuss random number generation later 17

4.1 Single Channel Queue (8) – Interarrival Times In a single-channel queueing simulation, interarrival times and service times are generated from the distributions of these random variables. For simplicity, assume that the times between arrivals were generated by rolling a die five times and recording the up face. Table below contains a set of five interarrival times generated in this manner. 18

4.1 Single Channel Queue (9)- Interarrival Times (continued ..) These five interarrival times are used to compute the arrival times of six customers at the queueing system. The first customer is assumed to arrive at clock time 0. This starts the clock in operation. The second customer arrives two time units later, at clock time 2. The third customer arrives four time units later, at clock time 6; and so on 19

4.1 Single Channel Queue (10) – Service Times The second time of interest is the service time. Table below contains service times generated at random from a distribution of service times. The only possible service times are one, two, three, and four time units, all four values are equally likely to occur These random numbers are generated by placing the numbers one through four on chips and drawing the chips from a hat with replacement, being sure to record the numbers selected 20

4.1 Single Channel Queue (11) – Simulation Table Now, the interarrival times and service times must be meshed to simulate the single-channel queueing system Table 2.7 was designed specifically for a single-channel queue that serves customers on a first-in-first-out (FIFO) basis 21

4.1 Single Channel Queue (12)- Chronological Ordering of Events The following table is ordered by clock time, in which case the events may or may not be ordered by customer number. The chronological ordering of events is the basis of the approach to discrete-event simulation 22

4.1 Single Channel Queue (13) - Number of Customers in the System 23

4.1 Single Channel Queue (14) - Grocery Store Example (1) A small grocery store has only one checkout counter. Customers arrive at this checkout counter at random times that are from 1 to 8 minutes apart, each possible value of interarrival time has the same probability of occurrence, as shown in Table 2.9 The service times vary from 1 to 6 minutes, with the probabilities shown in Table 2.10 Simulate up to 100 customers (too small a data for good analysis) Average Service time = s.p(s) = 3.2 minutes Average Interval Arrival Time = (1+8)/2 = 4.5 minutes 24

4.1 Single Channel Queue (14) - Grocery Store Example (2) 25

4.1 Single Channel Queue (14) - Grocery Store Example (3) 26

4.1 Single Channel Queue (14) - Grocery Store Example (4) 27

4.1 Single Channel Queue (14) - Grocery Store Example (6) Waiting time in queue for the first trial of 100 customers is shown below 28

4.1 Single Channel Queue (14) - Grocery Store Example (6) Average waiting time over 50 trials is = 1.5 Histogram of 50 average waiting times over 50 trials is shown below 29

4.2 Queuing with Multiple Servers (1): Able-Baker Call Center Problem Two Service Channels (or Servers) A computer technical support center where personnel take calls and provide service. The time between calls ranges from 1 to 4 minutes, with distribution as shown in Table 2.12 of the textbook. There are two technical support people-Able and Baker. Able is more experienced and can provide service faster than Baker. The distributions of their service times are shown in Tables 2.13 and 2.14 Policy: A simplifying rule is that Able gets the call if both technical support people are idle. Able has seniority. The solution would be different if the decision were made at random or by any other rule How well this policy is working?? 30

4.2 Queuing with Multiple Servers (2): Distributions Average=2.25 Average=3.29 Average=4.25 31

4.2 Queuing with Multiple Servers (3): Simulation Steps For Caller k, generate an interarrival time Ak. Add it to the previous arrival time Tk-1 to get the arrival time of Caller k as Tk = Tk-1+Ak. 32

4.2 Queuing with Multiple Servers (3): Simulation Steps If Able is idle, Caller k begins service with Able at the current time Tnow. Able's service completion time, Tfin.A is given by Tfin.A = Tnow + Tsvc.A where Tsvc.A is the service time generated from Able's Service Time Distribution. Caller k's time in system, Tsys, is given by Tsys = Tfin.A - Tk. Because Able was idle, Caller k's delay, Twait, is given by Twait = 0 If Able is busy, but Baker is idle, Caller k begins service with Baker at the current time Tnow. Baker's service completion time, Tfin.B is given by Tfin.B = Tnow + Tsvc.B where Tsvc.B is the service time generated from Baker's Service Time Distribution. Caller k's time in system, Tsys, is given by Tsys = Tfin.B - Tk. Because Baker was idle, Caller k's delay, Twait, is given by Twait = 0 33

4.2 Queuing with Multiple Servers (3): Simulation Steps If Able and Baker are both busy, then calculate the time at which the first one becomes available, as follows: Tbeg = min(Tfin.A, Tfin.B). Caller k begins service at Tbeg. When service for Caller k begins, set Tnow = Tbeg. Then compute Tfin.A or Tfin.B as in Step 2. Caller k's time in system, Tsys, is given by Tsys = Tfin.A - Tk or Tsys = Tfin,B - Tk, as appropriate. 34

4.2 Queuing with Multiple Servers (4): Simulation Table Total Customer Delay = 211 or about 2.11 minutes per caller Total time in system = 564 or 5.64 minutes per caller 35

4.2 Queuing with Multiple Servers (5): Caller Delay One trail with 100 callers 36

4.2 Queuing with Multiple Servers (5): Average Caller Delay Experiment with 400 trials each with 100 callers 19% average delays are longer than 1 minute (78 of 400) only 2.75% (11 of 400) are longer than 2 minutes 37

4.2 Queuing with Multiple Servers (6): Further Investigation What happens if the policy is changed? Is it cost effective to add another server? Can one server handle all calls in this example? 38

5. Simulation of a Bombing Mission (1) A bomber attempting to destroy an ammunition depot, as shown in Figure. (This bomber has conventional rather than laser-guided weapons). The bomber flies in the horizontal direction and carries 10 bombs. The aiming point is (0,0). If a bomb falls anywhere on the target, a hit is scored; otherwise, the bomb is a miss. 39

5. Simulation of a Bombing Mission (2) The point of impact is assumed to be normally distributed around the aiming point with a standard deviation of 400 meters in the direction of flight and 200 meters in the perpendicular direction The problem is to simulate the operation and make statements about the number of bombs on target. Recall that the standardized normal variate, Z, having mean 0 and standard deviation 1 is distributed as Z=(X-)/ , where X is a normal random variable,  is the mean of distribution X and  is the standard deviation of X Then X=ZX and Y=ZY where (X,Y) are the simulated co-ordinates of the bomb after it has fallen (What is the Mean???) With X=400 and Y=200 we have X=400.Zi and Y=200.Zj The i and j subscripts have been added to indicate that the values of Z should be different. (Why???) We will see later how to generate Normal Random Variables 40

5. Simulation of a Bombing Mission (3) RNNx (RNNY) stands for "random normal number to compute the X (Y) coordinate" and corresponds to Zi (Zj) 41

5. Simulation of a Bombing Mission (4) An experiment was run with 400 trials (each trial 10 bombs) The results range from two hits to ten hits. Average is 6.72 hits 44% [(175/400) x 100%] of the bombing runs there are six or fewer hits. In about 71 % of the cases, [(283/400) x 100%] there were six, seven, or eight hits 42