Table of Contents Chapter 12 (Computer Simulation: Basic Concepts)

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.
1 Overview of Simulation When do we prefer to develop simulation model over an analytic model? When not all the underlying assumptions set for analytic.
11 Simulation. 22 Overview of Simulation – When do we prefer to develop simulation model over an analytic model? When not all the underlying assumptions.
Modeling & Simulation. System Models and Simulation Framework for Modeling and Simulation The framework defines the entities and their Relationships that.
Chapter 10: Simulation Modeling
 1  Outline  performance measures for a single-server station  discrete-event simulation  hand simulation  process-oriented simulation approach.
Session 7a. Decision Models -- Prof. Juran2 Overview Monte Carlo Simulation –Basic concepts and history Excel Tricks –RAND(), IF, Boolean Crystal Ball.
(Monté Carlo) Simulation
Lecture 3 Concepts of Discrete-Event Simulation. 2 Discrete Event Model  In the discrete approach to system simulation, state changes in the physical.
Chapter 8 Estimating Single Population Parameters
FIN 685: Risk Management Topic 5: Simulation Larry Schrenk, Instructor.
Nur Aini Masruroh Queuing Theory. Outlines IntroductionBirth-death processSingle server modelMulti server model.
Simulation Where real stuff starts. ToC 1.What, transience, stationarity 2.How, discrete event, recurrence 3.Accuracy of output 4.Monte Carlo 5.Random.
Discrete Event Simulation How to generate RV according to a specified distribution? geometric Poisson etc. Example of a DEVS: repair problem.
Building and Running a FTIM n 1. Define the system of interest. Identify the DVs, IRVs, DRVs, and Objective. n 2. Develop an objective function of these.
Simulation.
Queueing Models: Data Collection and Hand Simulation from Prof. Goldsman’s lecture notes.
Slide 1 Statistics Workshop Tutorial 4 Probability Probability Distributions.
Lecture Slides Elementary Statistics Twelfth Edition
McGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., Table of Contents Chapter 15 (Computer Simulation: Basic Concepts) The Essence of Computer.
Simulation Examples Continued
Lecture 4 Mathematical and Statistical Models in Simulation.
Stevenson and Ozgur First Edition Introduction to Management Science with Spreadsheets McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies,
McGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2008 CD12s.1 Generating Random Observations from a Probability Distribution The method for generating.
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.
 1  Outline  stages and topics in simulation  generation of random variates.
Verification & Validation
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Review and Preview This chapter combines the methods of descriptive statistics presented in.
© 2007 Pearson Education Simulation Supplement B.
1-1 Copyright © 2015, 2010, 2007 Pearson Education, Inc. Chapter 10, Slide 1 Chapter 10 Understanding Randomness.
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.
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.
+ Simulation Design. + Types event-advance and unit-time advance. Both these designs are event-based but utilize different ways of advancing the time.
Chapter 2 – Fundamental Simulation ConceptsSlide 1 of 46 Chapter 2 Fundamental Simulation Concepts.
1.3 Simulations and Experimental Probability (Textbook Section 4.1)
Modeling and Simulation Discrete-Event Simulation
McGraw-Hill/Irwin © 2006 The McGraw-Hill Companies, Inc., All Rights Reserved. 1.
Chapter 10 Verification and Validation of Simulation Models
NETW 707 Modeling and Simulation Amr El Mougy Maggie Mashaly.
Building Simulation Model In this lecture, we are interested in whether a simulation model is accurate representation of the real system. We are interested.
WOOD 492 MODELLING FOR DECISION SUPPORT Lecture 25 Simulation.
Chapter 2 Fundamental Simulation Concepts
MATH 3033 based on Dekking et al. A Modern Introduction to Probability and Statistics Slides by Sean Hercus Instructor Longin Jan Latecki Ch. 6 Simulations.
Reid & Sanders, Operations Management © Wiley 2002 Simulation Analysis D SUPPLEMENT.
Computer Simulation. The Essence of Computer Simulation A stochastic system is a system that evolves over time according to one or more probability distributions.
MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,
McGraw-Hill/Irwin Copyright © 2009 by The McGraw-Hill Companies, Inc. All rights reserved.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
1 BA 555 Practical Business Analysis Linear Programming (LP) Sensitivity Analysis Simulation Agenda.
Discrete Event Simulation
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.
 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,
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
The accuracy of averages We learned how to make inference from the sample to the population: Counting the percentages. Here we begin to learn how to make.
To accompany Quantitative Analysis for Management, 9e by Render/Stair/Hanna 15-1 © 2006 by Prentice Hall, Inc. Upper Saddle River, NJ Prepared by.
Building Valid, Credible & Appropriately Detailed Simulation Models
The Law of Averages. What does the law of average say? We know that, from the definition of probability, in the long run the frequency of some event will.
CIS 2033 based on Dekking et al. A Modern Introduction to Probability and Statistics B: Michael Baron. Probability and Statistics for Computer Scientists,
Computer Simulation Henry C. Co Technology and Operations Management,
Prepared by Lloyd R. Jaisingh
Modeling and Simulation CS 313
Chapter 10 Verification and Validation of Simulation Models
Simulation Supplement B.
Presentation transcript:

Table of Contents Chapter 12 (Computer Simulation: Basic Concepts) The Essence of Computer Simulation (Section 12.1) 12.2 Example 1: A Coin-Flipping Game (Section 12.1) 12.3–12.7 Example 2: Heavy Duty Company (Section 12.1) 12.8–12.14 A Case Study: Herr Cutter’s Barber Shop (Section 12.2) 12.15–12.23 Analysis of the Case Study (Section 12.3) 12.24–12.31 Outline of a Major Computer Simulation Study (Section 12.4) 12.32–12.34 © The McGraw-Hill Companies, Inc., 2008

The Essence of Computer Simulation A stochastic system is a system that evolves over time according to one or more probability distributions. Computer simulation imitates the operation of such a system by using the corresponding probability distributions to randomly generate the various events that occur in the system. Rather than literally operating a physical system, the computer just records the occurrences of the simulated events and the resulting performance of the system. Computer simulation is typically used when the stochastic system ivolved is too complex to be analyzed satisfactorily by analytical models. © The McGraw-Hill Companies, Inc., 2008

Example 1: A Coin-Flipping Game Rules of the game: Each play of the game involves repeatedly flipping an unbiased coin until the difference between the number of heads and tails tossed is three. To play the game, you are required to pay $1 for each flip of the coin. You are not allowed to quit during the play of a game. You receive $8 at the end of each play of the game. Examples: HHH 3 flips You win $5 THTTT 5 flips You win $3 THHTHTHTTTT 11 flips You lose $3 © The McGraw-Hill Companies, Inc., 2008

Computer Simulation of Coin-Flipping Game A computer cannot flip coins. Instead it generates a sequence of random numbers. A number is a random number between 0 and 1 if it has been generated in such a way that every possible number within the interval has an equal chance of occurring. An easy way to generate random numbers is to use the RAND() function in Excel. To simulate the flip of a coin, let half the possible random numbers correspond to heads and the other half to tails. 0.0000 to 0.4999 correspond to heads. 0.5000 to 0.9999 correspond to tails. © The McGraw-Hill Companies, Inc., 2008

Computer Simulation of Coin-Flipping Game Figure 12.1 A spreadsheet model for a computer simulation of the coin-flipping game (Example 1). © The McGraw-Hill Companies, Inc., 2008

Data Table for 14 Replications of Coin-Flipping Game Figure 12.2 A data table that records the results of performing 14 replications of a computer simulation with the spreadsheet in Figure 12.1. © The McGraw-Hill Companies, Inc., 2008

Data Table for 1000 Replications of Coin-Flipping Game Figure 12.3 This data table improves the reliability of the computer simulation recorded in Figure 12.2 by performing 1,000 replications instead of 14. © The McGraw-Hill Companies, Inc., 2008

Corrective Maintenance versus Preventive Maintenance The Heavy Duty Company has just purchased a large machine for a new production process. The machine is powered by a motor that occasionally breaks down and requires a major overhaul. Therefore, a second standby motor is kept, and the two motors are rotated in use. The breakdowns always occur on the fourth, fifth, or sixth day that the motor is in use. Fortunately, it takes fewer than three days to overhaul a motor, so a replacement is always ready. Cost of a Replacement Cycle that Begins with a Breakdown Replace a Motor $2,000 Lost production during replacement 5,000 Overhaul a motor   4,000   Total $11,000 © The McGraw-Hill Companies, Inc., 2008

Probability Distribution of Breakdowns Day Probability of a Breakdown Corresponding Random Numbers 1, 2, 3 4 0.25 0.0000 to 0.2499 5 0.5 0.2500 to 0.7499 6 0.7500 to 0.9999 7 or more © The McGraw-Hill Companies, Inc., 2008

Computer Simulation of Corrective Maintenance Figure 12.4 A spreadsheet model for a computer simulation of performing corrective maintenance on the Heavy Duty Co. motors. © The McGraw-Hill Companies, Inc., 2008

Preventive Maintenance Options Preventive maintenance would involve scheduling the motor to be removed (and replaced) for an overhaul at a certain time, even if a breakdown has not occurred. The goal is to provide maintenance early enough to prevent a breakdown. Scheduling the overhaul enables removing and replacing the motor at a convenient time when the machine is not in use, so no production is lost. Cost of a Replacement Cycle that Begins without a Breakdown Replace a motor on overtime $3,000 Lost production during replacement Overhaul a motor before a breakdown   3,000   Total $6,000 © The McGraw-Hill Companies, Inc., 2008

Replace Motor After 3 Days Cost of a replacement cycle is $6,000. (Replacement always occurs without a breakdown). Replacement cycle occurs every three days. E(Cost per day) = ($6,000) / (3 days) = $2,000 per day. © The McGraw-Hill Companies, Inc., 2008

Replace Motor After 4 Days Figure 12.5 A spreadsheet model for a computer simulation of performing preventitive maintenance (replace after four days) on the Heavy Duty Co. motors. © The McGraw-Hill Companies, Inc., 2008

Replace Motor After 5 Days Figure 12.5 A spreadsheet model for a computer simulation of performing preventitive maintenance (replace after four days) on the Heavy Duty Co. motors. © The McGraw-Hill Companies, Inc., 2008

Herr Cutter’s Barber Shop Herr Cutter is a German barber who runs a one-man barber shop. He opens his shop at 8:00 AM each weekday morning. His customers arrive randomly at an average rate of two customers per hour. He requires an average of 20 minutes for each haircut. As his business has increased, his customers now often wait awhile (sometimes over half-an-hour). His loyal customers are willing to wait, but new customers are much less likely to return if they have to wait. An article in The Barber’s Journal states In a well-run barber shop, loyal customers will tolerate an average wait of 20 minutes, while new customers will tolerate only a 10 minute average wait. (With longer waits, they typically take their business elsewhere in the future.) Question: Should Herr Cutter hire a new associate to share the workload? © The McGraw-Hill Companies, Inc., 2008

Probability Distributions The time required to give a haircut varies between 15 and 25 minutes. His best estimate is that the times between 15 and 25 minutes are equally likely. Estimated distribution of service times: The Uniform distribution over the interval from 15 to 25 minutes. To generate a random observation from the uniform distribution, with values between a and b equally likely, =a + (b–a)*RAND() For a uniform distribution between 15 and 25 minutes, = 15 + 10*RAND() © The McGraw-Hill Companies, Inc., 2008

Probability Distributions The barber shop has random arrivals of customers, averaging two per hour. Estimated distribution of interarrival times: An exponential distribution with a mean of 30 minutes. To generate a random observation from the exponential distribution, = –(mean) * LN(RAND()) For a mean of 30 minutes, = –30*LN(RAND()) © The McGraw-Hill Companies, Inc., 2008

Building Blocks of a Simulation Model A description of the components of the system, including how they are assumed to operate and interrelate. A simulation clock. A definition of the state of the system. A method for randomly generating the (simulated) events that occur over time. A method for changing the state of the system when an event occurs. A procedure for advancing the time on the simulation clock. © The McGraw-Hill Companies, Inc., 2008

Building Blocks for Herr Cutter’s Simulation Model A description of the components of the system, including how they are assumed to operate and interrelate. The components are the customers, the queue, and Herr Cutter as the server. A simulation clock. t = Amount of simulated time that has elapsed so far A definition of the state of the system. N(t) = Number of customers in the barber shop at time t. A method for randomly generating the (simulated) events that occur over time. The interarrival and service times are generated using the inverse transformation method. © The McGraw-Hill Companies, Inc., 2008

Building Blocks for Herr Cutter’s Simulation Model A method for changing the state of the system when an event occurs. Reset N(t) = N(t) + 1 if an arrival occurs at time t Reset N(t) = N(t) – 1 if a service completion occurs at time t A procedure for advancing the time on the simulation clock. The Next-Event Time-Advance Procedure Observe the current time t and randomly generated times of the next occurrence of each event type that can occur (service or arrival in Herr Cutter’s problem). Determine which event will occur next. Advance the time on the simulation clock to the time of this next event. Updated the system by determining its new state as a result of this event and by randomly generating the time until the next occurrence of any event type that can occur from this new state (if not previously generated). Also record desired information about the performance of the system. Then return to the first step. © The McGraw-Hill Companies, Inc., 2008

A Computer Simulation of Herr Cutter’s Barber Shop Figure 12.7 A computer simulation of Herr Cutter’s barber shop (as currently operated) over a period of 100 customer arrivals. © The McGraw-Hill Companies, Inc., 2008

Evolution of Number of Customers Over First 100 Minutes Figure 12.8 This graph shows the evolution of the number of customers in Herr Cutter’s barber shop over the first 100 minutes of the computer simulation in Figure 12.7. (Note: This graph matches the data from Figure 12.13 in the text, but NOT in the previous slide. Every simulation gives different results.) © The McGraw-Hill Companies, Inc., 2008

Simulating the Barber Shop with an Associate The only difference occurs when the next-event time-advance procedure is determining which event occurs next. Instead of just two possibilities, there are now three: A departure because Herr Cutter completes a haircut. A departure because the associate completes a haircut. An arrival. © The McGraw-Hill Companies, Inc., 2008

Analysis of the Case Study: Financial Factors Revenue = $15 per haircut Average tip = $2 per haircut Cost of maintaining the shop = $50 per working day Salary of an associate = $120 per working day Commission for an associate = $5 per haircut given by the associate. In addition to his salary and commission, the associate would keep his own tips. Otherwise, the revenue would go to Herr Cutter. The shop is open from 8:00 AM to 5:00 PM, so it admits customers for nine hours. © The McGraw-Hill Companies, Inc., 2008

Analysis of Continuing without an Associate The current distribution of interarrival times has a mean of 30 minutes. Therefore, he averages 18 customers per working day. After subtracting the cost of maintaining the shop, his average net income per working day is Net daily income = ($15 + $2) (18 customers) – $50 = $306 – $50 = $256 © The McGraw-Hill Companies, Inc., 2008

Features of the Queueing Simulator Can run computer simulations of various kinds of basic queueing systems. Can have any number of servers up to a maximum of 25. Can use any of the following probability distributions for either interarrival times or service times: Constant time (also called the degenerate distribution). Exponential distribution. Translated exponential distribution (the sum of a constant time and a time from an exponential distribution). Uniform distribution. Erlang distribution. Provides estimates of various key measures of performance: L = Expected number of customers in the system, including those being served. Lq = Expected number of customers in the queue. W = Expected waiting time in the system (includes service time) for a customer. Wq = Expected waiting time in the queue (excluding service time) for a customer. Pn = Probability of exactly n customers in the system (for n = 1, 2, … , 10). © The McGraw-Hill Companies, Inc., 2008

Queueing Simulator for Herr Cutter (Without Associate) Figure 12.9 The output obtained by using the Queueing Simulator in one of this chapter’s Excel files to perform a computer simulation of Herr Cutter’s barber shop (without an associate) over a period of 100,000 customer arrivals. © The McGraw-Hill Companies, Inc., 2008

Testing the Validity of the Simulation Model Figure 12.10 This Excel template for the M/G/1 model shows the basic measures of performance for Herr Cutter’s barber shop without an associate. © The McGraw-Hill Companies, Inc., 2008

Analysis of the Option of Adding an Associate Adding an associate would reduce the average waiting time before a haircut begins to less than 10 minutes. gradually attract new business until this average waiting time reaches 10 minutes. Queueing Simulator Results: Mean of Interarrival Times Point Estimate of Wq 95 Percent Confidence Interval for Wq 20 minutes 3.33 minutes 3.05 to 3.61 minutes 15 minutes 8.10 minutes 6.98 to 9.22 minutes 14 minutes 10.80 minutes 9.51 to 12.08 minutes 14.2 minutes 9.83 minutes 8.83 to 10.84 minutes 14.3 minutes 9.91 minutes 8.76 to 11.05 minutes Table 12.2 The estimates of Wq obtained by using the queueing simulator to simulate Herr Cutter’s barber shop with an associate for 10,000 arrivals for different means of the distribution of interarrival times. © The McGraw-Hill Companies, Inc., 2008

Queueing Simulator for Herr Cutter (With an Associate) Figure 12.11 The results obtained by using the Queueing Simulator to perform a computer simulation of Herr Cutter’s barber shop with an associate over a period of 100,000 customer arrivals. © The McGraw-Hill Companies, Inc., 2008

Analysis of the Option of Adding an Associate Herr Cutter believes 14.3 minutes provides an adequate and conservative estimate of the mean interarrival rate with an associate. This corresponds to a mean arrival rate of 37.8 customers per day. Net daily income = 37.8 ($15) (shop revenue) + 18.9 ($2) (his tips) – $50 (shop maintenance) – $120 (associate’s salary) – $18.9 ($5) (associate’s commission) Total $340.30 This compares to Herr Cutter’s current net daily income of $256. © The McGraw-Hill Companies, Inc., 2008

Outline of a Major Computer Simulation Study Step 1: Formulate the Problem and Plan the Study What is the problem that management wants studied? What are the overall objectives for the study? What specific issues should be addressed? What kinds of alternative system configurations should be considered? What measures of performance of the system are of interest to management? What are the time constraints for performing the study? Step 2: Collect the Data and Formulate the Simulation Model The probability distributions of the relevant quantities are needed. Generally it will only be possible to estimate these distributions. A simulation model often is formulated in terms of a flow diagram. Step 3: Check the Accuracy of the Simulation Model Walk through the conceptual model before an audience of all the key people. © The McGraw-Hill Companies, Inc., 2008

Outline of a Major Computer Simulation Study Step 4: Select the Software and Construct a Computer Program Classes of software Spreadsheet software (e.g., Excel, Crystal Ball) A general purpose programming language (e.g., C, FORTRAN, Pascal, etc.) A general purpose simulation language (e.g., GPSS, SIMSCRIPT, SLAM, SIMAN) Applications-oriented simulators Step 5: Test the Validity of the Simulation Model If the real system is currently in operation, performance data should be compared with the corresponding output generated by the simulation model. Conduct a field test to collect data to compare to the simulation model. Have knowledgeable personnel check how the simulation results change as the configuration of the simulated system is changed. Watch animations of simulation runs. © The McGraw-Hill Companies, Inc., 2008

Outline of a Major Computer Simulation Study Step 6: Plan the Simulations to Be Performed Determine length of simulation runs. Keep in mind that the simulation runs do no produce exact values. Each simulation run can be viewed as a statistical experiment that is generating statistical observations of the performance of the system. Step 7: Conduct the Simulation Runs and Analyze the Results Obtain point estimates and confidence intervals to indicate the range of likely values for the measures. Step 8: Present Recommendations to Management © The McGraw-Hill Companies, Inc., 2008