Download presentation
Presentation is loading. Please wait.
1
Ch. 1 Basic Simulation Modeling
2
Basic Simulation Modeling
The nature of simulation Systems, Models and Simulation Discrete-Event Simulation Simulation of a single-server queuing system Steps in a sound simulation study Advantages, disadvantages and pitfalls of simulation
3
The Nature of Simulation
Conceptions Application areas Academic level Impediments
4
Conceptions Simulation course is about techniques for using computers to imitate or simulate the operations of various kinds of real world facilities or processes System: the facility or process of interest Model: a set of assumptions about how the system works, which usually take the form of mathematical or logical relationships, constitute a model that is used to try to gain more understanding of how the corresponding system behaves. Analytic soulution: to obtain exact information on questions of intresets. Simulation: use a computer to evaluate a model numerically, and data are gathered in order to estimate the desired true characteristics of the model.
5
Example a manufacturing company contemplates building a large extension onto one of its plants, but is not sure if the potential gain in productivity would justify the construction cost.
6
Application areas Designing and analyzing manufacturing systems
evaluating military weapons systems or their logistics requirements determining hardware requirements or protocols for communication networks Determining hardware and software requirements for a computer system Designing and operating transportation systems such as airports, freeways, ports and subways Evaluating designs for service organizations such as call centers, fast-food restaurants, hospitals, and post offices Reengineering of business processes Determining ordering polices for an inventory system Analyzing financial or economic systems
7
Academic level Winter Simulation Conference ( people every year) Is one of the three important operations-research techniques (in serveys related to the use of operations research techniques: math programming, statistics, simulation) The second only to “math programming” among 13 techniques considered (in 1294 papers from the journal Interfaces from 1970 through 1992)
8
Impediments Models used to study large-scale systems tend to be very complex, and writing computer programs to execute them can be an arduous task indeed. (excellent software products) Large amount of computer time is sometimes required. (cheaper and faster computer) An unfortunate impression that simulation is just an exercise in computer programming, albeit a complicated one. (attitude, simulation methodology)
9
Systems, Models and Simulation
System is defined to be a collection of entities, e.g., people or machines, which act and interact together toward the accomplishment of some logical end. System depends on the objectives of a particular study. State of a system: collection of variables necessary to describe a system at a particular time, relative to the objectives of a study. (the number of busy tellers, the number of customers in the bank, the time of arrival of each customer in the bank) discrete system: the state variables change instantaneously at separated points in time. (a bank, e.g., the number of customers in the bank) continuous system: the state variables change continuously with respect to time. (an airplane moving through the air, e.g., position and velocity )
10
Continue... Study on a system: try to gain some insight into the relationships among various components, or to predict performance under some new conditions being considered. Ways to study a system
11
System Experiment with a model of the system Experiment with the actual system Physical model Mathematical model Analytical solution Simulation
12
Example One study on a bank to determine the number of tellers needed to provide adequate service for customers who want just to cash a check or make a savings deposite, the system can be defined to be that portion of the bank consisting of the tellers and the customers waiting in line or being served. If the loan officer and the safety deposite boxes are to be included, the definition of the system must be expanded in an obvious way.
13
Discrete Event Simulation
Definition Time-Advance Mechanisms Components and Organization of a Discrete -Event Simulation Model Components Logic Organization
14
Definitions Discrete-event simulation concerns the modeling of a system as it evolves over time by a representation in which the state variables change instantaneously at separate points in time. Or the system can change at only a countable number of points in time. Event is defined as an instantaneous occurrence that may change the state of the system.
15
Example 1.1 Single-server queuing system: a barbershop, to estimate the (expected) average delay in queue (line) of arriving customers State variables: the status of the server (busy or idle), the number of customers waiting in queue to be served, the time of arrival of each person waiting in queue. Events: the arrival of a customer and the completion of service for a customer, which results in the customer’s departure.
16
Time-Advance Mechanism
Simulation clock: the variable in a simulation model that gives the current value of simulated time. to keep track of the current value of simulated time as the simulation proceeds to advance simulated time from one value to another Advancing the simulation clock next-event time advance (mostly used) fixed-increment time advance (a special case of the first) Next-event time-advance approach simulation clock is initialized to zero the times of occurrence of future events are determined.
17
Example 1.2 Notations: : time of arrival of the ith customer ()
: interarrival time between (i-1)st and ith arrivals of customers : time that server actually spends serving ith customer (exclusive of customer’s delay in queue) : delay in queue of ith customer : time that ith customer completes service and departs : time of occurrence of ith event of any type (ith value the simulation clock takes on, excluding the value )
18
e0 e1 e2 e3 e4 e5 Time t1 t2 c1 t3 c2 A1 A2 A3 S1 S2
19
Components and Organization of a Discrete -Event Simulation Model
Systems state: The collection of state variables necessary to describe the system at a particular time Simulation clock: A variable giving the current value of simulated time Event list: A list containing the next time when each type of event will occur Statistical counters: Variables used for storing statistical information about system performance
20
Continue... Initialization routine: A subprogram to initialize the simulation model at time 0 Timing routine: A subprogram that determines the next event from the event list and then advances the simulation clock to the time when that event is to occur Event routine: A subprogram that updates the system state when a particular type of event occurs (there is one event routine for each event type) Library routines: A set of subprograms used to generate random observations from probability distributions that were determined as part of the simulation model
21
Continue... Report generator: A subprogram that computes estimates (from the statistical counters) of the desired measures of performance and produces a report when the simulation ends Main program: A subprogram that invokes the timing routine to determine the next event and then transfers control to the corresponding event routine to update the system state appropriately. The main program may also check for termination and invoke the report generator when the simulation is over.
22
Start Initialization routine Main program Time routine 1. Set simulation clock=0 2. Initialize system state and statistical counters 3. Initialize event list 0. Invoke the initialization routine 1. Invoke the timing routine 2. Invoke event routine 1. Determine the next event type, say, i 2. Advance the simulation clock 1 Repeatedly i 2 Event routine i Library routines 1.Update system state 2.Update statistical counters 3.Generate future events and add to event list Generate random variates Is simulation over? No Report generator Yes 1. Compute estimates of interest 2. Write report Stop
23
Simulation of A Single-Server Queueing System
24
Components of a queueing system
Arrival process: Interarrivals: Ai Mean interarrival time: E(A) Arrival rate: Service mechanism Service time: Si Number of servers: s Mean service time: E(S) Service rate: Queue discipline FIFO LIFO Priority * D. Gross, and C.M. Harris, Fundamentals of Queueing Theory, 3d ed., John Wiley, New York, 1998
25
Notation for queueing systems
s servers in parallel and one FIFO queue feeding all servers A1, A2, are IID random variables S1, S2,…are IID random variables The Ai’s and Si’s are independent 1 2 s FIGURE 1.71 A GI/G/s queue
26
GI/G/s queue GI (general independent): the distribution of the Ai’s
G (general): the distribution of the Si’s Symbols: M (exponential), Ek (k-Erlang), D (deterministic times) M/M/1: a single-server queueing system with exponential interarrival and service times and a FIFO discipline : the utilization factor of the queueing system
27
A departure customer Server Customer in service Customers in queue An arrival customer FIGURE 1.4 A single-server queueing system.
28
Measures of Performance for Queueing Systems
: delay in queue of ith customer : waiting time in system of ith customer : number of customers in queue at time t : number of customers in system at time t [Q(t) plus number of customers being served at time t] : steady-state average delay : steady-state average waiting time : steady-state time-average number in queue : steady-state time-average number in system
29
e1, e2, …, e13 : 13 successive events
n=6 : delays in queue Interarrival times: A1=0.4, A2=1.2, A3=0.5, A4=1.7, A5=0.2, A6=1.6, A7=0.2, A8=1.4, A9=1.9, … Service times: S1=2.0, S2=0.7, S3=0.2, S4=1.1, S5=3.7, S6=0.6, …
30
Measures of Performance for the example
: delay in queue of ith customer : the expected proportion of the time that Q(t) is equal to i : number of customers in queue at time t The expected average delay in queue The expected average number of customers in queue
31
Q(t) 3 2 1 1 2 3 4 5 6 7 8 9 t Arrivals Departures FIGURE 1.5
e1=0.4 e2=1.6 e8=4.0 e11=5.8 Arrivals e10=5.6 e12=7.2 e3=2.1 e7=3.8 e6=3.3 Departures e13=8.6=T(6) e4=2.4 e5=3.1 e9=4.9 FIGURE 1.5 Q(t), arrival times, and departure times for a realization of a single-server queueing system.
32
Measures of Performance for the example
The expected utilization of the server
33
B(t) 1 1 2 3 4 5 6 7 8 9 t Arrivals Departures FIGURE 1.6
e1=0.4 e2=1.6 e8=4.0 e11=5.8 Arrivals e10=5.6 e12=7.2 e3=2.1 e7=3.8 e6=3.3 Departures e13=8.6=T(6) e4=2.4 e5=3.1 e9=4.9 FIGURE 1.6 B(t), arrival times, and departure times for a realization of a single-server queueing system.
34
Intuitive Explanation
35
Initialization time = 0 System state A 0.4 D Clock Event list Time of last event Sever status Number in queue Statistical counters Times of arrival Number delayed Total delay Area under Q(t) Area under B(t) System Computer Representation (a)
36
Arrival time = 0.4 System state A 1.6 0.4 D 2.4 0.4 Clock Event list 1 0.4 Time of last event Sever status Number in queue Statistical counters Times of arrival 1 Number delayed Total delay Area under Q(t) Area under B(t) System Computer Representation (b)
37
Arrival time = 1.6 System state A 2.1 1.6 D 2.4 1.6 0.4 Clock Event list 1 1 1.6 Time of last event Sever status Number in queue Statistical counters 1.6 Times of arrival 1 1.2 Number delayed Total delay Area under Q(t) Area under B(t) System Computer Representation (c)
38
Arrival time = 2.1 System state A 3.8 2.1 D 2.4 1.6 0.4 Clock Event list 1 2 2.1 2.1 Time of last event Sever status Number in queue Statistical counters 1.6 Times of arrival 1 0.5 1.7 2.1 Number delayed Total delay Area under Q(t) Area under B(t) System Computer Representation (d)
39
Departure time = 2.4 System state A 3.8 2.4 D 3.1 2.1 1.6 Clock Event list 1 1 2.4 Time of last event Sever status Number in queue Statistical counters 2.1 Times of arrival 2 0.8 1.1 2.0 Number delayed Total delay Area under Q(t) Area under B(t) System Computer Representation (e)
40
Departure time = 3.1 System state A 3.8 3.1 D 3.3 2.1 Clock Event list 1 3.1 Time of last event Sever status Number in queue Statistical counters Times of arrival 3 1.8 1.8 2.7 Number delayed Total delay Area under Q(t) Area under B(t) System Computer Representation (f)
41
Departure time = 3.3 System state A 3.8 3.3 D Clock Event list 3.3 Time of last event Sever status Number in queue Statistical counters Times of arrival 3 1.8 1.8 2.9 Number delayed Total delay Area under Q(t) Area under B(t) System Computer Representation (g)
42
Arrival time = 3.8 System state A 4.0 3.8 D 4.9 3.8 Clock Event list 1 3.8 Time of last event Sever status Number in queue Statistical counters Times of arrival 4 1.8 1.8 2.9 Number delayed Total delay Area under Q(t) Area under B(t) System Computer Representation (h)
43
Departure time = 4.0 System state A 5.6 4.0 D 4.9 4.0 3.8 Clock Event list 1 1 4.0 Time of last event Sever status Number in queue Statistical counters 4.0 Times of arrival 4 1.8 1.8 3.1 Number delayed Total delay Area under Q(t) Area under B(t) System Computer Representation (i)
44
Departure time = 4.9 System state A 5.6 4.9 D 8.6 4.0 Clock Event list 1 4.9 Time of last event Sever status Number in queue Statistical counters Times of arrival 5 2.7 2.7 4.0 Number delayed Total delay Area under Q(t) Area under B(t) System Computer Representation (j)
45
Arrival time = 5.6 System state A 5.8 5.6 D 8.6 5.6 4.0 Clock Event list 1 1 5.6 Time of last event Sever status Number in queue Statistical counters 5.6 Times of arrival 5 2.7 2.7 4.7 Number delayed Total delay Area under Q(t) Area under B(t) System Computer Representation (k)
46
Arrival time = 5.8 System state A 7.2 5.8 D 8.6 5.6 4.0 Clock Event list 1 2 5.8 5.8 Time of last event Sever status Number in queue Statistical counters 5.6 Times of arrival 5 2.7 2.9 4.9 5.8 Number delayed Total delay Area under Q(t) Area under B(t) System Computer Representation (l)
47
Arrival time = 7.2 System state A 9.1 7.2 D 8.6 5.6 4.0 Clock Event list 1 3 5.8 7.2 7.2 Time of last event Sever status Number in queue Statistical counters 5.6 Times of arrival 5 2.7 5.7 6.3 5.8 Number delayed Total delay Area under Q(t) Area under B(t) 7.2 System Computer Representation (m)
48
Departure time = 8.6 System state A 9.1 8.6 D 9.2 5.8 5.6 Clock Event list 1 2 7.2 8.6 Time of last event Sever status Number in queue Statistical counters 5.8 Times of arrival 6 5.7 9.9 7.7 7.2 Number delayed Total delay Area under Q(t) Area under B(t) System Computer Representation (n)
49
Comments Interaction between the simulation clock and the event list
Process updates of the state variables and statistical counters Contingencies A departing customer could leave behind an empty queue Termination conditions Time ties
50
1.4.3 Program Organization and Logic
Why general-purpose language Model being simulated: M/M/1 queue n=1000 Interarrival and service times Interarrival: exponential distribution (mean=1 min) Service: exponential distribution (mean=0.5 min)
51
Arrival Event Schedule the next arrival event Is the server busy? Yes
FIGURE 1.8 Flowchart for arrival routine, queueing model Schedule the next arrival event Is the server busy? Yes No Add 1 to the number in queue Set delay=0 for this customer and gather statistics Add 1 to the number of customers delayed Is the queue full? Write error message and stop simulation Yes No Make the server busy Store time of arrival of this customer Schedule a departure event for this customer Return
52
customer entering service
Departure Event FIGURE 1.9 Flowchart for arrival routine, queueing model Is the queue empty? Yes No Make the server idle Subtract 1 from the number in queue Eliminate departure event from consideration Compute delay of customer entering service and gather statistics Add 1 to the number of customers delayed Schedule a departure event for this customer Move each customer in queue (if any) up one place Return
53
C Program for Queueing Model (Fig 1.19 – Fig. 1.27)
External definitions Main functions Function initialize Function timing Function arrive Function departure Function report Function update_avg_stats Function expon
54
Simulation Output and Discussion (Fig. 1
Simulation Output and Discussion (Fig Output report, queueing model) Single-server queueing system Mean interarrival time mins Mean service time mins Number of customers Average delay in queue mins Average number in queue Server utilization Time simulation ended mins
55
Alternative Stopping Rules (Fig. 1.33 –Fig. 1.37)
Stop: fixed run time 480 mins External definitions Main functions Function initialize Function report Output report
56
Determining the Events and Variables
Event-graph Arrival Departure FIGURE 1.38 Event graph, queueing model
57
Determining the Events and Variables
Event-graph Arrival Enter service Departure FIGURE 1.39 Event graph, queueing model with separate “enter-service” event
58
Determining the Events and Variables
Event-graph Arrival Departure End simulation FIGURE 1.40 Event graph, queueing model with fixed run length
59
STEPS IN A SOUND SIMULATION STUDY
Formulate the problem and plan the study Problem of interest is stated by manager. One or more kickoff meeting for the study are conducted, with the project manager, the simulation analysts, and subject-matter experts (SMEs) in attendance. The following issues are discussed: Overall objectives of the study Specific questions to be answered by the study Performance measures that will be used to evaluate the effeciency of different system configurations Scope of the model System configurations to be modeled Software to be used Time frame for the study and the required resources
60
STEPS… 2. Collect data and define a model.
Collect information on the system layout and operating procedures. No single person or document is sufficient. Some people may have inaccurate information---make sure that ture SMEs are identified. Operating procedures may not be formalized. Collect data (if possible) to specify model parameters and input probability distributions Delineate the above information and data in an “assumptions document,” which is the conceptual model Collect data (if possible) on the performance of the existing systsem (for validation purpose in Step 6) The level of model detail should depend on the following: Project objectives Performance measures Data availability Credibility concerns Computer constraints Opinions of SMEs Time and money constraints There need not be a one-to-one correspondence between each element of the model and the corresponding element of the system. Interact with the manager (and other key project personnel) on a regular basis
61
STEPS… 3. Is the conceptual model valid?
Perform a structured walk-through of the conceptual model using the assumptions document before an audience of managers, analysts, and SMEs Helps ensure that the model’s assumptions are correct and complete Promotes ownership of the model Take place before programming begins to avoid significant reprogramming later 4. Construct a computer program and verify. Program the model in a programming language or in simulation software. Benefits of using a programming language are that one is often known, they have a low purchase cost, and they may result in a smaller model execution time. The use of simulation software, on the other hand, reduces programming time and results in a lower project cost. Verify (debug) the simulation computer program.
62
STEPS… 5. Make pilot runs. 6. Is the programed model valid?
Make pilot runs for validation purposes in Step 6. 6. Is the programed model valid? If ther is an existing system, then compare model and system (from Step 2) performance measures for existing system Regardless of whether there is an existing system, the simulation analysts and SMEs should review the model results for correctness. Use sensitivity analyses to determine what model factors have a significant impact on performance measures and, thus, have to be modeled carefully. 7. Design experiments. Specify the following for each system configuration of interest: Length of each run Length of the warmup period, if one is appropriate Number of independent simulation runs using different random numbers---facilitates construction of confidence intervals
63
STEPS… 8. Make production runs. 9. Analyze output data.
Production runs are made for use in Step 9. 9. Analyze output data. Two major objectives in analyzing output data are: Determining the absolute performance of certain system configurations Comparing alternative system configurations in a relative sense 10. Document, present, and use results. Document assumptions (see Step 2), computer program, and study’s results for use in the current and future projects. Present study’s results. Use animation to communicate model to managers and other people who are not familiar with all of the model details. Discuss model building and validation process to promote credibility. Results are used in decision-making process if they are both valid and credible.
64
Steps in a simulation study.
Formulate problem and plan the study Collect data and define a model Conceptual model valid? No Yes Construct a computer program and verify Make pilot runs Programmed Model valid? No Yes Design experiments FIGURE 1.68 Steps in a simulation study. Make production runs Analyze output data Document, present, and use results
65
ADVANTAGES OF SIMULATION
Most complex, real-world systems with stochastic elements cannot be accurately described by a mathematical model that can be evaluated analytically. Thus, a simulation is often the only type of investigation possible. Simulation allows one to estimate the performance of an existing system under some projected set of operating conditions. Alternative proposed system designs (or alternative operating policies for a single system) can be compared via simulation to see which best meets a specified requirement. In a simulation we can maintain much better control over experimental conditions than would generally be possible when experimenting with the system itself. Simulation allows us to study a system with a long time frame---e.g., an economic system---in compressed time, or alternatively to study the detailed workings of a system in expanded time.
66
DISADVANTAGES OF SIMULATION
Each run of a stochastic simulation model produces only estimates of a model’s true characteristics for a particular set of input parameters. If a “valid” analytic model is available or can be easily de developed, it will generally be preferable to a simulation model. Simulation models are often expensive and time-consuming to develop. If a model is not a “valid” representation of a system under study, the simulation results, no matter how impressive they appear, will provide little useful information about the actual system. In some studies both simulation and analytic models might be useful. In particular, simulation can be used to check the validity of assumptions needed in an analytic mode. On the other hand, an analytic model can suggest reasonable alternatives to investigate in a simulation study.
67
Pitfalls to the successful completion of a simulation study
Failure to have a well-defined set of objectives at the beginning of the simulation study Inappropriate level of model detail Failure to communicate with management throughout the course of the simulation study Misunderstanding of simulation by management Treating a simulation study as if it were primarily an exercise in computer programming Failure to have people with a knowledge of simulation methodology and statistics on the modeling team Failure to collect good system data Inappropriate simulation software Obliviously using simulation software products whose complex marco statement may not be well documented and may not implement the desired modeling logic
68
Pitfalls to the successful completion of a simulation study
Belief that easy-to-use simulation packages, which require little or no programming, require a significantly lower level of technical competence Misuse of animation Failure to account correctly for sources of randomness in the actual system Using arbitrary distributions (e.g., normal, uniform, or trianglar) as input to the simualation Analyzing the output data from one simulation run (replication) using formulas that assume independence Making a single replication of a particular system design and treating the output statistics as the “true answers” Comparing alternative system design on the basis of one replication for each design Using the wrong performance measures
69
Notes In some studies both simulation and analytic models might be useful. In particular, simulation can be used to check the validity of assumptions needed in an analytic model. On the other hand, an analytic model can suggest reasonable alternatives to investigate in a simulation study.
70
Tarea 1: Simulation of a Single server queueing system
Modify the code for the single-server queue in Chapter 1 to compute and write in addition the following measures of performance: The time-average number in the system The average total time in the system The maximum queue length The maximum delay in quque The maximum time in the system The proportion of customers having a delay in queue in excess of 1 minute Entegar: report on the simulation including simulation model description, design of the experiments, results of above measures after the simulation, conclusion on the simulation, and program code. Fecha limite: 18 de Febrero de 2005
71
Ch. 3 Simulation Software
72
Programming of discrete-event simulation models
Generating random numbers, that is, observations from a U(0,1) probability distribution Generating random variates from a specified probability distribution (e.g., exponential) Advancing simulated time Determining the next event from the event list and passing control to the appropriate block of code Adding records to, or deleting records from, a list Collecting output statistics and reporting the results Detecting error conditions
73
Advantages of Using a Simulation Package
Simulation packages automatically provide most of the features needed to build a simulation model, resulting in a significant decrease in “programming” time and a reduction in overall project cost. They provide a natural framework for simulation modeling. Their basic modeling constructs are more closely akin to simulation than are those in a general-purpose programming language like C. Simulation models are generally easier to modify and maintain when written in a simulation package. They provide better error detection because many potential types of errors are checked for automatically. Since fewer modeling constructs need to be included in a model, the chance of making an error will be probably smaller.
74
Advantages of Using General-Purpose Programming Language
Most modelers already know a programming language, but this is often not the case with a simulation package. A simulation model efficiently written in C or C++ may require less execution time than a model developed in a simulation package. This is so because a simulation package is designed to address a wide variety of systems with one set of modeling constructs, whereas a C program can be more closely tailored to a particular application. This consideration has, however, become less important with the availability of inexpensive, high-speed PCs. Programming languages may allow greater programming flexibility than certain simulation packages. Software cost is generally lower, but total project cost may not be.
75
3.3 Classification of Simulation Software
General-purpose Versus Application-Oriented Simulation Packages Modeling approaches Common Modeling Elements
76
3.3.1 General-purpose Versus Application-Oriented Simulation Packages
Historically, simulation languages application-oriented simulators. Advances: simulation languages: employing graphical model-building approach such as icons, dialog boxes Simulators: allowing programming in certain model locations using an internal pseudo-language. Modify existing modeling constructs Create new constructs Recently, general-purpose simulation packages: Arena, Extend application-oriented simulation packages: Manufacturing, Communications Networks, Process Reengineering and Services, Health Care, Call Centers, Animation (standalone)
77
3.3.2 Modeling Approaches Event-scheduling approach Process approach
Identify characteristic events Write a set of event routines Execute events (no simulated time passes during its execution) Process approach A process is a time-ordered sequence of interrelated events separated by intervals of time, which describes the entire experience of an “entity” as it flows through a “system”.
78
Process Approach x x x Entity arrives Entity begins service
Entity completes service Time x x x Event “Event” Event Possible passage of time in queue Possible of time for serving of entity FIGURE 3.1 Process describing the flow of an entity through a system
79
Process Approach Routine customer Arrival event 1 Schedule an arrival
event for the next customer entity 3 4 Is the server idle ? 2 No Place this customer entity in the queue Wait until selected for service Passage of simulation time Yes 5 Remove this customer entity from the queue 6 Make the server busy Departure event 7 Schedule a departure event for the next customer entity 9 Make the server idle 8 Wait until service is completed 10 Termination of this customer entity Return Passage of simulation time FIGURE 3.2 Prototype customer-process routine for a single-server queueing system.
80
3.3.3 Common Modeling Elements
Type of system Entities Attributes Resources Queues Manufacturing Part Part number, due date Machines, workers Queues or buffers Communications Message Destination, message length Nodes, links Buffers Airport Airplane Flight number, weight Runways, gates Insurance agency Application, claim Name, policy number, amount Agents, clerks
81
3.4 Desirable Software Features
General capabilities (including modeling flexibility and ease of use) Hardware and software considerations Animation Statistical features Customer support and documentation Output reports and plots
82
3.4.1 General capabilities modeling flexibility
Ability to define and change attributes for entities and also global variables, and to use both in decision logic (e.g., if-then-else constructs) Ability to use mathematical expressions and mathematical functions (logarithms, exponentiation, etc.) Ability to create new modeling constructs and to modify existing ones, and to be able to use the new or modified modeling constructs in current and future models
83
3.4.1 General capabilities ease of use
Graphical user interface Modeling constructs (e.g. icons or blocks) that are neither too “primitive” nor too “macro” Tabs in dialog boxes can help manage a large number of options Hierarchy allows a user to combine several basic modeling constructs into a new higher-level construct. (reuse) Debugging aids Follow a single entity through the model to see if it is processed correctly See the state of the model every time a particular event occurs (e.g., a machine breakdown) Set the value of certain attributes or variables to “force” an entity down a logical path that occurs with small probability
84
3.4.1 General capabilities ease of use
Fast model execution speed User-friendly model “front ends” Run-time version Running new or existing scenarios for a model built by an internal or external consultant Sales tool for equipment suppliers or system integrators Training Import data from (and export data to) other applications (e.g., an Excel spreadsheet or a database) Automatically simulate different scenarios that iterate on some model parameter (e.g., the number of machines in a work station for a factory) Combined discrete-continuous simulation External routines Easily initialized in a nonempty and idle state The state of a simulation can be saved at the end of a run Cost From $500 to $50,000 Other costs: maintenance fees, upgrade fees, additional hardware and software, etc.
85
3.4.2 Hardware and Software Requirements
Computer platforms: Windows based PCs, UNIX workstations, Apple computers Required RAM: 128Mb Operating systems: Windows 98, Windows NT, UNIX
86
3.4.3 Animation and Dynamic Graphics
Uses of animation Communicating the essence of a simulation model (or simulation itself) to a manager or to other people who may not be aware of (or care about) the technical details of the model Debugging the simulation program Showing that a simulation model is not valid Suggesting improved operational procedures for a system (some things may not be apparent from looking at just the simulation’s numerical results) Training operational personnel Promoting communication among the project team
87
3.4.3 Animation and Dynamic Graphics
Types of animations Concurrent animation Post-processed Desirable features for animation Default animation Library of standard icons Smooth movement of icons Control to speed up or slow down the animation Zoom and pan, named animation views Vector-based graphics (pictures are drawn with lines, arcs, and fills) rather than pixel-based graphics 3-D animation Import CAD drawings and clip art Dynamic graphics and statistics: clocks, dials, level meters, dynamically update a histograms, time plots, etc.
88
3.4.4 Statistical capabilities
Good random number generator At least 100 different streams that can be assigned to different sources of randomness Same results on different executions Theoretical distributions Continuous: exponential, gamma, Weibull, lognormal, normal, uniform, triangular, beta Discrete: binomial, geometric, negative binomial, Poisson, discrete uniform Empirical distribution Independent replications (or runs) Each runs uses separate sets of different random numbers Each run uses the same initial conditions Each run resets the statistical counters
89
3.4.4 Statistical capabilities
A statistically sound method available for constructing a confidence interval for a mean Warmup period Allow the user to specify what performance measures to collect output data on Optimization
90
3.4.5 Customer Support and Documentation
Public and customized training at the client’s site Good technical support for questions (tel. help) Good documentation User’s guide or reference manual, numerous detailed examples, context-dependent online help, library of mini examples Detailed description of how each modeling construct works Free demo disk Free trail Newsletter, yearly user’s conference Regular updates of the software
91
3.4.6 Output Reports and Graphics
Standard reports for the estimated performance measures Customize reports Histogram Time plot Database Correlation plot Export individual model output observations to other software packages for further analysis and display. (spreadsheets, databases, statistics packages, and graphical packages)
92
3.5 General-purpose Simulation Packages
ARENA, Extend, MODSIM III,
93
3.6 Object-oriented Simulation
Advantages : It promotes code reusability It helps manage complexity It makes model changes easier It facilitates large projects with several programmers. Disadvantages: Some O-O simulation packages may have a steep learning curve. One must do many projects and reuse objects to achieve its full benefits.
94
Ch.4 Review of Basic Probability and Statistics
95
simulation output data
4.1 Introduction Perform statistic analyses of the simulation output data Design the simulation experiments Probability and statistics Model a probabilistic system Generate random samples from the input distribution Choose the input probabilistic distribution Validate the simulation model
96
4.2 Random variables and their properties
Experiment is a process whose outcome is not known with certainty. Sample space (S) is the set of all possible outcome of an experiment. Sample points are the outcomes themselves. Random variable (X, Y, Z) is a function that assigns a real number to each point in the sample space S. Values x, y, z
97
Examples flipping a coin S={H, T} tossing a die S={1,2,…,6}
flipping two coins S={(H,H), (H,T), (T,H), (T,T)} X: the number of heads that occurs rolling a pair of dice S={(1,1), (1,2), …, (6,6)} X: the sum of the two dice
98
Distribution (cumulative) function
: the probability associated with the event Properties: F(x) is nondecreasing [i.e., if ]. .
99
Discrete random variable
A random variable X is said to be discrete if it can take on at most a countable number of values. The probability that X takes on the value Then Probability mass function on I=[a,b]
100
Examples p(x) x p(x) for the demand-size random variable X. 1 2 3 4
1 2 3 4 x p(x) 1/6 1/3 1/2 2/3 5/6 p(x) for the demand-size random variable X.
101
F(x) for the demand-size random variable X.
1 2 3 4 x F(x) 1/6 1/3 1/2 2/3 5/6 F(x) for the demand-size random variable X.
102
Continuous random variables
A random variable is said to be continuous if there exists a nonnegative function f(x) such that for any set of real number B and f(x) is called the probability density function. for all
103
f(x) x Interpretation of the probability density function
104
Uniform random variable on the interval [0,1]
, then
105
x F(x) 1 x f(x) 1 f(x) for a uniform random variable on [0,1] F(x) for a uniform random variable on [0,1] where
106
Exponential random variable
F(x) x f(x) 1 x f(x) for an exponential random variable with mean F(x) for an exponential random variable with mean
107
Joint probability mass function
If X and Y are discrete random variables, then let for all x, y where p(x,y) is called the joint probability mass function of X and Y. X and Y are independent if for all x, y where are the (marginal) probability mass functions of X and Y.
108
Example 4.9 Suppose that X and Y are jointly discrete random variables with Then for x=1,2 for y=2,3,4 Since For all x, y, the random variables X and Y are independent.
109
Joint probability density function
The random variables X and Y are jointly continuous if there exists a nonnegative function f(x,y), such that for all sets of real numbers A and B, X and Y are independent if for all x and y where are the (marginal) probability density functions of X and Y, respectively.
110
Example 4.11 Suppose that X and Y are jointly continuous random variables with Then for for Since X and Y are not independent.
111
Mean or expected value The mean is one measure of central tendency in the sense that it is the center of gravity
112
Examples For the demand-size random variable, the mean is given by For the uniform random variable, the mean is given by
113
Properties of means 1. 2. Even if the ‘s are dependent.
114
Median The median of the random variable is defined to be the
smallest value of x such that x area=0.5 The median for a continuous random variable
115
Example 4.14 1. Consider a discrete random variable X that takes on each of the values, 1, 2, 3, 4, and 5 with probability 0.2. Clearly, the mean And the median of X are 3. 2. Now consider random variable Y that takes on each of the values, 1, 2, 3, 4, and 100 with probability 0.2. The mean and the median of X are 22 and 3, respectively. Note that the median is insensitive to this change in the distribution. The median may be a better measure of central tendency than the mean.
116
Variance For the demand-size random variable,
For the uniform random variable on [0,1],
117
large small Density functions for continuous random variables with large and small variances.
118
Properties of the variance
1. 2. 3. if the ‘s are independent (or uncorrelated).
119
Standard deviation The probability that is between and is 0.95.
120
Covariance The covariance between the random variables and
is a measure of their dependence. if i=j,
121
Example 4.17 For the jointly continuous random variables X and Y in Example 4.11
122
If and are independent random variables
and are uncorrelated. Generally, the converse is not true.
123
Correlated If , then and are said to be positively correlated.
and tend to occur together and tend to occur together If , then and are said to be negatively correlated. and tend to occur together and tend to occur together
124
Correlation If is close to +1, then and are highly positively correlated. If is close to -1, then and are highly negatively correlated. For the random variable in Example 4.11
125
4.3 Simulation output data and stochastic processes
Stochastic process is a collection of "similar" random variables ordered over time, which are all defined on a common sample space. State space is the set of all possible values that these random variables can take on. Discrete-time stochastic process: Continuous-time stochastic process:
126
Example 4.19 M/M/1 queue with IID interarrival times IID service times
FIFO service Define the discrete-time stochastic process of delays in queue and are positively correlated. simulation input random variables output stochastic process The state space: the set of nonnegative real numbers
127
Example 4.20 For the queueing system of Example 4.19,
Let be the number of customers in the queue at time t . Then is a continuous-time stochastic process with state space
128
Covariance-stationary
Assumptions about the stochastic process are necessary to draw inferences in practice. A discrete-time stochastic process is said to be covariance-stationary, if and is independent of i for
129
Covariance-stationary process
For a covariance-stationary process, the mean and variance are stationary over time, and the covariance between two observations and depends only on the separation j and not actual time value i and i+j. We denote the covariance and correlation between and by and respectively, where
130
Example 4.22 Consider the output process for a covariance-stationary M/M/1 queue with
133
Warmup period In general, output processes for queueing systems are positively correlated. If is a stochastic process beginning at time 0 in a simulation, then it is quite likely not to be covariance-stationary. However, for some simulation will be approximately covariance-stationary if k is large enough, where k is the length of the warmup period.
134
4.4 Estimation of means, variance, and correlations
Suppose are IID random variables with finite population mean and finite population variance Unbiased estimators: Sample mean Sample variance
135
How close is to ?
136
How close is to to construct a confidence interval Unbiased estimator
137
Density function for Density function for n large n small Distributions of for small and large n.
138
Estimate the variance of the sample mean .
´s are independent ´s are uncorrelated However, the simulation output data are almost always correlated. are from a covariance-stationary stochastic process, Then, is an unbiased estimator of , however, is no longer an unbiased estimator of Since
139
However, simulation output data are always correlated. Since
(1) For a covariance-stationary process: (2)
140
If one estimates from (correct in the IID case)
there are two errors: the bias in as an estimator of the negligence of the correlation terms in Eq. (2). Solution: combine Eq. (1) and Eq. (2) (3) If , then and
141
Example 4.24 from the process of delays for a covariance-stationary M/M/1 queue with Eq.(1) and (3) Thus, is a gross underestimate of , and we are likely to be overly optimistic about the closeness of to
142
Estimate . In general "good" estimates of the 's will be difficult to obtain unless n is very large and j is small relative to n.
144
4.5.1 Confidence Intervals
145
4.5.1 Confidence Intervals Central Limit Theorem: as , where ,
the distribution function of a normal random variable with and , is given by If n is "sufficiently large", the random variable will be approximately distributed as a standard normal random variable, regardless of the underlying distribution of the 's. For large n, the sample mean is approximately distributed as a normal random variable with mean and variance
146
where ( ) is the upper critical point for
a standard normal random variable.
147
f(x ) Shaded area = a - 1 2 / z x If n is sufficiently large, an approximate percent confidence interval for is given by
148
Interpretation I: If one constructs a very large number of independent percent confidence intervals, each based on n observations, where n is sufficiently large, the proportion of these confidence intervals that contains (cover) should be Interpretation II: If the 's are normal random variables, the random variable has a t distribution with n-1 degree of freedom (df), and an exact (for any ) percent confidence interval for is given by Where is the upper critical point for the t distribution with n-1 df
149
Standard normal distribution
f(x) t distribution with 4df x Figure 4.16 Density function for the t distribution with 4df and for the standard normal distribution.
150
Example 4.26 10 observations: 1.20, 1.50, 1.68, 1.89, 0.95, 1.49, 1.58, 1.55, 0.50, 1.09 are from a normal distribution, To construct a 90% confidence interval for .
151
Table 4.1 Estimated coverages based on 500 experiments
Distribution Skewness v n=5 n=10 n=20 n=40 Normal 0.00 0.910 0.902 0.898 0.900 Exponential 2.00 0.854 0.878 0.870 0.890 Chi Square 2.83 0.810 0.830 0.848 Lognormal 6.18 0.758 0.768 0.842 0.852 Hyperexponential 6.43 0.584 0.586 0.682 0.774
152
4.5.2 Hypothesis tests for the mean
: If is large, is not likely to be true. If is true, the statistic will have a t distribution with n-1 df.
153
Example 4.27 For Example 4.26, To test the null hypothesis that at level We reject
154
4.6 The Strong Law of Large Numbers
Theorem 4.2
155
Example 4.29
156
Tarea II: Teoría de la probabilitad y estatística
A.M. Law and W.D. Kelton, Simulation, Modeling and Analysis, 3rd edition, pp Problems 4.1, 4.2, 4.4, 4.7, 4.9, 4.10, 4.13, 4.20, 4.21, 4.23, 4.24, 4.25, 4.26
157
Chap. 5 Building Valid, Credible, and Appropriately Detailed Simulation Models
158
5.1 Introduction and Definitions (1)
Verification is concerned with determining whether the conceptual simulation model (model assumptions) has been correctly translated into a computer program, i.e., debugging the simulation computer program.
159
5.1 Introduction and Definitions(2)
OJ '. I 5.1 Introduction and Definitions(2) Validation is the process of determining whether a simulation model (as opposed to the computer program) is an accurate representation of the system, for the particular objectives of the study.
160
Validation A valid model can be used to make decisions.
A validation process depends on the complexity of the system and on whether a version of the system currently exists. A model can only be an approximation. A model is valid for one purpose. The measures of performance used to validate the model should include those that the decision maker will actually use for evaluating system design.
161
5.1 Introduction and Definitions(3)
A simulation model and its results have credibility if the manager and other project personnel accept them as "correct“. A credible model is not necessarily valid, and vice versa.
162
Establish credibility
Validation Verification Validation Establish credibility Establish credibility Simulation program “Correct” results available Results used in decision- making process System Conceptual model Analysis and data 1, 2, 3 Programming 4 Make model runs 5,6,7,8,9 Sell results to management 10 Figure 5.1 Timing and relationships of validation, verification, and establishing credibility
163
5.2 Guidelines for Determining the Level of Model Detail (1)
Carefully define the specific issues to be investigated by the study and the measures of performance that will be used for evaluation. The entity moving through the simulation model does not always have to be the same as the entity moving through the corresponding system. Use subject-matter experts (SMEs) and sensitivity analyses. “Moderately detailed“ model. Regular interaction.
164
5.2 Guidelines for Determining the Level of Model Detail (2)
Do not have more detail in the model than is necessary to address the issues of interest, subject to the proviso that the model must have enough detail to be credible. The level of model detail should be consistent with the type of data available. In all simulation studies, time and money constraints are a major factor in determining the amount of model detail. If the number of factors (aspects of interest) for the study is large, then use a "coarse" simulation model or analytic model to identify what factors have a significant impact on system performance.
165
5.3 Verification of Simulation Computer Program
Tech 1: Write and debug the computer program on modules or subprograms. Tech 2: More than one person review the computer program (structured walk through of the program). Tech 3: Run the simulation under a variety of settings of input parameters, and check to see that the output is reasonable. Tech 4: "trace", interactive debugger. Tech 5: The model should be run under simplifying assumptions for which its true characteristics are known or can easily be computed. Tech 6: Observe an animation of the simulation output. Tech 7: Compute the sample mean and variance for each simulation input probability distribution, and compare them with the desired mean and variance. Tech 8: Use a commercial simulation package to reduce the amount of programming required.
166
5.4 Techniques for Increasing Model Validity and Credibility (1)
Collect high-quality information and data on the system Conversation with subject matter experts in MS, machine operators, engineers, maintenance personnel, schedulers, managers, vendors, … Observation of the system Data are not representative of what one really wants to model Data are not of the appropriate type or format Data may contain measurement, recording, or rounding errors Data may be biased because of self interest Data may be inconsistent Existing theory IID exponential random variables Relevant results from similar simulation study Experience and intuition of the modelers
167
5.4 Techniques for Increasing Model Validity and Credibility (2)
Interact with the manager on a regular basis There may not be a clear idea of the problem to be solved at initiation of the study. The manager’s interest and involvement in the study are maintained. The manager’s knowledge of the system contributes to the actual validity of the model The model is credible since the manager understands and accepts the model’s assumptions. Maintain an assumptions document and perform a structured walk-through Validate components of the model by using quantitative techniques. Validate the output from the overall simulation model Animation
168
5.5. Management's Role in the Simulation Process
Formulating problem objectives. Directing personnel to provide informationand data to the simulation modeler and to attend the structured walk-through. Interacting with the simulation modeler on a regular basis. Using the simulation results as an aid in the decision-making process.
169
5.6 Statistical Procedures for Comparing Real-world Observations and Simulation Output Data
Inspection approach. Confidence-interval approach based on independent data. Time-series approach
170
5.6.1 Inspection Approach Statistics: sample mean, sample variance, the sample correlation function, histograms. dangerous! for sample size 1. Correlated inspection approach
171
Table 5.4 Results for three experiments with the inspection approach Experiment 1 0.90 0.70 0.20 2 0.71 -0.01 3 1.08 0.35 0.73
172
Historical system input data Historical system input data Actual system Simulation model System output data Compare Model output data Figure 5.2 The correlated inspection approach
173
Table 5.5 Results for the first 10 of 500 experiments with the correlated and basic Inspection approaches, and a summary for all 500 Experiment j 1 3.06 3.81 2.62 -0.75 0.44 2 2.79 3.37 2.05 -0.58 0.74 3 2.21 2.61 4.56 -0.40 -2.35 4 2.54 3.59 1.86 -1.05 0.68 5 9.27 11.02 2.41 -1.75 6.86 6 3.09 3.75 1.85 -0.66 1.24 7 2.50 2.84 1.13 -0.34 1.37 8 0.31 0.71 3.12 -2.81 9 3.17 3.94 5.09 -0.77 -1.92 10 0.98 1.18 1.25 -0.20 -0.27 Sample mean of all 500 2.10 2.85 2.70 -0.60 Sample variance 2.02 2.28 2.12 0.08 4.08
174
5.6.2 Confidence-Interval Approach based on Independent Data
Condition: it is possible to collect a potentially large amount of data for both the model and the system.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.