Vous êtes sur la page 1sur 124

3

ExtendSim for DESS


ExtendSim
for

Discrete-Event System Simulation


The companion to Discrete-Event System Simulation 5th edition by Banks, Carson, Nelson, and Nicol

David Krahl
Imagine That Inc.

Robin Clark
The Quantitative Modeling & Training Group

ExtendSim 8 Edition
Imagine That Inc. San Jose

Copyright 2010 Imagine That Inc. San Jose, California 95119. All rights reserved. Printed in the United States of America. This publication is protected by copyright. You may not copy, transmit, or translate this publication or any part of this publication in any form or by any means, electronic or mechanical, including photocopying, recording, or information storage and retrieval systems, for any purpose other than your personal use without the express written permission of Imagine That Inc. For information regarding permission, write to the publishers Rights and Permissions Department at the address below.

Trademarks
Imagine That!, the Imagine That logo, ExtendSim, Extend, and ModL are either registered trademarks or trademarks of Imagine That Incorporated in the United States and/or other countries. Mac OS is a registered trademark of Apple Computer, Inc. Microsoft is a registered trademark and Windows is a trademark of Microsoft Corporation. All other names used in this publication are the trademarks of their respective owners.

Multimedia version and license agreement


The ExtendSim software described in this publication is furnished under a separate license agreement that is presented during installation of the software. ExtendSim may be used only in accordance with the terms of that agreement. ExtendSim products and portions of products (including models, icons, dialogs, and block code) are copyright by Imagine That Inc. or its Licensors. All right, title and interest, including, without limitation, all copyrights in the ExtendSim software shall at all times remain the property of Imagine That Inc. or its Licensors.

Published by
Imagine That Inc. 6830 Via Del Oro, Suite 230 San Jose, CA 95119 USA www.ExtendSim.com ISBN: 978-0-9825040-2-4

Contents

Preface How to Use This Book About ExtendSim About the Authors Part I Introduction to Discrete Event System Simulation
1 Introduction to Simulation ............................................................................................3
1.5 Some Recent Applications of Simulation........................................................................................ 3 1.7 Components of a System ................................................................................................................. 4 1.10 Types of Models ............................................................................................................................ 6

2 Simulation Examples [] ..................................................................................................9


2.1 The Basics of [] Simulation ............................................................................................................. 10 2.2 A Coin Tossing Game...................................................................................................................... 16 2.3 Queueing Simulation [].................................................................................................................... 17 2.4 Inventory Simulation [].................................................................................................................... 18 2.5 Other Examples of Simulation......................................................................................................... 20

3 General Principles ..........................................................................................................23


3.1 Concepts in Discrete-Event Simulation........................................................................................... 23 3.2 List Processing................................................................................................................................. 27

4 Simulation Software .......................................................................................................29


4.1 History of Simulation Software ....................................................................................................... 30 4.2 Selection of Simulation Software .................................................................................................... 31

ii

Table of Contents

4.3 An Example Simulation...................................................................................................................31 4.7 Simulation Environments ................................................................................................................33 4.8 Experimentation and Statistical-Analysis Tools ..............................................................................33

Part II Mathematical and Statistical Models


5 Statistical Models in Simulation ....................................................................................39
5.1 Review of Terminology and Concepts.............................................................................................39 5.2 Useful Statistical Models .................................................................................................................40 5.3 Discrete Distributions ......................................................................................................................43 5.4 Continuous Distributions .................................................................................................................43

6 Queueing Models...........................................................................................................45
6.1 Characteristics of Queueing Systems ..............................................................................................45 6.2 Queueing Notation...........................................................................................................................48 6.3 Long-Run Measures of Performance ...............................................................................................48

Part III Random Numbers


7 Random-Number Generation ........................................................................................51
7.3 Techniques for Generating Random Numbers.................................................................................51

8 Random-Variate Generation ..........................................................................................53

Part IV Analysis of Simulation Data


9 Input Modeling..............................................................................................................57 10 Verification, Calibration, and Validation of Models.....................................................59
10.1 Model Verification .........................................................................................................................59 10.2 Model Validation............................................................................................................................60

11 Absolute Performance ..................................................................................................63 12 Relative Performance....................................................................................................65

Part V Appendices
A Getting Started with ExtendSim ....................................................................................69
A.1 Using an Existing Model ................................................................................................................69 A.2 Creating a new model .....................................................................................................................76 A.3 Other resources ...............................................................................................................................83

B Random Distributions...................................................................................................85
B.1 Blocks For Generating Random Numbers ......................................................................................85 B.2 Distributions in ExtendSim .............................................................................................................86

C ACME Steel ...................................................................................................................89


C.1 Details .............................................................................................................................................90 C.2 The Workshop .................................................................................................................................91 C.3 Hints ................................................................................................................................................92

D ITI Healthcare ED ........................................................................................................95


D.1 Process Layout ................................................................................................................................96 D.2 Scope & Model Assumptions .........................................................................................................96 D.3 Assignment .....................................................................................................................................102

Preface

The objective of this book is to complement and supplement the fifth edition of the textbook Discrete-Event System Simulation (Banks, et al.), herein referred to as the DESS text. The two books are designed to be used together in both introductory and project-based simulation courses. Long a standard in introduction to simulation courses for upper-level undergraduates and master-level graduates, the DESS book provides an in-depth discussion of the important aspects of discrete-event simulation. The DESS text, however, is independent of any simulation language or application. And although it uses Excel-based examples to introduce simulation in a familiar environment, simulation is best taught using simulation software. As stated in the DESS book: While Excel is useful for teaching simulation concepts, for demonstrating the effect of statistical variability, and especially for analyzing and presenting results, it has severe limitations as a basis for simulation itself. This companion publication uses the ExtendSim simulation software as a pedagogical tool to explain the principles and concepts discussed in the DESS book. This use of a modern simulation tool makes simulation concepts more easily communicated by instructors and more accessible to students. This is especially useful since students are likely to encounter ExtendSim when they move from academia into corporate or government environments. ExtendSim for Discrete-Event System Simulation adheres to the layout of the 5th edition of the DESS text while providing easy-to-use and informative ExtendSim implementations of DESS examples. It also includes selected solutions to end-of-chapter exercises and an ExtendSim tutorial specifically designed for the DESS book. Together the two books serve as a useful tool when teaching two types of courses: 1. Introductory simulation courses in engineering, computer science, and management 2. A second course in simulation, when outside projects are added to the textbook material

iv

Preface

An additional benefit is that the limited version of the ExtendSim software that accompanies this text remains useful for small simulation projects even after the course has been completed. For more information, see also: How to Use This Book on page v About ExtendSim on page vii Getting Started with ExtendSim on page 69

How to Use This Book

This publication adheres to the layout of the 5th edition of Discrete-Event System Simulation (the DESS text) by Banks, Carson, Nelson, and Nicol. While the DESS text will provide most of the reading material, this publication complements and supplements it, aiding the instructor and student in their use of the DESS chapters.

Phraseology
Before proceeding, it is important that you understand how some words are used in this text: This text and these authors. The phrase this text always means the current book ExtendSim for Discrete-Event System Simulation. Likewise, these authors refers to the authors of this text. The DESS text. The textbook Discrete-Event System Simulation by Banks, et al. is referred to throughout this text as the DESS text. [ ]. The use of square brackets ([ ]) in a title indicates that some text has been omitted from or substituted into the original DESS title. For instance, chapter 2 of the DESS text is titled Simulation Examples in a Spreadsheet. Since this text uses ExtendSim for those examples, the corresponding chapter in this text is titled Simulation Examples []. ExtendSim. As discussed in ExtendSim packages on page viii, there are four ExtendSim products available as a full version. A limited version is also available; it includes all four products and is called ExtendSim LT. Since it is unknown which product is being used, and whether it is a full or a limited version, for purposes of this text the authors just use the word ExtendSim.

vi

How to Use This Book

Extend. Prior to the version 7 release in 2007, ExtendSim was called Extend. Both names can be used in web searches for case studies, references, and so forth, as well as when reviewing publications.

Organizational Structure
As is the DESS text, this book is divided into several parts:
Part I: Introduction to Discrete-Event System Simulation Part II: Mathematical and Statistical Models Part III: Random Numbers Part IV: Analysis of Simulation Data

Recommended Sequence
Unless otherwise noted, these authors suggest that you read each section in this text along with reading the corresponding section in the DESS text. With that in mind, there is some duplication between the texts. Hopefully it is sufficient enough that the reader can get a better grasp of the material without having to endure too much redundancy.

Example Models and Workshops


Several ExtendSim example models are provided for chapters 2, 3, 4, and 6. The concepts discussed throughout the DESS text are further explored through the use of the workshop models in Appendices C and D. Unless you are already familiar with ExtendSim, please read Getting Started with ExtendSim on page 69 or view the Tutorial video (accessed through the DESS QuickStart) before building an ExtendSim model.

Other Resources
In addition to this text and the interface to the DESS files (DESS QuickStart): 1. The ExtendSim 8 Addendum, User Guide, and Developer Reference are useful resources. All ExtendSim products include these manuals as eBooks; they are located in the ExtendSim\Documentation folder. The store at www.ExtendSim.com/store/ also has printed versions of these manuals available for purchase. 2. For Instructors, additional material is located on the ExtendSim Exchange (http:// www.extendsim.com/forums), a forum for ExtendSim modelers. See the DESS Textbook section within the Academic category at the bottom of the main page. You must register to log into the ExtendSim Exchange. Access to the DESS Textbook and Instructor forums is limited to those who are teaching a class and have been pre-approved.

About ExtendSim

ExtendSim is the family name of four simulation software tools used to build continuous, discrete event, discrete rate, and agent-based models as well as perform 3D animations of simulation models. (The four products are described in ExtendSim packages on page viii.) The ExtendSim products are used to develop dynamic models of real-life processes in a wide variety of fields. The process involves creating models from building blocks, exploring the processes involved, analyzing how they relate, then changing assumptions to arrive at a superior solution.

Why use simulation


ExtendSim is an extremely powerful tool for simulating processes. It allows you to simulate any system or process by creating a logical representation in an easy-to-use format. It helps you understand complex systems and produce better results faster. With ExtendSim you can: Predict the course and results of certain actions Gain insight and stimulate creative thinking Visualize your processes logically or in a virtual environment Identify problem areas before implementation Explore the potential effects of modifications Confirm that all variables are known Optimize your operations Evaluate ideas and identify inefficiencies Understand why observed events occur

viii

About ExtendSim

Communicate the integrity and feasibility of your plans

ExtendSim modeling capabilities


With ExtendSim, you get powerful modeling constructs, including: A full set of building blocks that allow you to build models rapidly A customizable graphical interface that depicts the relationships in the modeled system Unlimited hierarchical decomposition making enterprise-wide models easy to understand Dialogs, Notebooks, and an integrated database for changing model values, so you can quickly try out assumptions and interface with your model dynamically 2D and realistic 3D animation of the model for enhanced presentation A full-featured authoring environment for building user-friendly front ends that simplify model interaction and enhance communication The ability to adjust settings dynamically, while the simulation is running An equation editor for creating custom-compiled equations The ability to create new blocks with custom dialogs and icons Complete scalability since model size is limited only by the limits of your system Evolutionary optimization, Monte Carlo, batch-mode, and sensitivity analysis Customizable reports and plotters for presentation and in-depth analysis Activity-based costing capabilities for analyzing cost contributors Full connectivity and interactivity with other programs and platforms

ExtendSim packages
ExtendSim is available in either a full-featured version or as a limited version. 1. There are four full-featured ExtendSim products that used by private enterprises and governmental entities. ExtendSim CP is the base product and each succeeding package adds modules designed for specific markets: ExtendSim CP is used for continuous modeling. ExtendSim OR is for researching operational performance. It adds a discrete-event module and capability to the continuous features found in ExtendSim CP. ExtendSim AT is designed for the modeling and analysis of complex systems. It adds advanced technologies such as scenario management, resource management, and rate-based modeling capabilities to the discrete-event and continuous capabilities of ExtendSim OR. ExtendSim Suite adds the capability to animate a simulation model in 3D; it also has all the features of ExtendSim AT. 2. The ExtendSim LT is a limited version of all four ExtendSim products described above. With its limited model size and low cost, it is appropriate for students doing coursework.

About the Authors

DAVID KRAHL is Vice President of Technical Sales with Imagine That Inc. Over the past 20 years he has been involved with all aspects of the simulation industry including training, consulting, support, development, and technical sales. He has worked extensively with a range of simulation programs including ExtendSim, SLAM II, TESS, Factor, AIM, GPSS, SIMAN, XCELL+ and MAP/1. He has taught the System Simulation course at Golden Gate University and consulted in the areas of manufacturing, communications, health care, and transportation for corporate clients. In addition, he has authored or co-authored numerous papers on simulation modeling, including how to debug models, simulation architecture, education and training, and the ExtendSim modeling environment. Actively involved in the simulation community, he has served as Publicity and Vendor Track Chair for past Winter Simulation Conferences and is working on the Conference Committee for the Simulation Solutions Conference. He received an MS in Project and Systems Management in 1996 from Golden Gate University and a BS in Industrial Engineering in 1986 from the Rochester Institute of Technology. He is a member of the Institute of Industrial Engineers (IIE) and INFORMS. His email address is DaveK@ExtendSim.com. ROBIN CLARK is a co-founder and partner at the Quantitative Modeling & Training Group (QMT) which offers advanced lean and simulation courses as well as coaching services. At QMT he is a simulation instructor, model builder, and block-level developer. As part of his consulting practice he has designed custom components and built numerous simulation models for clients in the areas of health care, pharmaceutical manufacturing, automotive manufacturing, consumer goods manufacturing, and supply chains. Although he has spent considerable time modeling processes, his primary passion is teaching and mentoring students. He has developed several webbased and face-to-face simulation courses including graphical simulation databases, simulation development environments, rate-based modeling, and simulation modeling for health care. In the

About the Authors

last 8 years he has trained over 400 beginner and advanced simulation students to use the ExtendSim simulation software. He has a BS in Physics from Tennessee Technological University and an MS in Management Science from the University of Tennessee. He is a member of the American Society for Training and Development (ASTD), the Society of Manufacturing Engineers (SME), the Institute of Industrial Engineers (IIE), and the Association of Operations Management (APICS). His e-mail addresses is: Clark@QMTGroup.com.

Part I
Introduction to Discrete Event System Simulation

Introduction to Discrete Event System Simulation

1
Introduction to Simulation

The first chapter of the DESS text is an excellent introduction to simulation. As discussed in detail in this chapter there are, however, three sections that deserve additional comments: 1.5 Some Recent Applications of Simulation 1.7 Components of a System 1.10 Types of Models

1.5 Some Recent Applications of Simulation


The DESS text lists examples of the challenges, techniques, and savings from simulation projects in general. Some ExtendSim-specific cases are high-lighted on the ExtendSim website. In addition, some applications where ExtendSim (or Extend, as it was formerly called) was used in a simulation project are found at: The ExtendSim Solutions Showcase, located at http://www.extendsim.com/ sols_success.html. This web page lists some recent applications where ExtendSim was used for simulation modeling by entities such as Boeing, Baosteel, the SPICOSA project of the European Union, the U.S. Department of Energy, and so forth.

4 Components of a System

ExtendSim Case Studies & Papers, located at http://www.extendsim.com/ sols_papers.html. This site lists hundreds of published papers and case studies using Extend or ExtendSim; they are categorized so you can search by key word or by application area.

1.7 Components of a System


This section of the DESS text defines the objects of interest in a system as entities and explains attributes. As discussed below, entities are referred to as items and blocks in ExtendSim. The DESS texts definition of attributes is also expanded.

Entities
Chapter 1 of the DESS text defines an entity as ...an object of interest in a system while Chapter 3 expands upon that definition as ...any object or component in the system that requires explicit representation in the model (e.g., a server, a customer, a machine). In ExtendSim discrete-event models, the entities are referred to as blocks and items. Blocks represent the logic of the model while items are the basic units that are passed between blocks. I In ExtendSim continuous models, blocks still represent model logic; however, no items pass between continuous blocks. Instead, values in the blocks change when time changes. Blocks In ExtendSim, each portion of the process or system that is being modeled is represented by a block. Blocks have names, such as Activity or Queue, that signify the function they perform. A Queue block, for example, will have the same function in every model. Blocks can also be given labels; for instance, a specific Queue block might be labeled Waiting Line. A typical block is composed of the following: An icon that is a pictorial representation of its function, such as the icon of the Queue block shown to the right. Connectors that represent inflows and outflows. Connectors act as an interface with other blocks and are attached to a blocks icon. The Queue block icon at the right has item and value input and output connectors. Dialogs for entering values and settings and for viewing results. A blocks dialog is accessed by double-clicking the blocks icon. The dialog of the Queue block is shown below.

5 Components of a System

The code that determines how the block appears and behaves in the model. (By default block code is not visible to model builders. It is, however, open source and easily accessible by those who wish to program custom blocks.)

Figure 1.1 Queue block dialog Items Items are the things that are passed between blocks in discrete-event models. An item is an individual entity that represents an object or element of the system being modeled. In manufacturing models, items might be parts on an assembly line; in network models, an item would be a packet of information; in business models, items could be invoices or people. Items can only be in one place at a time. They have a life cycle in which they are created, transformed, and eventually destroyed. They change state (physically move, are delayed, or have their properties altered) only when events occur, such as a customer arriving, parts being assembled, and so forth.

Attributes and other properties


The DESS text defines an attribute as a property of an entity... e.g., the priority of a waiting customer, the routing of a job through a job shop. This definition is also generally true for ExtendSim, where blocks and items have properties, such as attributes, associated with them. The only difference is that for ExtendSim an attribute is just one of several types of properties. Items Items have properties pieces of information attached to the item that make the item unique and allow one item to be distinguished from another. The properties include: Attributes are characteristics of an item. Some common uses of attributes are to determine where an item should be routed or to tell how long the item should be processed. Each attribute is composed of a name and a numeric value. The name identifies some general characteristic of the item, such as size or experience level; the numeric value indicates one dimension of the named characteristic. Items can have any number of attributes. A Priority is an item property that signifies the importance of the item. An items priority is particularly useful when you want to examine a population of waiting items and determine the processing order. An item can have only one priority assigned to it. Each item can represent a single entity or a group of duplicates. If the quantity property of an item is 1, it represents a single entity. If the quantity property is greater than 1, the item rep-

6 Types of Models

resents a group of items. An item group will travel and be processed as one item until decomposed into individual items. An item can have only one quantity assigned to it. If 3D animation is used, a 3D ObjectID property is created to reference the 3D object that corresponds to an item. Each item has an item index property that uniquely identifies it. Typically this is only used when programming new blocks or modifying existing blocks. Blocks Each block has a dialog that can be accessed by double-clicking its icon. The attributes of a block are its dialog parameters. For example, an Activity block has a specified activity time and a Queue has a maximum capacity.

Summary
This table summarizes the information about entities and attributes in ExtendSim.

Table 1.1 Entities and Attributes in ExtendSim


Blocks Object Attributes Examples Fixed Dialog values Activity (machine), Queue (waiting line) Items Mobile Properties and attributes Parts, people

1.10 Types of Models


The DESS text discusses discrete, continuous, and mixed discrete/continuous models. Two other types of models, discrete-rate and agent-based, are also commonly encountered in corporate and government environments. I In addition to the following information, the ExtendSim User Guide [Imagine That Inc., 2007] has additional information about the types of models.

Discrete-rate modeling
Processes that are event driven, rather than time driven, do not lend themselves to continuous modeling. Yet systems where there is no thing that can be identified and tracked, or where there are so many things that identification is meaningless, are not well suited to discrete-event modeling. In these situations, discrete-rate modeling is a more natural fit compared to using continuous or discrete-event modeling. ExtendSim discrete-rate models are a unique third type of modeling that combines the ratebased capabilities of continuous models in an event-based environment. While typically running faster than discrete-event models, discrete rate modeling also eliminates the rounding errors caused by mismatches between continuous time steps and discrete events. In this method, accurate answers

7 Types of Models

are more quickly achieved [Damiron, 2008]. This model type is especially useful for simulating any system or process that has flows, rates, events, constraints, storage capacity, and routing. As is true of continuous models, state variables in discrete-rate models depend on rates the level of inventory, the number of riders, and so forth. The primary difference is the event mechanism driving the changes to state variables. In continuous simulations, the state variables change at equal time intervals during a simulation run. These state-change events are externally imposed by the modeler and thus are independent of the system behavior. However, in discrete-rate simulations, as in discrete-event models, the state variables only change at discrete points in time. (For discrete-event the state variables change when events occur; for discrete-rate they change when their associated flow rates change.) These state-change events are internally generated by the model and thus are dependent on the behavior of the system being modeled rather than on a models artificial time step. In an ExtendSim discrete-rate model, quantities of flow (material, product, data, and so forth) are located in one or more parts of the model. During the simulation run, the flow moves from one location to another at a certain speed known as the effective rate.The movement between blocks that hold or route the flow follows paths, rules, and constraints that are set in the model. Behind the scenes, the model is divided into areas where the included blocks are part of a global system. The blocks within each area communicate through an internal linear program (LP) that provides the global oversight for that area. Each block in an LP area contributes a part of the LP equation for the area; the result of the LP calculation is the effective rate for that part of the model. This global oversight of calculations is unique to ExtendSim; it preserves mass balance while resolving contentions when flows are merged or diverged, such as in feedback loops I Discrete-rate modeling is available in the ExtendSim AT and ExtendSim Suite products, as well as the ExtendSim LT version.
.

Table 1.2 Types of Models


Modeling Method Continuous Discrete-Event Discrete-Rate What is Modeled Processes Individual items Flows of stuff Examples Chemical, geological, economic, and biological systems Traffic, equipment, people, work product, data, messages Homogeneous products (powders, fluids, oil, and gas), highspeed or high-volume production and packaging, mining, data feeds and streams

Agent-based modeling
Chapter 4, Section 4.1.7 of the DESS text discusses the future of simulation, including ...a major adoption of agent-based modeling in discrete-event modeling. While agent-based modeling has already been used to simulate collective behavior and social phenomenon, many simulation experts anticipate its increased use in industrial and commercial simulations. The behavior of many systems and processes are known or can be estimated in advance. In some cases, however, that information may not be available. In these situations, agent-based mod-

8 Types of Models

eling is used to obtain that information from the interactions of the agents in a model. Agent-based modeling is independent of continuous, discrete-event, and discrete-rate modeling. Agent-based modeling is concerned with individual entities (called agents) that interact with other agents within their specified locality. Agents may be people, animals, organisms, and so forth. All the agents have a set of rules to follow but they also have a degree of autonomy such that model dynamics cannot be predefined. This is because agents can have intelligence, memory, social interaction, contextual and spatial awareness, and the ability to learn. The object of agent-based modeling is to examine the patterns of behavior that emerge from the interactions of individual agents. In every simulation product the agents used in agent-based modeling must be custom-programmed; in ExtendSim this is accomplished by programming one or more blocks. ExtendSim contains several categories of functions that are helpful when creating agents. For instance: Scripting functions are used for creating, placing, moving, and connecting blocks and then populating them with data Block and inter-block communication functions query the status of a block and get information about block dialog values and data table settings Message sending functions can use the results of inter-block communications to send messages globally to unconnected blocks or to blocks that are connected in specific ways. The standard Boids model of flocking behavior is located at ExtendSim\Examples\3D Animation; it is animated in 3D. Sheep and Wolves is an example of a 2D agent-based model; it is located in the folder ExtendSim\Examples\Agent Based. I Agent-based modeling is available in every ExtendSim product. For more information about agent-based modeling, see the ExtendSim User Guide [Imagine That Inc., 2007].

Figure 1.2 Boids Model

References
Damiron, C., and A. Nastasi [2008], Discrete Rate Simulation Using Linear Programming in Proceedings of the 2008 Winter Simulation Conference, S. J. Mason, R. R. Hill, L. Mnch, O. Rose, T. Jefferson, and J. W. Fowler eds, Miami, FL, Dec. 7-10, pp. 740-749. Piscataway, NJ: IEEE, Inc. Imagine That Inc. [2007], ExtendSim User Guide, Seventh Edition.

2
Simulation Examples []

The DESS text uses Excel-based examples as a convenient and familiar method to introduce simulation concepts. However, the authors of the DESS text acknowledge that Although some types of real-world models, such as those for risk analysis and financial modeling, some reliability problems and others, are amenable to a spreadsheet model, the spreadsheet has severe limitations for most complex real-world dynamic, event-based simulations. Since you are using this companion text it is assumed that you prefer to use a dedicated simulation tool to teach/learn simulation concepts. Notice that ExtendSim can comfortably be used not only for Chapter 2s dynamic models that track events over time but also for its continuous process, Monte Carlo models. As discussed in About ExtendSim on page vii, ExtendSim is actually a family of four products. Each successive product adds some capability to the base product ExtendSim CP which is used for continuous and Monte Carlo modeling. Thus each ExtendSim product also has the capabilities necessary for Monte Carlo models. Although the examples in this chapter use ExtendSim rather than a spreadsheet, they directly correspond to the examples in Chapter 2 of the DESS text. The exercises at the end of this chapter, however, are necessarily specific to ExtendSim. As were the spreadsheet examples of the DESS text, the simulation models shown in this chapter have been designed for the problem at hand, to provide an introduction to some key simulation methodology elements. There are corresponding models located in the folder ExtendSim\Examples\DESS Book.

10 The Basics of [] Simulation

2.1 The Basics of [] Simulation


This section of the DESS text is very useful for understanding what random numbers are and how they are generated.

2.1.1 How to Simulate Randomness


As a supplement to what is discussed in this portion of the DESS text, note the following: ExtendSim has an internal Random Number Generator (RNG) that provides independent streams of pseudo random numbers. It is discussed more in Random-Number Generation on page 51. ExtendSim also provides the ability to specify a seed so that sequences of random numbers can be repeated. See Random number streams on page 51.

2.1.2 The Random Generators Used in the Examples


The DESS text discusses several functions for generating random values in a worksheet cell. In ExtendSim, you would just choose a distribution from a block dialog. For example, the Random Number and Create blocks output random numbers using random distributions that are based on internal ExtendSim functions. Those blocks have over 35 built-in distributions that are accessed by a popup menu in the blocks dialog. After choosing a distribution, enter values in the distribution parameter fields (minimum, mean, and so forth, depending on the distribution) as shown here.

Figure 2.1 Selecting a Distribution in the Create block For a list of ExtendSim blocks that generate random numbers, and a table of the built-in distributions, see Random Distributions on page 85.

2.1.3 How to Use the [Models]


The example models for this supplement text were all created in ExtendSim. Each example has been custom designed so that it is similar to the spreadsheet examples of the DESS text. Because the example models display intermediate results in tables, this often resulted in more blocks in the model than would normally be used. In those cases we have often used hierarchy the ability in ExtendSim to create submodels where multiple blocks are combined into one to hide detail. Another feature of the DESS models is that most use an ExtendSim internal database as a convenient method for managing data. So that you can identify them more easily in the DESS models, hierarchical blocks have a grey shadow behind their icons. This is seen in the Call Arrivals block of Example 2.6. Doubleclicking a hierarchical block reveals the other blocks that have been used to create it.

11 The Basics of [] Simulation

Opening and running an example model The default location for the example models for this chapter is ExtendSim\Examples\DESS Textbook\Chapter2. You can also open the models using the DESS QuickStart file as discussed on page 71. Unless you have used ExtendSim before, see Using an Existing Model on page 69 for a short tutorial on how to open and run a model. Model controls No matter which modeling type (continuous, discrete event, etc.) is used, ExtendSim models are typically composed of blocks that are connected together, with dialogs for entering values and changing settings. Models often have a user interface for controlling the model and viewing results; linking to one or more databases is also common. As with the spreadsheets described in the DESS text, each ExtendSim DESS example model contains information about the model, a means to specify settings and run the simulation, and an automated method for reporting results. The exercise solutions do not have these properties. For the example models, model control and reporting is accomplished through a combination of a button interface and the use of ExtendSim databases to record the inputs, outputs, and pertinent measures of system performance. While not all the models in this text will contain all of the following, the common controls you will see when you open an example model are shown below.

Figure 2.2 Common Controls for DESS Example Models Run Trial. Runs the simulation once. This is equivalent to giving the command Run > Run Simulation or clicking the Run Simulation button in the ExtendSim toolbar. Unless a seed is used, the run uses a new random number sequence each time the button is clicked. Run Experiment. Makes one run of the experiment, executing the number of simulation trials entered in the Number of Trials field, discussed below. Unless a seed is used, the experiment uses a different random number sequence each time the button is clicked. The results of each run are summarized in a data table and displayed in a Histogram. Explain. Contains the definition and specifications of model inputs. Results Table. If the Run Trial button is clicked, records the result of that trial in an ExtendSim database table. If the Run Experiment button is clicked, records the result of each trail in the experiment into an ExtendSim database table. Experiment Results. Displays statistical information about the experiment, such as mean, variance, and so forth.

12 The Basics of [] Simulation

Animation On. Controls whether 2D animation runs while the simulation is running. Running with animation on provides a more visually descriptive representation of what is happening in the model but significantly slows the run. Number of Trials. The number of simulation runs for one Experiment. The Trial Number immediately below this control displays the number of the trial that is currently being executed. (Note that the final Trial Number for the Experiment will be one less than the Number of Trials, since the first trial is always #0.) Set Random Seed To. Allows you to select whether a particular run (Trial or Experiment) uses a fixed or random seed. By default a fixed seed has the arbitrary value of 12,345; to change the seed, enter a different value in the parameter field. A trial is one run of a simulation. For each trial you can choose that it either uses a new sequence of random numbers each time or a fixed seed such that the results are repeatable. An experiment runs a specified number of trials or replications, for example 100 trials. Experiments can also use either a new sequence of random numbers for each experiment or a fixed seed such that each experiment is repeatable. If you give the command Run > Run Simulation, or click the Run Simulation tool in the toolbar, the simulation will run just one time.

The tutorial section Add a user interface (optional) on page 81 will show how to add controls
to your own models. Model structure The ExtendSim models are designed to illustrate the examples of the DESS text. While discrete-event simulation models always step through the events of the simulation, for efficiency, the event times are not recorded. A typical real-world model could have millions of events, so recording every event would not be practical. For the book examples we have added a database table and some extra blocks to record the details of what happens during the simulation run. These extra blocks are contained in hierarchical blocks, reducing the complexity of the top level of the model worksheet.

2.1.4 How to Simulate a Coin Toss


The model Example 2.1: Coin Tossing is a Monte Carlo model. This means that there are no events occurring and the clock times are not being tracked.

13 The Basics of [] Simulation

See Using an Existing Model on page 69 for how to open and run this model.

Figure 2.3 Coin Tossing Model Each time the Run Trial button is clicked the model calculates 10 coin tosses. For each toss: A Random Number block generates a random number between 0 and 1. It does this using the Uniform Real distribution where the minimum is 0 and the maximum is 1. A Decision block compares the random value to 0.5. If it is greater than 0.5, the result is heads; otherwise it is tails. Thus each outcome, heads or tails, has a probability of 0.5 of occurring. The number of heads and tails are accumulated in two Holding Tank blocks, one for heads and one for tails. A Write block writes the toss number, random value, and whether the result was heads or tails to a database table, which is displayed on the model worksheet.

14 The Basics of [] Simulation

2.1.5 How to Simulate a Random Service Time


Example 2.2: Random Service Times is another Monte Carlo model. Its purpose is to show how to generate random samples from an arbitrary discrete distribution, in this case a random service time of a prescribed probability.

Figure 2.4 Random Service Times Model Each time the Run Trial button is clicked: The Random Number block uses an Empirical table to generate just three discrete values of service time. The service times are 3, 6, or 10 minutes and the probabilities of those times occurring are 30%, 45%, and 25%, respectively. A Simulation Variable block provides the record number for the Write block, which writes the random value to a database table. A Histogram is used to plot the distribution of the service times. Notice that the Random Number block automatically indicates if the cumulative probability for the service times does not equal 1. It does this by displaying the error in red in the bottom scrollbar of the Value/Probability table.

15 The Basics of [] Simulation

2.1.6 How to Simulate a Random Arrival Time


Example 2.3: Random Arrival Times is a discrete-event model that simulates the generation of telephone calls that occur, with equal probability, every 1, 2, 3, or 4 minutes.

Figure 2.5 Random Arrival Times Model Each time the Run Trial button is clicked: Calls are generated at random times by the Create block. The block uses a Uniform, Integer distribution with a minimum of 1 minute and a maximum of 4 minutes to specify the time between call arrivals (TBA). The Information block counts the calls and calculates the time between them. Caller number, interarrival time, and arrival times are written to a database table by the Write block. The Exit block disposes of the calls. A Histogram is used to plot the distribution of the interarrival times. Note that the number of calls is limited to 25 by connecting from the Exit block to the Executive blocks Count input.

2.1.7 A Framework for [] Simulation


As is true for spreadsheet simulations, a model developer must define model inputs, system states, the relationships between the system entities, and model outputs. There are some major differences between how that is done in a spreadsheet or manual simulation compared to using simulation software such as ExtendSim. With ExtendSim there is no need for a simulation table. Instead, model structure and system states are defined by the placement and connection of blocks and by the parameters entered

16 A Coin Tossing Game

into block dialogs. (However, in some cases the DESS models have a database table that is somewhat equivalent to a simulation table in that it stores system states.) ExtendSim handles clock times automatically, based on the events that occur in the model and the start time and end time entered in the Run > Simulation Setup dialog. Model responses, which are computed using model outputs, are often automatically calculated by ExtendSim. For instance, in the Random Arrival Times model (Example 2.3), the average time between call arrivals is calculated by the Information block and reported on its Statistics tab.

Figure 2.6 Statistics for Call Arrivals

2.2 A Coin Tossing Game


The model Example 2.4: Coin Tossing is a Monte Carlo model that simulates a coin tossing game. In this game, Charlize tosses a coin for her friends, Harry and Tom, exactly 100 times. Harry wins if the coin lands with heads up; Tom wins if it is tails up. If Harry wins, Tom pays him $1 and vice versa. The object of the simulation is to determine if, for any game of 100 tosses, is it more likely that Harry and Tom are each ahead about half the time, or is it more likely that one of them is ahead most of the time? The random coin toss is created by the Random Number and Decision blocks. Using a Uniform Real distribution, the Random Number block generates a random value between 0 and 1. The Decision block determines if the value is greater than 0.5 (heads); otherwise it is tails. The number of heads and tails are accumulated by Holding Tank blocks. Tom's winnings are calculated by subtracting Tom's total from Harry's total (for Harry, we subtract Tom's total from his). Additional Holding Tank blocks store the number of times that Harry is ahead, Tom is ahead, and the score is even. The statistics are written to a database table by a Write block The Run Experiment button runs 400 trials, for a total of 40,000 tosses.

Figure 2.7 Write Blocks Table Displaying Results of 10 Coin Tosses

17 Queueing Simulation []

2.3 Queueing Simulation []


The following examples describe single-server and two-server queueing systems. Both are dynamic, event-based models.

2.3.1 Waiting Line Models


In this excellent description of queues, waiting lines, and servers, the only other thing to note is that in ExtendSim the customers, telephone calls, and so forth are called items rather than units.

2.3.2 Simulating a Single-Server Queue


Example 2.5: The Grocery Checkout, a Single-Server Queue is the classic discrete-event simulation model something arrives, waits in line, is processed, and leaves the system. In this case, item/customers arrive at the Create, wait in the Queue, are processed in the Activity, and leave the system through the Exit. Most of the blocks in Example 2.5 are hierarchical and encapsulate several additional blocks. In these example models, hierarchical blocks are surrounded by a gray rounded rectangle. Typically there would only be a few blocks in a model of this type and they would not be hierarchical. For this example, extra blocks were used so that the outputs could be calculated and displayed in a manner similar to the DESS text. To see a more typical single-server model, open the MM1 model located at ExtendSim\Examples\Discrete Event\Queueing. Each click of the Run Trial button runs the simulation until 100 customers have departed. Clicking the Run Experiment button runs 50 trials. For both a single trial and an experiment, the average and current wait time statistics for the Queue are summarized on a Histogram. Since random numbers are used during the simulation, your experiment results might look different from the Histogram shown below.

Figure 2.8 Histogram of Single-Server Queue Experiment Note that this histogram does not show individual caller delays but rather the average delay for each of the 50 trials. This model is set to run until 100 customers have checked out. See Example 3.3: Single Channel Queue on page 26 for an example of the same model that runs for just 60 minutes.

2.3.3 Simulating a Queue with Two Servers


Example 2.6: The Able-Baker Call Center Problem has two servers with different service times. The model represents a computer technical support center where two technicians, Able and Baker,

18 Inventory Simulation []

take incoming calls and answer questions. Being more experienced, Able provides service faster than Baker. In this model, calls: Arrive at the Create block Wait at the Queue Are routed to either Able or Baker (Able preferred) through the Select Item Out block Answered by Able or Baker in one of the two Activity blocks Leave through the Exit While the animation provides insight into how the model works, the simulation will run much faster with animation off. One trial is 100 completed calls and one experiment is 400 trials. The objective is to estimate how long callers are put on hold while waiting for service. As was true for Example 2.5 (The Grocery Checkout), this model has additional blocks, within hierarchical top-level blocks, that record detailed simulation information to the database table. Some of the results from one trial is below.

Figure 2.9 Results for One Trial of Example 2.6

2.4 Inventory Simulation []


Inventory management involves a trade-off between carrying a large inventory and making frequent purchases. Each alternative has its associated costs such as carrying costs, loss of volume discounts, loss of good will when customers experience shortages, and so forth. The following examples examine inventory systems and policies.

19 Inventory Simulation []

2.4.1 Simulating the News Dealers Problem


In Example 2.7:The News Dealers Problem, each day is a separate item that moves through the model. Each day could be good, fair, or poor, but the news dealer cannot predict which will occur.

Figure 2.10 News Dealers Inventory Problem Model The day item arrives at the Create block and is assigned a random Newsday attribute by the Random Number and Set blocks. The attribute can be good, fair, or poor. An Equation(I) block calculates the demand, lost gain, scrap, and number sold. A Constant block provides the number of newspapers purchased per day. A second Equation(I) block calculates additional results. A hierarchical block (Calculate Costs) uses these results to determine the total cost for the news dealer. One trial is 20 days; one experiment is 400 trials. Since this model uses items to represent days, and attributes to specify the unique characteristic of each day, it is a discrete-event model. The system could also have been simulated as a continuous model, as is done in Example 2.8.

2.4.2 Simulating an (M,N) Inventory Policy


A classic order-up-to-level (M,N) inventory policy has a maximum inventory level (M) and a fixed review period (N), as well as a random demand and random lead time. Unlike the previous example, Example 2.8: A Refrigerator Inventory Problem has some assumed initial conditions: A beginning inventory of 3 refrigerators An existing order for 8 refrigerators While the normal lead time is from 1 to 3 days, these refrigerators will arrive in 2 days The core of refrigerator inventory model is the Equation block. This calculates the day, cycle, day within cycle, beginning inventory, demand, ending inventory, shortage, pending order quantity, lead time and the days until the order arrives. These results are written to a database table where each record represents a step in the simulation. Inputs to the Equation block are from Constant and

20 Other Examples of Simulation

Random Number blocks specifying the demand, initial inventory, review period, lead time, and maximum inventory.

Figure 2.11 Database Table for (M,N) Inventory Policy Model Clicking the Run Trial button runs the simulation for 25 days; the Run Experiment button runs 100 trials.

2.5 Other Examples of Simulation


This section of the DESS text discusses four non-related, miscellaneous examples.

2.5.1 Simulation of a Reliability Problem


Example 2.9: Replacing Bearings in a Milling Machine is a Monte Carlo simulation that compares two replacement policies: replacing each bearing as it fails or replacing all three bearings if one fails. In the model bearings are represented as items moving between two states, working and failed.

Figure 2.12 Bearing Replacement Policy A fixed number of bearings are introduced in the Resource Item block. The initial operating time attribute is assigned at a Set block. The bearings are delayed in an Activity until they fail. Thus the duration of the activity is the time between failure. Bearings can be preempted from the Activity if the policy is to replace all of the bearings at once. The Repair person is represented by items in a Resource Item block. When a bearing fails, the repair person is released by a Gate block and is delayed by an Activity block (Travel Time). Once the repair person item arrives to the site, it is batched with the failed bearings The delay in the Repair Activity represents the amount of time required to repair; that varies by the number of bearings to repair. When the repair is completed, the bearings and repair

21 Other Examples of Simulation

person items are unbatched from each other. The bearings begin another time between failure and the repair person waits for another bearing failure. Cost statistics are calculated in a hierarchical block.

2.5.2 Simulation of Hitting a Target


Example 2.10: A Bombing Mission is a Monte Carlo model that simulates the operation of a bombing mission. Its purpose is to determine how many bombs can be expected to be on target. The top level of the ammunition depot model is a hierarchical block representing the outline of the targeted depot. A Coordinates Table stores the x and y locations of the depots perimeter. The shape of the hierarchical block is based on these coordinates. When the simulation is run, random x and y error is assigned to the target location. An Equation block calculates whether or not a hit has occurred. The result is animated on the hierarchical block (red dots are hits; green dots are misses) and recorded in a database (Trial Table or Experiment Table). The DB Statistics block calculates the overall statistics for the hits and misses from the information in the database table. Each trial is 10 bombing runs; an experiment is 400 trials. The result of one trial is displayed in the following Trial Table, which indicates 6 hits.

Figure 2.13 Trial Table for Ammunition Depot Model

22 Other Examples of Simulation

2.5.3 Estimating the Distribution of Lead-Time Demand


Example 2.11: Lead-Time Demand is a Monte Carlo model that determines the distribution of lead-time demand. This distribution is used to devise better inventory policies by reducing backorders and lost sales.

Figure 2.14 Frequency of Lead-time Demand The model uses four Random Number blocks to generate random values for the lead time as well as the demand for days 1 through 3. An Equation block uses these values to calculate the lead time demand. The Equation also records the historical results of the simulation in a database table.

2.5.4 Simulating an Activity Network


This activity network has six projects: crack, scramble, and cook eggs; make and butter toast; and fry bacon. The projects are divided between three friends who each deal with one food item (eggs, toast, and bacon). Example 2.12: Project Simulation uses an item that flows from block to block to represent the phases of the project. Initially the item begins in a Resource Item block. We assigned the StartTime attribute in a Set block and then duplicated the project onto its parallel paths using an Unbatch block. The various activities in the project are modeled with Activity blocks, as shown in the screenshot below. The Batch block at the right of the screenshot is used to re-assemble the parallel project items once they have completed all of their activities. An Information block collects statistics on the project item as it is recycled for another project iteration. The ExtendSim database is used to record the project duration for each iteration.

Figure 2.15 Portion of Project Simulation Model

3
General Principles

The preceding two chapters of the DESS text discussed simulation in general and provided some examples, including Monte Carlo, continuous, and discrete-event models. Going forward, the focus will be entirely on discrete-event simulation. As stated in the DESS text, discrete-event simulation ...is the modeling over time of a system all of whose state changes occur at discrete points in timethose points when an event occurs. Chapter 3 of the DESS text explains: The concepts underlying all discrete-event software Event scheduling The modelers world view: event scheduling, process interaction, or activity scanning List processing

3.1 Concepts in Discrete-Event Simulation


Each simulation application has its own set of terms that define the components of a simulation model. For the most part, the definitions given in the DESS text apply to ExtendSim. The few differences are discussed below.

24 Concepts in Discrete-Event Simulation

Entities As mentioned in Entities on page 4, an object in an ExtendSim model is called an item while a component of the system is represented by a block. For instance, a customer/item could arrive at a checkout counter/Activity block, or a part/item could be processed by a machine/Workstation block. Attributes ExtendSim items can have properties, such as attributes and priorities, assigned to them. Attributes and other properties enable an item to be explicitly identified and uniquely identifiable in the model. See also Attributes and other properties on page 5. List In the DESS text a list is also called a set, a queue, or a chain. In an ExtendSim model the list is referred to as a queue of items, which is most often represented by the Queue block. Depending on the sort method chosen in the Queues dialog, items can be ordered as first in, first out; last in, first out; or based on an items priority or attribute value. The Queue Equation block provides even greater flexibility, allowing items to be sorted and released based on a user-defined equation. The Queue blocks provide information about the current number of items in the queue, how many items were left in the queue at the end of the simulation, the duration of their stay, and so forth. Behind the scenes, the ExtendSim simulation mechanism stores information abut items in a set of dynamic arrays and linked lists. This type of list is discussed more inList Processing on page 27. Event notice and event list ExtendSim uses a two-stage event calendaring method the Executive block maintains a list of all events for the model while each block that has a time delay associated with it (for example the Create and Activity blocks) maintains its own, independent next event time. The Executive maintains an event calendar of all the events posted by all the blocks in the model. Each block that has an event associated with it maintains its own list of internal events, posting the earliest event time to the Executive. At the beginning of each simulation event, the Executive locates the next future event and sends a message in sequence to each of the blocks that posted an event for that time. Once a block has completed its event, it posts its next event time to the Executive. Activity-type blocks can have multiple future events ongoing simultaneously one for each item in the block. These blocks maintain their own internal event calendar, posting only the earliest of these events to the Executives event calendar. Note that the next event time is always the lowest of all the event times for all the blocks in the model; this is how a discrete-event simulation works. Activity The DESS text defines an activity as an interarrival time, a service time, or any other processing time. These are somewhat separated in ExtendSim: To represent an interarrival time, the Create block generates items with a specified time between arrivals, or TBA.

25 Concepts in Discrete-Event Simulation

In the ExtendSim activity-type blocks (Activity, Workstation, etc.) the specified duration of the processing or service time is called a delay. This is entered in the blocks Process tab and can be specified by a distribution or a constant, taken from the arriving items attributes, input through a connector, or calculated from a lookup table. Under most conditions, the Create block determines how long until an item arrives while the Activity blocks delay parameter determines how long the item is processed, due only to the blocks settings. However, ExtendSim contains logic constructs to cancel an event processing can be interrupted when an item is preempted or when block processing is shutdown. A preempted item results in a cancelled event; an item affected by a shutdown may or may not result in a cancelled event, depending on whether item processing resumes once the shutdown ends. Delay This is called the wait time in ExtendSim. It is a model output the total duration of time that an item waits due to model conditions. Notice that model conditions include, but are not limited to, the delay time that is specified by the blocks dialog. Other model conditions are not known in advance. The Activity and Queue blocks display their current, average, and maximum wait times in their Results tabs. The word delay is defined differently in the DESS text and in ExtendSim. In the DESS text, the activity is the specified processing or service time and the delay is how long the item actually waits due to model conditions. In ExtendSim, the delay is the specified duration of time and the wait time is the actual result as determined by model conditions.

3.1.1 The Event Scheduling/Time Advance Algorithm


For the most part, the DESS texts discussion of event scheduling corresponds to how ExtendSim maintains its event calendar. The exception is that ExtendSim uses a two-stage event calendaring method, as discussed in Event notice and event list on page 24. Regarding stopping events, and how long a simulation will run, an ExtendSim simulation can be stopped at either: The end time specified in the Run > Simulation Setup > Setup dialog as was done in the examples you have already seen. Some earlier time that is determined by model conditions, which is used in the single-server queue model discussed on page 32.

3.1.2 World Views


This section of the DESS text discusses the three world views that a modeler adopts when developing a model: Event scheduling Process interaction Activity scanning Discrete-event modeling in ExtendSim directly supports the process-interaction world view.

26 Concepts in Discrete-Event Simulation

3.1.3 Manual Simulation Using Event Scheduling


This section is most helpful for understanding how much time and effort even simple models take when they are simulated manually as opposed to using dedicated simulation software. Also note that conducting a manual simulation necessarily requires that the modeler approach the problem from an event-scheduling point of view. As mentioned above, ExtendSim supports the process-interaction world view where the interaction among the steps in a process is handled automatically. Thus the ExtendSim models discussed in this chapter take a different approach than the manual simulations of the DESS text. Opening and running the example models The location for this chapters example models is ExtendSim\Examples\DESS Textbook\Chapter 3. You can also open the models using the DESS QuickStart file as discussed on page 71. Unless you have used ExtendSim before, see Using an Existing Model on page 69 for a short tutorial on how to open and run a model. 1. Example 3.3: Single Channel Queue This model is the same as Example 2.5 except it runs for 60 minutes rather than running until 100 customers have checked out. To make this change to Example 2.5: Delete the connection from the Exit to the Executives Count connector Select Stop simulation at: end time on the Executives Control tab Set End time: 60 in the Run > Simulation Setup > Setup tab Note that in the ExtendSim model the customers are explicitly modeled as items; the server is implicitly modeled by an Activity block labeled Checkout.

Figure 3.1 Single Channel Queue Model 2. Example 3.4: The Checkout-Counter Simulation, Continued Since customers are already explicitly modeled and customer arrival times are already recorded, there are no changes required from Example 3.3. As the DESS text notes, ... in many simulation models, the information desired from the simulation... to some extent dictates the structure of the model. 3. Example 3.5: The Dump Truck Problem This model is a closed system where 6 dump trucks travel in a loop from loading dock to scale to loading dock again.

27 List Processing

Notice that the focus is on the utilization and other statistics of the loading area. Hence the model does not take into consideration the unloading operation.

Figure 3.2 Dump Truck Model

3.2 List Processing


This section of the DESS text discusses how model-specific data is stored and sorted. This is often accomplished through the use of internal data structures such as dynamic arrays and linked lists. The information in the DESS text is detailed but can be summarized as follows: Arrays provide a repository for model-specific data; they can be fixed or dynamic. Dynamic arrays are variable in size and can be assigned a size or resized without changing the data. A linked list allows the construction and manipulation of complex lists of data. Linked lists are queue-like, multiple type (integer, real, and string) structures that maintain internal pointers between the different elements, speeding sorting within the list. ExtendSim uses a mixture of dynamic arrays and linked lists to store information about items and their status in the model. Each item is identified by a unique number the items index which is used to look up the items information. The stored information includes an items attributes, priority, and so forth. All item information is available to every block that needs to access it. In addition to linked lists and dynamic arrays, ExtendSim has an internal relational database feature. ExtendSim database tables can be used as a centralized data repository to store and manage data as well as to display model results. This allows models to be database-driven rather than parameter-driven, which is especially helpful for complex models with large amounts of data. The database can also provide a convenient interface between models and external applications, such as spreadsheets and external databases. Most of the models for this text have database tables; the figure Database Table for (M,N) Inventory Policy Model on page 20 is an example of such a table. For more information about arrays and linked lists, see the ExtendSim Developer Reference [Imagine That Inc. 2009]. For more information about the ExtendSim database feature, see the ExtendSim User Guide [Imagine That Inc. 2007].

References
Imagine That Inc. [2009], ExtendSim Developer Reference, Seventh Edition. Imagine That Inc. [2007], ExtendSim User Guide, Seventh Edition.

28 List Processing

4
Simulation Software

This chapter of the DESS text divides simulation software into three categories: General purpose programming languages, such as C++ and Java Simulation programming languages, such as GPSS/H and SIMAN V Simulation environments that combine a graphical user interface (GUI) with a simulation programming language (SPL). Most modern simulation packages are in this category. ExtendSim is a simulation environment. It integrates a graphical user interface and pre-built components for model building with a simulation language that can optionally be used to create custom components. The simulation environment category can be further divided into: General purpose simulation environments. These packages supply components for generalpurpose discrete event model building. While not oriented to any vertical market, they usually provide the ability to create custom components for a particular field or application area. ExtendSim is an example of a general purpose simulation environment. Specialized simulation applications. The model building environment of these packages is primarily focused on a specific vertical market, such as communication systems or manufacturing processes. ProModel and MedModel are examples of this type of package. Simulators that try to copy a specific experience. These typically do not provide for modelbuilding. Examples include flight and training simulators.

30 History of Simulation Software

Animators that are focused on 3D animation. Animators require the modeler to think in terms of a 3D representation of the system when building the model, including the proper spatial orientation and physical dimensions of the system. When running, an animator always performs the calculations required to maintain the integrity of the 3D presentation, whether or not the animation is visible. While many general purpose and specialized simulation programs have 3D animation capabilities, their models operate properly even if 3D animation is not used.

4.1 History of Simulation Software


As the DESS text itself notes, its brief history of simulation software is far from all-inclusive. These authors feel that the description of The Period of Integrated Environments an over twenty year period ending in 2008 is particularly sparse.

4.1.6 The Period of Integrated Environments (1987-2008)


The DESS text indicated that this period was marked by the growth of SPLs on personal computers and the emergence of simulation environments that combined SPLs with a GUI, animation, and other visualization tools. Some significant developments during this period that the DESS text did not completely explore include: Affordability. The Period of Integrated Environments was marked not only by the growth of SPLs on personal computers and the introduction of GUIs, but by a radical change in the cost of simulation applications. In prior periods simulation software was priced in the tens and hundreds of thousands of dollars. Now powerful simulation applications can be priced comparably to other professional desktop applications. Widespread use. Prior to the advent of simulation environments with GUIs and the lowered price of the software, companies purchased few simulation licenses and model developers tended to be a small and exclusive group. Advancements in simulation software and in the internet during the Period of Integrated Environments greatly broadened simulation softwares user and knowledge base. Open source integrated modeling components. A growing trend in simulation software is to provide accessibility to the source code of the modeling components. Modelers can create new components or modify existing ones using the same tools and environment as the developers of the simulation software. This allows modelers to seamlessly extend the base simulation software with their own components that are customized for a particular application area. It also means the underlying code is open to inspection, promoting a more thorough understanding of how the software works. Interactivity. Prior to this period most simulations were run in batch mode parameters could only be changed before the run began and results were only available at the end. Modern simulation software allows for parameters to be changed and results to be viewed at any point during the run. Hierarchy. ExtendSim introduced hierarchy to the simulation community in 1992. Hierarchy allows the modeler to create, without programming, a new block that is a composite of existing blocks, text, and/or graphics. Essentially, hierarchy encapsulates selected objects

31 Selection of Simulation Software

into one block, nesting layers of submodels, graphics, and text within a model to facilitate re-use and reduce the appearance of complexity. This provides for a more accessible user interface, while maintaining the ability to drill down to see the models underlying details. Most modern simulation packages now include a multi-layer hierarchical capability.

4.1.7 The Future (2009-2011)


In addition to the future developments mentioned in the DESS text (more use of virtual reality, improved user interface, better animation, and a paradigm shift to agent-based modeling in discrete event models), these authors feel the following technologies will also have a future impact: Scripting. Instead of building a model by dragging-and-dropping components, scripting provides for the programmatic creation, population, and running of simulation models. This is especially useful for situations where model data is entered and model results are obtained through data input/output forms over the web. While some integrated simulation environments, such as ExtendSim, already include some aspect of this capability, it has promise for more wide-spread use in the future. Data management using an internal relational database. The integration of an internal data repository with the simulation engine is an essential element for complex models since it provides for the storage, management, and exchange of large amounts of model data. An internal data repository also provides a convenient interface for statistical analysis between models and external applications. Of the eight simulation packages listed in section 4.7, only ExtendSim has an internal relational database capability. Rapid web-based data exchange. As computers get faster and have more storage capability, and with the continual improvement in broadband network data rates, connections between simulation models and external data sources, even across the web, will approach the speed of internal computations.

4.2 Selection of Simulation Software


This is an excellent overview of the process needed, and the questions to ask, when selecting simulation software. In addition, it should be noted that most large organizations do not adopt just one simulation package for use throughout the enterprise. This makes sense because: Each simulation application has its own strengths and weaknesses. For example, some will excel at 3D modeling while others are more scalable for large models. Modelers do not all have the same world view approach to model-building One enterprise will often have many different types of systems to be modeled

4.3 An Example Simulation


Opening and running the example models The default location for these following examples is ExtendSim\Examples\DESS Textbook\Chapter 4. You can also open the models using the DESS QuickStart file as discussed on page 71.

32 An Example Simulation

Unless you have used ExtendSim before, see Using an Existing Model on page 69 for a short
tutorial on how to open and run a model. Example 4.1: The Checkout Counter is an illustration of a typical single-server queue. In ExtendSim this model is constructed using just five blocks. Executive Controls and does event scheduling for discrete event and discrete rate models. Normally this works automatically and the Executive would be just placed in the model somewhere to the left of all other blocks. For this model, the Executive is also used to count the number of customers and stop the simulation once 1,000 customers have been served. This is accomplished by checking an option in the Executive, then connecting from the Exit blocks Total Exited output connector to the Executive blocks Count input connector.

Figure 4.1 Executive Option Where the Count Ends the Simulation Create Creates items randomly or by schedule. For this model, the Create blocks dialog calculates the time between customer arrivals (TBA) based on an Exponential distribution with a mean of 4.5.

Figure 4.2 Dialog of the Create Block Queue Holds item/customers until there is downstream capacity. By default the Queue is a sorted queue and the default sort order is first in, first out. Activity Delays items for the specified amount of time. The model particulars are that the service times are normally distributed with a mean of 3.2 minutes and a standard deviation of 0.6. This is entered in the Process tab of the Activity blocks dialog.

Figure 4.3 Setting Process Time in Activity Block

33 Simulation Environments

Exit Removes item/customers from the simulation and counts them as they leave. A model output (the total number of customers) is used to determine when the simulation run ends, as discussed in Executive on page 32. Other Model Information So that you can easily change model inputs, the mean interarrival time and the mean service time have been cloned (virtually copied) to the model worksheet. (For an explanation of cloning, see Using a cloned parameter field on page 74.) Model results and responses are automatically calculated and displayed on each blocks Results tab. For instance, the Activity block reports the information shown below.
)

Figure 4.4 Results Tab of Activity Block As discussed above, this information can also be cloned to the worksheet. For a complex model, the inputs and outputs can be stored in an ExtendSim database. (As mentioned on page 31, an important simulation development is the ExtendSim centralized data management system.)

4.7 Simulation Environments


Please note that before version 7, ExtendSim was called Extend. The DESS text uses both Extend and ExtendSim to refer to the same product.

4.8 Experimentation and Statistical-Analysis Tools


ExtendSim has a comprehensive set of built-in tools for experimentation and statistical analysis: The ExtendSim Optimizer is an evolutionary optimizer that manipulates the population of solutions so that poor solutions are removed from the list and only good solutions are kept.

34 Experimentation and Statistical-Analysis Tools

The good solutions then evolve toward an optimum solution. Evolutionary optimizers reduce the number of times the simulation must be run before the optimal solution is found. Every ExtendSim product has an Optimizer. The ExtendSim Scenario Manager is used to create a comprehensive design of experiments defining scenarios, making the desired number of runs, and analyzing the results. It is packaged with every ExtendSim AT and ExtendSim Suite product and is described more in Scenario Manager on page 65. In addition to the ability to share data with spreadsheets and other external applications, ExtendSim has an optional internal relational database capability. The integration of an internal data repository with the simulation engine is an essential element for complex models since it provides for the storage, management, and exchange of large amounts of model data before, during, and after model runs. This internal data repository also provides a convenient interface for statistical analysis between models and external applications. For output analysis, ExtendSim has blocks that provide confidence intervals, comparisons of multiple systems, plots, charts, histograms, etc. See the chapters in Part IV for more information.

Exercises
We have provided solutions to a number of the exercises that are at the end of Chapter 4; see ExtendSim\Examples\DESS Textbook\Chapter 4. These models are representative of what can be built by using basic ExtendSim blocks and tools. In some cases, there is additional information in the model about how that particular problem was modeled. Short descriptions of the first five exercises are given here. Exercise 1 For Exercise 4.1: The Checkout Counter, simulation time is specified in minutes and the simulation stops once 1,000 customers have been serviced. To change the model so that it runs for exactly 60 hours: Delete the connection between the Executive and Exit blocks In the Run > Simulation Setup dialog, enter End time: 60 In that same dialog, select Global time units: hours In the dialogs of the Create and Activity blocks, choose Time units: minutes. This keeps the time units for the model at hours while allowing the Create and Activity blocks to output in minutes.

Since the time units for the original model are minutes, a simpler method to represent 60 hours

would be to delete the connection between the Executive and Exit blocks and then just change Run > Simulation Setup dialog to End time: 3600 minutes. But the DESS authors specified hours so we did this model in hours.

Exercise 2 See the model titled Exercise 4.2. This uses a table that stops item/customers from arriving to the Activity once 60 hours has passed. The customers already in the model at time 60 continue processing.

35 Experimentation and Statistical-Analysis Tools

Exercise 4 See the model titled Exercise 4.4. This exercise uses Activity blocks to represent ambulances responding to three types of emergency calls: false alarms, serious, and non-serious. A table in the dialog of each of the Select Item Out blocks determines how many calls are of a particular type. An entry in the Executive and the connection from the Exit block to the Executives Count connector causes the simulation to run until exactly 500 ambulance dispatches have been completed. Exercise 5 See the model titled Exercise 4.5. The Create block in this model assigns an Arrival Time attribute to each item it generates; it does this on its Options tab. To calculate the average time to complete all the calls, they are merged into one stream. The dialog of an Information block is set to calculate the time between item arrivals and display the cycle time statistics, which it reads from the Arrival time attribute. The average cycle time is the mean time that an ambulance takes to complete a call.

36 Experimentation and Statistical-Analysis Tools

Part II
Mathematical and Statistical Models

38

Mathematical and Statistical Models

5
Statistical Models in Simulation

In real life you cannot know exactly when an event is going to occur until it happens. For example, you do not know when the next customer will enter your store. However, by using the correct distribution you can approximate what happens in the real world. A distribution (also known as a probability distribution or a random distribution) is a set of random values that specifies the relative frequency with which an event occurs or is likely to occur. A random number distribution expresses both a probability that something will occur and a range of values that specify the maximum and minimum value of occurrence. Stochastic models use distributions as a handy method for converting data into useful form and inputting it into models. This chapter of the DESS text defines and describes various discrete and continuous distributions and specifically explores the Poisson process and empirical distributions.

5.1 Review of Terminology and Concepts


The DESS text defines the following probability terms: Discrete random variables Continuous random variables Probability density function (PDF)

40 Useful Statistical Models

Probability mass function (PMF) Cumulative distribution function (CDF) Expected value of X (Ex) Mode. In discrete cases, this is the value of the random variable that occurs most frequently. In continuous cases, it is the value at which the PDF is maximized. In ExtendSim, this is referred to as the most likely value. Memoryless property. The exponential is the only continuous distribution that has this property; the geometric is the only discrete distribution that has it.

5.2 Useful Statistical Models


As the DESS text states, Numerous situations arise in the conduct of a simulation where an investigator may choose to introduce probabilistic events. This is accomplished by doing one of the following: Choosing the theoretical distribution that best describes the variability of the raw data Describing the data using a user-defined, or empirical, distribution Fitting the known data to a distribution form, typically using data-fitting software

Distributions
Distributions are used to represent the raw data observed in real-world situations. There are advantages to using statistical distributions rather than raw historical data as inputs to a model: 1. When you gather data for a simulation model, it is seldom in a useful form. 2. By filling in the gaps, distributions help to compensate for information which was missing from or overlooked during data collection. For example, distributions account for extreme or outlying values which may have been missed during typically short data-gathering intervals. 3. Values for input random variables are not limited to what has happened historically. 4. For continuous distributions, an infinite pool of data exists. With historical data, there is seldom enough collected data to support multiple simulation runs. When building simulation models it is usually better to use an approximate distribution than it is to keep a value constant. Characteristics of distributions The functions that produce a distribution have one or more parameter arguments which define and control its characteristics. The most important characteristics are a distributions shape, its spread, and its location or central tendency. Shape is often used to identify distributions; for example, the bell-shaped curve of a normal distribution is widely recognized. Shape can be characterized according to skewness (leaning to one side or another) and kurtosis (whether it is peaked or flat). You specify the characteristics for the selected distribution by the values you enter for these arguments.

41 Useful Statistical Models

Choosing a distribution Using random numbers means either choosing the theoretical distribution that best describes the variability of the raw data, describing the data using a user-defined or empirical distribution, or fitting known data to a distribution. The choice of one distribution over another is not an exact science, but rather is dependent on the type and extent of the data which is gathered, the detail required for the process being modeled, and (in the case where little data is available), informed guesswork. If the data does not fit any of the distributions described below as typical for your process, but fits a distribution which is not typical, we suggest you go with what your data tells you. Table 5.1 Typical Distributions for Specified Systems and Uses
System Queueing Inventory and supply chain Random Variables Interarrival Service Units demanded Time between demands Lead time Reliability and maintainability Limited data Time to failure Typical Distributions Exponential, gamma, Weibull Exponential, gamma, Weibull, lognormal Geometric, Poisson, negative binomial Exponential, gamma, Weibull, constant Gamma Exponential, gamma, Weibull, normal, lognormal Uniform, triangular, beta

See also the description of the ExtendSim distributions starting on page 86.
In ExtendSim
Methods for generating random distributions ExtendSim provides a variety of methods for generating random distributions. These include: 1. The Random Number block that generates a sample from a random distribution. This block is used in conjunction with other blocks to provide a random value to the model. A typical use would be to connect the output of the Random Number block to a Set block to assign a sample from a random distribution to an attribute. The distribution is selected from a popup menu in the Random Number blocks dialog. 2. Random distributions that are specified directly in the dialog of a block. The Activity, Create, Workstation, Select Item In, Select Item Out, and Shutdown blocks all allow the modeler to directly enter random information. The distributions (including an empirical or userdefined distribution), are selected using a popup menu in a blocks dialog. For example, the delay for an Activity block can be specified by selecting a distribution from a popup menu and entering the appropriate parameters for its arguments. When clicked, the Activity

42 Useful Statistical Models

blocks Plot Sample button displays the probability density function (PDF) as sampled from the selected distribution.

Figure 5.1 Distribution Popup in Activity Block 3. Random distributions in an ExtendSim database cell. A numerical database cell can be turned into a distribution by right clicking on the cell and selecting Make random. Each time this cell is accessed, a new random sample will be generated based on the selected distribution. Creating a distribution within a cell of a database is particularly useful when combined with the variety of ways that an ExtendSim database can be used. Database cells can be accessed in equations and custom blocks, read via a Read or Read (I) block, or linked to a dialog parameter (right click and select Link). 4. RandomCalculate function. In equation-based or custom blocks, the RandomCalculate function can be called to generate a random sample. This function will generate all of the random distributions except the empirical. The equation-based blocks are listed on page 54. See the ExtendSim Developer Reference [Imagine That Inc. 2009] for more information. For more information, see the chapters Math and Statistical Distributions or Data Management and Exchange in the ExtendSim User Guide [Imagine That Inc. 2007]. List of distributions in ExtendSim ExtendSim supports 34 parametric distributions as well as an empirical distribution. In addition, the ExtendSim AT and Suite packages include the Stat::Fit data-fitting application from Geer Mountain Software Corporation. The theoretical distributions, as well as the empirical distribution, are listed in the following table. For more detail about these distributions, see the chapter Random Distributions on page 85. Table 5.2 Distributions in ExtendSim
Beta Constant Extreme Value Type 1B Hypergeometric Johnson SU Log-Logistic Pareto Power Function Uniform Real Binomial Erlang Gamma Inverse Gaussian Laplace Lognormal Pearson type V Rayleigh Weibull Cauchy Exponential Geometric Inverse Weibull Logarithmic Negative Binomial Pearson type VI Triangular Chi Squared Extreme Value Type 1A Hyperexponential Johnson SB Logistic Normal Poisson Uniform Integer

For information about distribution fitting, see the chapter on Input Modeling on page 57.

43 Discrete Distributions

5.3 Discrete Distributions


Table 5.3 Typical Discrete Distributions
Bernoulli Geometric Poisson Binomial Negative binomial Empirical

5.4 Continuous Distributions


Table 5.4 Typical Continuous Distributions
Uniform Gamma Normal Triangular Beta Exponential Erlang Weibull Lognormal Empirical

References
Imagine That Inc. [2009], ExtendSim Developer Reference, Seventh Edition. Imagine That Inc. [2007], ExtendSim User Guide, Seventh Edition.

44 Continuous Distributions

6
Queueing Models

Queueing systems are ubiquitous throughout our world: service stations, mass transit systems, checkout counters, production lines, call centers, and so forth. Designing an efficient queueing system involves a trade-off between maximizing server utilization (so companies get the most for their investment) and maximizing customer satisfaction (people, data, and products do not like to wait in long lines). Some of the input parameters in a queueing system include: How frequently entities arrive to the system What their service requirements are and how long it will take to provide that service How many servers are available, what their qualifications are, and what their service rate is

6.1 Characteristics of Queueing Systems


Given that customers and servers are the main elements, the characteristics of a queueing system are: Calling population. The originating population of customers. The calling population may be infinite or finite and has an arrival rate the average number of arrivals to the system, per time unit. (For instance, a constant 0.5 minutes between successive arrivals equates to an arrival rate of 2 per minute.) The effective arrival rate is the number that actually entered the system. The effective arrival rate is less than or equal to the arrival rate, considering that

46 Characteristics of Queueing Systems

some who arrived to the system may have balked or the queues may not longer have space to accommodate them. System capacity. Any limits on the number of customers that can be in the system at one time. Arrival process. For infinite populations the arrival process is random, scheduled, or theoretically infinite (such that the server is never idle). For finite populations the total arrival process is the superposition of the arrival times of all customers. Queue behavior. Customers might balk, renege, or jockey. Queue discipline. Sorting or ordering by FIFO, LIFO, and so forth as discussed in List on page 24. Service times. These can have a constant or random duration. Service mechanism. Examples include parallel, batch, and serial.

In ExtendSim
The ExtendSim Item library has three Queue blocks: 1. Queue. This block acts either as a sorted queue or as a resource pool queue. As a sorted queue, items are stored in FIFO, LIFO, or Priority order, or by attribute value. The choices are made by selecting options in popup menus. As a resource pool queue, items must wait until a required resource is available from a pool. 2. Queue Equation. For more complex sorting methods, use the Queue Equation block. It queues the items and releases them based on a user-defined equation. The equation may contain math and/or programming logic. 3. Queue Matching. Acts as a series of queues where items are sorted into separate bins using the value of a specified attribute. Typically this block is not used as part of a queue/ server combination. Instead, it is used for matching one type of item with another, such as reassembling parts in the correct order or insuring that subassemblies are correctly matched with each other. Simulating multi-server queueing systems There are a number of ways to model servers in ExtendSim: 1. Activities. The Activity and Workstation blocks have a defined capacity that represents the number of available servers. Their Results tabs report the activitys utilization. The number of servers represented by these blocks can be changed dynamically using the capacity (c) connector or by using a Shift block. 2. Resource Pools and Advanced Resources. Resource Pools and Advanced Resources are allocated in a Queue and released in a Resource Pool Release block. These are useful when a server or resource needs to be held over multiple steps, is used in different places in the model, or different servers are required at the same time. 3. Resource Items. These are item-based resources that are stored in a Resource Item block when not in use. Resource Items are batched with the items moving through the model, stay with the item during one or more processing steps, and then are unbatched and returned to

47 Characteristics of Queueing Systems

the Resource Item block. Resource items are useful when the resources need to have their own attributes or if it is necessary to route them through the model in a specific sequence. 4. Gate. The Gate block limits the number of items in a part of the model. Area gating can be used to represent a server that is required over multiple steps. Conditional gating can be used to limit the number of items in a section of the model based on system conditions. Blocking, balking, reneging, and jockeying These concepts are thoroughly discussed in the Queueing chapter of the ExtendSim User Guide [Imagine That Inc. 2007].

Opening and running the example models


The default location for these example models is ExtendSim\Examples\DESS Textbook\Chapter 6. You can also open the models using the DESS QuickStart file as discussed on page 71. Example 6.1 In order to create a simulation model that can run, the following assumptions were added to the description in the DESS text for Example 6.1: The interarrival time for the customers is 3 minutes. There is a 25% probability that customers will choose the self-service option and a 75% chance that they will choose to be helped by a clerk. There are 3 clerks available. The self-service time is a triangular distribution with a minimum of 1 minute, a maximum of 10 minutes, and a most likely of 4 minutes. Clerks require a triangular distribution with a minimum of 0.75 minutes, a maximum of 15 minutes, and a most likely of 3 minutes. The single cashier requires a minimum of 1 minute, a maximum of 4 minutes and a most likely value of 2 minutes to check out each customer. Example 6.2 As in Example 6.1 additional information has been added in order to make a running model. Processing times for the machines are all lognormal with the following parameters: Table 6.1 Processing Times
Machine Candy maker/wrapper Packer Sealer/wrapper Average Process Time (seconds) 1 1.1 54 Standard Deviation (seconds) 0.25 0.30 10

Try changing the processing times to see what happens to the plot of the queue length.

48 Queueing Notation

6.2 Queueing Notation


Using Kendalls notation as mentioned in the DESS text, typical interarrival time (A) and service time (B) distributions are: Exponential or Markov (M) Constant or deterministic (D) Erlang of order k (Ek) Hyperexponential (H) Arbitrary or general (G) General independent (GI) An M/M/1// notation translates as a queueing system with an infinite calling population, an unlimited queue capacity, a single-server, and exponentially distributed interarrival and service times; the notation is typically shortened to M/M/1. For an example, see the MM1 model located at ExtendSim\Examples\Discrete Event\Queueing.

6.3 Long-Run Measures of Performance


The long-run measures of performance for a queueing system are: System. Average number of customers and average time spent. In ExtendSim, the time item/ customers spend in the system is called cycle time. See Exercise 5 on page 35 for an example of how to use attributes to calculate average cycle time. Queue. Average number of customers and average time spent. In ExtendSim, these values are displayed in a Queue blocks Results tab and on its L and W connectors. The average number of customers in a Queue is the average queue length (L) while the average time actually spent in the Queue is the average wait time (W). Server. Utilization is displayed in the Results tab of the Activity block. A utilization rate of 1 indicates the server is busy 100% of the time; idle time is 1 minus the utilization rate. When calculating utilization it is important to consider whether shutdown and blocked conditions contribute to the utilization calculation. In ExtendSim they do contribute since the Activitys capacity is being taken up by these conditions, it is considered busy.

References
Imagine That Inc. [2007], ExtendSim User Guide, Seventh Edition.

Part III
Random Numbers

50

Random Numbers

Preface

7
Random-Number Generation

7.3 Techniques for Generating Random Numbers


ExtendSim has an extensive built-in random number generation capability.

7.3.2 Combined linear congruential generators


The DESS text discusses linear congruential generators (LCGs) extensively. ExtendSim uses a composite or combined multiplicative linear congruential generator which is based on the method described by LEcuyer and Cote [1991]. This random number generator (RNG) has integer sequences generated by two or more linear congruential generators with different moduli.

7.3.3 Random number streams


The random seed feature in ExtendSim is the interface for the RNG.

52 Techniques for Generating Random Numbers

An ExtendSim dialog, located at Run > Simulation Setup > Random Numbers, allows you to set a base random seed for the model. The default value of 0 or blank uses a random seed; any other value is a fixed seed that causes repeatable sequences of pseudo-random numbers.

Preface

Figure 7.1 Random Seed in Simulation Setup Dialog ExtendSim automatically assigns a separate seed to each block in the model that generates random numbers, and each of those blocks will generate its own sequence. The sequence is based on the seed set in the Run > Simulation Setup > Random Numbers dialog, plus an offset that is unique to the block. As with the Random Number dialog, entering any non-zero number as a seed in a block dialog will result in an independent random number stream that will not change across runs.

Figure 7.2 Setting the Seed in a Random Number Blocks Options Tab

See also the chapter Statistical Models in Simulation on page 39 and the list Distributions in
ExtendSim on page 86.

References
Pierre LEcuyer and Serge Cote, Implementing a Random Number Package with Splitting Facilities. ACM Transactions on Mathematical Software, Volume 17, Number 1, page 98-111, March 1991

8
Random-Variate Generation

While you could certainly calculate a distribution using the algorithms described in the DESS text, it is far easier to use the functions ExtendSim provides. The ExtendSim application has built-in functions that can be used to internally calculate random distributions. For instance, the RandomCalculate function (Imagine That Inc. [2009]) can calculate all of the distributions that are listed in the table that starts on page 86, except for the empirical distribution. And the most common distributions, such as the exponential, have their own separate functions. The distribution functions can be used both to generate random inputs and to gather statistical information from the results of simulations. They are available whenever you create or modify a block or use an equation-based block. The equation-based blocks are listed in the table below.

54

Table 8.1 Equation-Based Blocks in ExtendSim


Block Name Buttons Equation Equation(I) Queue Equation Query Equation Library Utilities Value Item Item Use Creates a push-button interface for a model. A user-defined equation is executed whenever the button is pushed. Outputs the results of the equations entered in its dialog. The equations can have any number of inputs and outputs. Calculates equations when an item passes through Queues items and releases them based on the results of userentered equations

Value (AT & Suite) A user-defined equation selects one record from an ExtendSim database table When an item arrives, a user-defined equation selects one record from an ExtendSim database table

Query Equation(I) Item (AT & Suite)

As an alternative to using an equation-based block or programming in ExtendSim, the Random Number block (Value library) can be used as a source for random values. It is discussed in Methods for generating random distributions on page 41.

References
Imagine That Inc. [2009], ExtendSim Developer Reference, Seventh Edition.

Part IV
Analysis of Simulation Data

56

Analysis of Simulation Data

9
Input Modeling

Distribution Fitting
In simulation models, it is often useful to characterize a random input (for example, inter-arrival times and demand rates) using a probability distribution. Typically, this involves obtaining historical data that documents the systems behavior, then analyzing the data to determine an appropriate distribution to represent it. Distribution fitting software helps determine which distributions, if any, offer a good fit for the underlying data. ExtendSim supports three packages for distribution fitting: 1. Stat::Fit from Geer Mountain Software 2. ExpertFit from Averill Law and Associates 3. JMP from SAS Institute These packages are accessed through the Distribution Fitting tab of the Random Number block (Value library).

Stat::Fit
ExtendSim has an interface that allows you to easily access Stat::Fit. The ExtendSim User Guide [Imagine That Inc. 2007] has a tutorial showing how to use Stat::Fit for distribution fitting.

58

Stat::Fit is a Windows application included with the ExtendSim AT and ExtendSim Suite products. It can be purchased separately for use with other ExtendSim products.

Expert Fit
ExpertFit is another package that will fit a theoretical distribution to historical data. Information is included with ExpertFit on how to specify distributions calculated by ExpertFit in ExtendSim.

References
Imagine That Inc. [2007], ExtendSim User Guide, Seventh Edition.

10
Verification, Calibration, and Validation of Models

10.1 Model Verification


The process of debugging a model to ensure that every portion operates as expected is called model verification. One way to do this is to build the model in stages and with minimal detail, then run it at each stage to observe the results. A common verification technique could be termed reductio-adabsurdum (reducing to the absurd), which means reducing a complex model to an aggressively simple case so that you can easily predict what the outcome will be. Some examples of reducing to the absurd are: Remove all variability from the model, making it deterministic Run the deterministic model twice to make sure you get the same results Output detailed reports or traces to see if the results meet your expectations Run a schedule of only one product line as opposed to several Reduce the number of workers to 1 or 0 to see what happens Uncouple parts of the model that interact to see how they run on their own Run very few or very many items through the model to determine if the model responds properly.

60 Model Validation

Other methods for verifying models include making sure that you can account for all the items in a model, animating the model or portions of the model, or using diagnostic blocks from an ExtendSim library, as shown in Tools for Verification and Validation on page 60.

10.2 Model Validation


Once the model is verified as performing as expected, you need to validate it to determine that it accurately represents the real system. Notice that this does not mean that the model should conform to the real system in every respect. Instead, a valid model is a reasonably accurate representation based on the models intended purpose. When validating, it is important to make sure that you know what to compare to and that you verify that measures are calculated in the same manner. For validation, your model should accurately represent the data that was gathered and the assumptions that were made regarding how the system operates. In addition, the underlying structure of the model should correspond to the actual system and the output statistics should appear reasonable. While you would normally compare critical performance measures, it is also sometimes helpful to compare nonessential results that may be symptomatic and therefore show the character of the system. One of the best validation measures is Does the model make sense? Other methods involve obtaining approval of the results by those familiar with the actual process and comparing simulation results with historical data. For example, when validating model performance compared to historical data, try to simulate the past. If you have sufficient historical data, break the actual system performance into various windows of time, where all of the input conditions correspond to the input conditions for multiple runs of your model. Some tools to use for model validation are listed below.

Tools for Verification and Validation


ExtendSim includes a variety of tools that provide insight into the behavior of a model: 1. Animation. This is probably the simplest tool to use. It is an easy method of proving face validity of the model. The modeler can see the items move through the blocks and verify that the model is behaving as designed. However animation, in general, does not provide a numerical proof of the accuracy of the model. It should be viewed as a first pass validation and verification technique. 2. Trace files. ExtendSim can generate a detailed trace of the actions of each block in the model as the simulation progresses. The inputs and results and timing of each item movement are recorded in the trace. While wading through the trace file can be arduous, it is an excellent method for determining that the calculations and timing of the model are correct. 3. History block (Item library). This block records the passage of an item and its associated attributes at a particular point in the model. This block can be added with a right-click on any item block's output connector. It is very useful for obtaining a pinpoint view of the timing of items through a particular section of the model. 4. Record Message block (Utilities library). The Record Message block is placed between two value connections. This block records the values sent between two blocks.

61 Model Validation

5. Equation Debugger. Equation-based blocks have a debugger that allows the modeler to step through the equation as it is being executed. This is not only useful when determining the cause of a programming error as stepping through an equation can help to verify that the equation is performing as expected. 6. ExtendSim database. Model information can be written to the database as the simulation is running. With this the modeler can create custom log files that record the operation of the model. The Write or Equation blocks from the Value library or the Write (I) or Equation (I) blocks can be used to write information to the database in response to system events. In addition, the Resource Manager block has an automatic logging feature that records the allocation and de-allocation of the advanced resources in a database table. 7. Stepping through the model. ExtendSim can be paused at any time during the simulation and the Step command (either in the tool bar or in the Run menu) can be used to step through the model as it executes. You can examine any of the dialog variables in the blocks to determine the behavior of the model. The Pause Sim block (Utilities library) can also be used to pause the simulation at a particular time or event. 8. Plotters. The blocks in the Plotter library can be used to display the value of any output connector over time. This is useful when comparing the value of two different but related connectors to ensure that the model is operating properly. The Plotter blocks include a histogram, bar chart, Gantt chart, scatter and strip charts, plotters for recording the results of multiple runs, and so forth. 9. Other tools. For more information, the ExtendSim User Guide [Imagine That Inc., 2007] has a chapter on Debugging Tools.

References
Imagine That Inc. [2007], ExtendSim User Guide, Seventh Edition

62 Model Validation

11
Absolute Performance

ExtendSim provides a variety of reporting tools for model performance measures: 1. Each block that has statistics to report has a Results tab. This contains the results collected for that run. For example, see the Results tab of the Activity block on page 33. 2. Output connectors display their values when the cursor is paused over them. 3. The Statistics block (Value library) provides summary statistics for all blocks in a model of a specific name (such as all Mean & Variance blocks) or of a certain type (such as all activities or queues). This block can be configured to collect multiple observations and summarize them. The information that is collected is specific to the selected block option. For example, for all queues the block reports average and maximum queue length, average and maximum wait time, arrivals, departures, reneges, utilization, and so forth. The Statistics/Confidence interval popup menu is for switching between displaying the raw data and displaying the calculated confidence interval information. 4. The Mean & Variance block (Value library) is a handy way to collect statistics on a single value. You can use this block, along with other Value library blocks, to create your own performance measures. Its dialog is shown below. 5. Custom performance measures can be created by using other blocks from the Value library. For example the number of items to have completed within a certain amount of time can be

64

calculated with a Information block from the Item library and Decision and Holding Tank blocks from the Value library.

Figure 11.1 Options Tab of Mean & Variance Block

12
Relative Performance

Scenario Manager
The easiest way to compare the performance of different model configurations is to use the ExtendSim Scenario Manager (Value library of ExtendSim AT and ExtendSim Suite). With this block you can create a comprehensive design of experiments defining scenarios, making the desired number of runs, and analyzing the results. The Scenario Manager will run all of the scenarios multiple times and generate a performance report for all of the scenarios. It allows an arbitrary number of factors and responses, any of which can be a dialog variable, database, and/or database table, field, or record. The data file capability allows for experimentation with any input or output typically specified in a data file, such as alternate production and labor schedules. The Scenario Manager also has a built-in interface to JMP statistical software (SAS Institute Inc.) so the JMP design of experiments engine can generate the scenarios. Summaries and statisti-

66

cal measures of the responses are provided; responses can also be exported to JMP for advanced analysis.

Figure 12.1 Dialog of Scenario Manager Block

Optimizer
Another option for measuring relative performance is to use the Optimizer block (Value library). The modeler enters the values that can be changed, any constraints on those values, and an objective function that is used to determine the best model configuration. When the optimization is started, the simulation model is iteratively run until the Optimizer is statistically confident that the best model configuration has been achieved. The advantage of the ExtendSim Optimizer is that the optimization algorithm is available within a block that can be added to any model to control all aspects of the optimization. This increases flexibility and opens up the method and source code to those who might want to modify or create their own customized optimization blocks.

Figure 12.2 Dialog of Optimizer Block

Part V
Appendices

68

Appendices

A
Getting Started with ExtendSim

This Appendix divides the basics of operating ExtendSim into two sections: 1. Using an existing model to explore a concept. You do this for the example models in Chapter 2 and 3, where you change parameters and run a model, then examine the results. 2. Creating a new model to simulate a system or process. For some of the exercises in the DESS book, it is helpful to build a simulation model. This Appendix only gives a brief introduction to using ExtendSim. For a more extensive description, see the ExtendSim User Guide [Imagine That Inc. 2007], paying special attention to the Tutorial module at the beginning as well as the Tutorial for the Discrete Event module. An eDoc of the User Guide is located in the ExtendSim\Documentation folder.

A.1 Using an Existing Model


As explained in detail below, the steps for using an existing model are: 1. Launch the ExtendSim application 2. Open an existing model 3. Enter or change parameters 4. Enable or disable animation 5. Run the simulation

70 Using an Existing Model

6. View model status and results 7. Save the model

A.1.1 Launch ExtendSim


ExtendSim operates on Microsoft Windows and Apple Macintosh operating systems. Once inside the application, there are only minor differences between ExtendSim running on Windows or on Macintosh. Start ExtendSim as you would any other application: For Windows, select the ExtendSim program from the Start menu For Macintosh, double-click the ExtendSim application icon Once the application is open, you will see many familiar commands and toolbar buttons for opening files, copying, pasting, printing, and so on. You will also see some commands that are unique to a simulation program, including running a simulation, setting the start and end times, and changing the speed of the animation. To find out what the other toolbar buttons do, hover the mouse over them or refer to the ExtendSim User Guide [Imagine That Inc. 2007]. The Getting Started file If this is the first time you have started ExtendSim, or if you have not changed the default settings during previous launches, ExtendSim automatically opens a window labeled Getting Started.mox. (If the default settings have changed, ExtendSim will open a new model window when it launches.)

Figure A.1 Getting Started File Getting Started.mox is an ExtendSim model that is being used as a control panel interface. Clicking the buttons on the Getting Started worksheet reveals their different purposes: There are four buttons on the left titled Open Selected Model, one each for ExtendSim CP, ExtendSim OR, ExtendSim AT, and ExtendSim Suite. Each button opens the sample model

71 Using an Existing Model

that is selected in the popup menu directly above it. For more information about ExtendSim products, see About ExtendSim on page vii. The buttons on the right are for: Opening a new model Selecting and opening a recent model Opening the ReadMe Selecting and playing tutorial videos There are two buttons at the bottom: Clicking Dont Show Again causes this window to not open the next time ExtendSim launches. Instead, ExtendSim will open a new model window when it first launches. Clicking ExtendSim for DESS Textbook opens a control panel interface named DESS QuickStart. Like the Getting Started file, DESS QuickStart is an ExtendSim model that provides an interface for the DESS files.

A.1.2 Opening a DESS model


Although model files can be opened using other methods, the easiest way to access all the DESS files is through the DESS QuickStart file. Open the DESS QuickStart file If the Getting Started file is open, click the ExtendSim for DESS Textbook button. It is located on the bottom right side of the Getting Started window. Clicking that button opens the DESS QuickStart file, shown below. If the Getting Started file is not open: Open the DESS QuickStart file using the File > Open command or the Open button in the toolbar. Browse to the ExtendSim\Examples\DESS Textbook folder to open the file.

72 Using an Existing Model

Or, double-click the DESS QuickStart file; it is located in the ExtendSim\Examples\DESS Textbook folder.

Figure A.2 DESS QuickStart File

Although we think you will find it useful, you dont need to use the DESS QuickStart file to

open the DESS models. Instead, models can be opened using the File > Open command, the Open button in the toolbar, or by double-clicking the file.

DESS QuickStart is an interactive learning tool for the DESS text. As seen above, it has buttons for opening this text, viewing the tutorial videos that correspond to this chapter, and opening the example models. Opening the DESS MM1 model To open the MM1 model: In the DESS QuickStart file, click the button labeled Open MM1 Model. Or, open the DESS MM1 model directly using the File > Open command, the Open button in the toolbar, or by double-clicking the file. The file is located in the folder ExtendSim\Examples\DESS Textbook.

73 Using an Existing Model

Exploring the DESS MM1 model The DESS MM1 model represents a single-server, single-queue system a waiting line with one service provider, such as in a small store. People arrive, wait in line, are helped by the clerk (unless the clerk is busy), and leave.

Figure A.3 DESS MM1 Model The model worksheet has some control buttons and check boxes, a field for entering the average processing time, a plot and six blocks that form the actual model. The blocks are: Executive. Performs event scheduling for discrete event models. Every ExtendSim discreteevent and discrete-rate model must have an Executive block placed to the left of all other blocks in the model. Create. Creates items randomly or by schedule. Queue. Holds items as they wait for downstream capacity. Activity. Processes items and releases them when finished. Exit. Passes items out of the simulation and counts them as they leave. Plotter. Displays model results. In this model it is connected to the Queues L (length) output connector, so it displays the length of the queue as the simulation runs. The plot pane of the plotter has also been cloned (virtually copied) onto the model worksheet so it can be easily viewed. (Cloning is discussed in Using a cloned parameter field on page 74.) See Entities on page 4 for an explanation of blocks and items; see page 11 for a listing of the model controls; see below for the definition and use of a cloned parameter.

A.1.3 Set or change parameters


Parameters are usually set in block dialogs. However, for the DESS models important parameter fields have been cloned (virtually copied) onto the model worksheet.

74 Using an Existing Model

In the blocks dialog A blocks dialog is accessed by double-clicking its icon or by right-clicking the icon and selecting Open Dialog. Dialogs contain fields for entering values as well as radio buttons, check boxes, and other methods for changing settings. For example, the Process tab in the dialog of the Activity block has a section for entering parameters to determine the blocks processing time.

Figure A.4 Portion of Activity Blocks Dialog In the DESS MM1 model, accessing the dialogs of the following blocks reveals their settings: The Create block generates items randomly using an exponential distribution with a mean of 1 to specify the time between item arrivals The Queue is set to sort its items and release them on a first-in, first-out (FIFO) basis The Activitys processing time is specified by an exponential distribution with a mean of 1 Using a cloned parameter field Many of the DESS models have important dialog fields cloned onto the model worksheet. Cloning is a useful feature that allows you to place virtual copies of important information (plots, input fields, output fields, and so forth) in a convenient location. Clones can be put into a models Notebook, onto the model worksheet, or within a hierarchical blocks submodel. This makes it easier to view or enter important model parameters. A cloned field is a virtual copy of a field in a blocks dialog. Each clone is identical to its originating parameter field; changing the clone changes the original and vice versa. For instance, Example 2.1: Coin Tossing (discussed on page 16) has a clone from the dialog of the Decision block. The clone allows you to easily change the probability that the toss will result in heads. When you change the value in that cloned field, it changes the B value in the Decision block. You can verify this by double-clicking the Decision block (labeled Heads or Tails) and looking at its dialog as you change the value in the cloned field. The section Clone a dialog item (optional) on page 81 shows how to use cloning.

A.1.4 Enable and disable animation


The DESS MM1 simulation runs with 2D animation turned on so you can see items move through the model. While a green circle is the default object used to represent items, you can change animation objects to something more realistic, as discussed in Enable 2D animation (optional) on page 80.

75 Using an Existing Model

Running with animation turned on also shows block status: the Queue shows the number of items waiting, the Activity displays its status (1 or 0 items being processed), and the Exit shows the number of items that have exited the simulation. Animation is useful for visualizing what is happening in a model but it does increase the simulation runtime. To turn off animation, uncheck the Animation On check box on the model worksheet. You can do this before the simulation starts or at any time during the simulation run.

A.1.5 Run the model


To run the model one time, do one of the following: Use the command Run > Run Simulation Or, click the Run Simulation button (the green arrow) in the toolbar Or, click the Run Trial button. (This button is specific to the DESS models. As discussed in How to Use the [Models] on page 10, the DESS models have special buttons and check boxes for running the model and controlling animation.) Some of the DESS models also have a Run Experiment button for running multiple trials. This is explained in Model controls on page 11. To stop a simulation before the run has ended, do one of the following: Give the command Run > Stop Or, click the Stop tool in the toolbar; it is a red stop sign

A.1.6 View model status and results


As it runs, the model generates results and calculates statistics. Most of the DESS example models contain a data table that displays the inputs, outputs, and some summary statistics for the simulation. This model is so simple it is easiest to just double-click the blocks and look at their Results

76 Creating a new model

tabs. For instance, double-click the Activity to open its dialog, then select its Results tab. Because each run will start with a different random seed, the results will vary from one run to the next.

Figure A.5 Results Tab of Activity Block

A.1.7 Save the model


If the model has any changes, ExtendSim will prompt you to save the model when you close it. To save a model without closing it, use the File > Save Model command. It is a good idea to save frequently as you work. You dont want to spend a long time building a model only to have a power interruption cause you to lose everything youve done.

A.2 Creating a new model


In this section you will learn how to build the MM1 model shown in the previous section. The steps for creating a new model include: 1. Open a new model window 2. Set simulation run parameters 3. Open one or more libraries of blocks 4. Place blocks on the model worksheet 5. Connect the blocks 6. Enter parameters for the blocks 7. Enable 2D animation (optional) 8. Clone dialog items to model worksheet (optional) 9. Add a user interface (optional) 10. Create a hierarchical block (optional).

77 Creating a new model

A.2.1 Open a new model window


Launch ExtendSim as you would any other application. To open a new model worksheet, do one of the following: Give the command File > New Model Or use the New Model Worksheet button in the toolbar Or click the New Model button in the DESS QuickStart or the Getting Started files. ExtendSim opens a blank model worksheet.

A.2.2 Set Run Parameters


Assume the model should run for 480 simulation minutes (an 8 hour day). Give the command Run > Simulation Setup Select the Setup tab Customize the Setup tab by doing the following: Set End Time: 480 Choose Global time units: Minutes Click OK to save the settings and close the dialog

A.2.3 Open a library (if needed)


Libraries are repositories of the blocks that are used when creating a model. ExtendSim ships with several libraries. The most common libraries for creating discrete-event models are the Item, Plotter, and Value libraries. By default, the most-used libraries will already be open when you launch ExtendSim. If a needed library isnt already open, for instance if you have closed it: Give the command Library > Open Library. In the Open Library File window, select the Item library and click Open. Open the Plotter library in the same manner as you did the Item library.

78 Creating a new model

Notice that the libraries are now listed at the bottom of the Library menu. Placing your cursor over the Item library reveals the categories of blocks included in that library as well as the Open Library Window command.

Figure A.6 Subcategories of Blocks for the Item Library

A.2.4 Place blocks on the model worksheet


There are two common methods for placing a block on the model worksheet: 1. Selecting a block from a category in a librarys Library menu. To do this, give the command Library > Item. From the window that appears to the right of the library, select the category and block you want. The block will automatically be placed onto the model worksheet. For example, give the command Library > Item and select the Executive block. This places the Executive in the top left corner of the model worksheet. (Other than the Executive, blocks will be placed wherever you click on the worksheet.) 2. Dragging a block from a Library window. To do this, give the command Library > Item > Open Library Window. This opens a window with all of the blocks in the Item library in alphabetical order. The wanted block can then be dragged onto the model worksheet. For example, give the command Library > Item > Open Library Window. In the Item.lix window that opens, click and drag the Executive block onto the model worksheet. It will automatically place itself in the upper left corner. (Other than the Executive, blocks will be placed wherever you click on the worksheet.) Place blocks for the MM1 model Use a method from above to place the following 6 blocks on the model worksheet. (Their categories are listed in parentheses.) 5 blocks from the Item library: Executive, Create (Routing), Queue (Queues), Activity (Activities), Exit (Routing) 1 block from the Plotter library: Plotter Discrete Event Select and move the blocks so that they are positioned approximately in the same order as in the DESS MM1 model shown on page 73.

A.2.5 Connect the blocks


Most blocks have input and output connectors the small squares attached to the blocks icon. Information and items flow into a block at its input connectors and out of the block at its output

79 Creating a new model

connectors. Connection lines from one connector to another indicate the flow of information and items. Connector types Connectors on a block are visually different, depending on how theyre used. While each connectors specific purpose is described in the blocks Help, the following table describes the two main types of ExtendSim connectors. Table A.1 Value and Item Connectors Type Value Input Output How theyre used Continuous blocks, such as in the Value library, use value connectors to pass values from one block to another. Blocks in the Item and Rate libraries may also use value connectors for the same purpose. Discrete event blocks, such as in the Item library, use item connectors to pass discrete items. Blocks in the Rate library may also use item connectors.

Item

Item library blocks, such as the Create and Queue, often have both types of connectors: item connectors for passing items and value connectors for passing information. Connecting to a connector If you position the cursor over an output connector, it turns into a drawing pen. To connect from one connector to another, click and drag the drawing pen until the connection line thickens, then release. 1. To indicate the flow of items, draw connections between the blocks item connectors as follows: From the Create blocks item output to the Queues item input From the Queues item output to the Activitys item input From the Activitys item output to the Exits item input 2. So that the model will display the length of the waiting line in the Queue: Connect from the Queues L (length) value output to the top input on the Plotter, Discrete Event

80 Creating a new model

Unconnected connection lines will be displayed in red. To delete a portion of a connection line, select it and click the Delete or Backspace key. To delete the entire connection line, double-click it before deleting. When finished, your model should like the one below.

Figure A.7 Blocks Connected Together

A.2.6 Enter parameters


Some blocks need to have parameters entered in their dialogs; others have default settings that dont need to be changed. Use default settings The blocks that you have placed in the model have the following default settings: The Create block generates items whose interarrival time is based on an exponential distribution with a mean of 1 minute The Queue sorts items and releases them in a first-in, first-out order The Activity has a capacity of 1 item and releases each item after a constant 1 minute of processing time The Exit counts the number of items that have left the model Change settings The Activity block is the only one that needs its settings changed to duplicate the DESS MM1 model: To open its dialog, double-click the icon of the Activity block In the Activitys Process tab, choose Delay is: specified by a distribution Select Distribution: Exponential from the popup list Enter Mean: 1 (leave the Location blank) Close the blocks dialog

A.2.7 Save and run the model


Give the command File > Save Model and name the model For the different ways to run a model, see Run the model on page 75

A.2.8 Enable 2D animation (optional)


Unlike the pre-built models, your model doesnt have a check box for turning animation on and off. Instead, use the command Run > Show 2D Animation, causing Show 2D Animation to be checked.

81 Creating a new model

Then run the simulation. To turn off animation, give the command again; this unchecks the Show 2D Animation command. You can turn 2D animation on or off before the simulation starts or at any time during the simulation run. You can also change the animation object from the default green ball. For example, to change to people moving through the simulation: In the Create blocks Item Animation tab, select the People object for the 2D picture, as shown to the right In the Queue blocks Item Animation tab: Select Change all items to from the popup menu Select one of the person objects in the 2D picture popup menu For example, we have selected a male person as shown at the right. When the simulation is run, people will accumulate in the Queue and one person at a time will be processed and released by the Activity.

A.2.9 Clone a dialog item (optional)


Cloning is defined in Using a cloned parameter field on page 74. The DESS MM1 model that you ran in the previous section had the plotter pane cloned onto the worksheet. This displayed the simulation results without you needing to double-click the Plotter block. To clone a dialog item, select the dialog item using the Clone Layer tool from the toolbar, then drag the dialog item onto an allowed location, such as the model worksheet. For example, to clone the plot pane to the worksheet: Double-click the icon of the Plotter to open its dialog Select the Clone Layer tool from the toolbar. (The Clone Layer tool has a circle underneath the arrow; see the picture of toolbar buttons on page 84.) With the cursor, click and hold on the plot pane Drag the pane onto the model worksheet and position it where you want To resume modeling, change back to the Block/Text layer tool from the toolbar

Figure A.8 Plot Pane Cloned Onto Model Worksheet

A.2.10 Add a user interface (optional)


As shown with the Getting Started file on page 70, models can have user interfaces. Adding buttons, text, graphics, and popup menus to a model enhances its accessibility and usability. Extend-

82 Creating a new model

Sim has several blocks and tools to help when creating a model interface. These are discussed fully in the ExtendSim User Guide [Imagine That Inc. 2007]. One type of user interface is to place controls on the model worksheet, as discussed on page 11 and shown in the DESS example models. The Model Interface block (Utilities library) provides an easy method for quickly adding this type of customized control panel to a model. Add a Model Interface block (Utilities library) to your MM1 model Double click the Model Interface block to open its dialog, shown below In the dialog, uncheck three check boxes Run Experiment, Explain, and Set Random Seed since they are not needed in this model. Click the Create Interface button at the bottom of the blocks dialog, then close the dialog. This places two controls (Run Trial and Animation On) in the upper right corner of the model. Use the Clone Layer tool to position the controls where you want. Since it is no longer needed, the Model Interface block can be moved out of sight to the bottom of the model or hidden in a hierarchical block. (Deleting the block would delete the controls.)

Figure A.9 Dialog of Model Interface Block for This Model

A.2.11 Create a hierarchical block (optional)


Hierarchy is defined on page 30. While not necessary in such a small model, hierarchy reduces complexity for large-scale models. There are two methods for creating a hierarchical block: 1. Creating a new hierarchical block and putting something (blocks, text, and so forth) in it. 2. Selecting one or more blocks on the model worksheet and making them into a hierarchical block. This is the method used in this section. To create a hierarchical block that contains the Queue, Plotter, and Activity blocks: Frame-select the Queue, Plotter, and Activity blocks so that they, as well as their connections, are selected, as shown at right Give the command Model > Make Selection Hierarchical In the dialog, give the hierarchical block a name and click Make HBlock

83 Other resources

A new block with a plain icon appears on the worksheet, connected to the Create and Exit blocks. Double-clicking the new blocks icon reveals the 3-block submodel it encloses. The submodel communicates with the top model through the use of the named connections Con1In and Con2Out. There are a lot more you can do to customize and use hierarchical blocks, but that is beyond the scope of this text.

A.3 Other resources


The previous sections are meant as a brief introduction to using ExtendSim. For other resources: 1. See the ExtendSim User Guide [Imagine That Inc. 2007] for additional tutorials as well as information about creating a user interface, data management, analysis, and so forth. All ExtendSim products include a User Guide as an eBook in pdf format. All ExtendSim manuals are provided as eBooks in the folder ExtendSim\Documentation. Printed versions of the ExtendSim manuals are also available for separate purchase through the ExtendSim store at www.ExtendSim.com/store/. 2. View the tutorial videos. Tutorial videos for the DESS text can be accessed using the DESS QuickStart file; see the folder ExtendSim\Examples\DESS Textbook. There are also general purpose tutorial videos accessible through the Getting Started file; it is located at the root of the ExtendSim folder. 3. Use the ExtendSim Exchange (http://www.extendsim.com/forums), a forum for ExtendSim modelers. Access to most sections of the user forum is open to all ExtendSim modelers, and it is a good place to ask questions and search topics for answers. 4. For Instructors, additional material is located in a special section of the ExtendSim Exchange. The additional materials are available to approved Instructors through the DESS Textbook section within the Academic category at the bottom of the main forum page. You must register to log into the ExtendSim Exchange. Access to the DESS Textbook and Instructor forums is limited to those who are teaching a class and have been pre-approved.

84 Other resources

Hide/Show connectors Navigator New model Open model Save model Print Cut Copy Paste Undo Zoom Notebook 3D Window Run Run Optimization or Scenarios Stop Pause/Continue Step Animation on/off Animation faster Animation slower All layers Colors Patterns Shapes popup menu Shuffle graphics Cursor position Icon tools popup menu

Block/text tool Graphics layer Clone layer Rectangle Round rectangle Oval Polygon Line Right angle line

Figure A.10 Toolbar Buttons

References
Imagine That Inc. [2010], ExtendSim 8 Addendum, First Edition Imagine That Inc. [2009], ExtendSim Developer Reference, Seventh Edition. Imagine That Inc. [2007], ExtendSim User Guide, Seventh Edition.

B
Random Distributions

B.1 Blocks For Generating Random Numbers


ExtendSim provides several blocks that have popup lists in their dialogs for selecting a random distribution and generating a random number. Table B.1 Blocks That Generate Random Numbers
Block Activity Create Random Number Select Item In Select Item Out Shutdown Workstation Library Item Item Value Item Item Item Item

As discussed in the chapter Random-Variate Generation on page 53, you can also use any
equation-based block to call a random distribution function.

86 Distributions in ExtendSim

B.2 Distributions in ExtendSim


As discussed in the chapter Statistical Models in Simulation on page 39, ExtendSim supports 34 parametric distributions as well as an empirical distribution. Table B.2 Description of Distributions
Distribution Beta Binomial Description Distribution of random proportion, such as the proportion of defective items in a shipment, or time to complete a task. The number of outcomes in a given number of trials. Most often used to express success/failure rates or the results of experiments, such as the number of defective items in a batch or the number of customers who will arrive who are of a particular type. Used to represent the ratio of two equally distributed parameters in certain cases or wildly divergent data as long as the data has a central tendency. It has a sharp central peak but broad tails that are much heavier than the tails of the Normal distribution. Used in statistical tests but, since it does not have a scaling parameter, its utilization is somewhat limited. It is a subset of the Gamma distribution with beta = 2 and alpha = nu/2. This does not produce a random number, but a constant value which does not change. Used when there is exactly the same amount of time between arrivals or as a method to reduce the effects of randomness in the early stages of model building. Used to generate a customized or user-defined distribution with a special shape when the probability of occurrence is known. The options are: discrete (the block will output the exact values given in the table); stepped (values in the table will be used as probabilities of ranges of data); and interpolated (the probability distribution will be interpolated between the data points). Frequently used for queueing theory to represent service times for various activities or when modeling telephone traffic. Primarily used to define intervals between occurrences such as the time between arrivals of customers or orders and the time between failures (TBF) or time to repair (TTR) for electrical equipment. Also used for activity times such as repair times or the duration of telephone conversations. describes the limiting distribution of the greatest values of many types of samples. Used to represent parameters in growth models, astronomy, human lifetimes, radioactive emissions, strength of materials, flood analysis, seismic analysis, and rainfall analysis. Its peaked shape is always the same but it may be shifted or scaled. Describes the limiting distribution of the least values of many types of samples. Represents parameters in growth models, astronomy, human lifetimes, radioactive emissions, strength of materials, flood analysis, seismic analysis, and rainfall analysis. Typically used to represent the time required to complete some task. The distribution is shaped like a decaying exponential for shape (2) values between 0 and 1. For shape values greater than 1, the distribution is shaped like a bell curve skewed towards the low end.

Cauchy

Chi Squared

Constant

Empirical

Erlang Exponential

Extreme Value Type 1A

Extreme Value Type 1B Gamma

87 Distributions in ExtendSim

Distribution Geometric

Description Outputs the number of failures before the first success in a sequence of independent Bernoulli trials with the probability of success on each trial. Typically used for the number of items inspected before encountering the first defective item, the number of items in a batch of random size, or the number of items demanded from an inventory. Usually used in telephone traffic and queueing theory. Describes the number of defects, x, in a sample of size s from a population of size N which has m total defects. It is used to describe sampling from a population where an estimate of the total number of defects is desired. It has also been used to estimate the total population of species from a tagged subset. Originally used to model Brownian motion and diffusion processes with boundary conditions. It has also been used to model the distribution of particle size in aggregates, reliability and lifetimes, and repair time. Describes several failure processes as a distribution of lifetime. It can also be used to fit data with abnormal large outliers on the positive side of the peak. Used in quality control to describe non-normal processes, which can then be transformed to the Normal distribution for use with standard tests. It is a continuous distribution that has both upper and lower finite bounds. Used in quality control to describe non-normal processes, which can then be transformed to the Normal distribution for use with standard tests. It is an unbounded continuous distribution. Used in error analysis and to describe the difference of two independent, and equally distributed, exponentials. Describes the diversity of a sample, that is, how many of a given type of thing are contained in a sample of things. For instance, this distribution has been used to describe the number of individuals of a given species in a sampling of mosquitoes, or the number of parts of a given type in a sampling of inventory. Most often used a growth model: for populations, for weight gain, for business failure, etc. Can also be used to test for the suitability of such a model, with transformation to get back to the minimum and maximum values for the Logistic function. Occasionally used in place of the Normal function where exceptional cases play a larger role. For Shape = 1, it resembles the Exponential distribution. For Shape < 1, it tends to infinity at Location, and decreases with increasing X. For Shape > 1, it is zero at Location, and then peaks and decreases. Often used to represent the time to perform an activity (especially when there are multiple sub-activities), the time between failures, or the duration of manual activities. This distribution is widely used in business for security or property valuation, such as the rate of return on stock or real estate returns. Number of failures before Sth success. P specifies the probability of success.

HyperExponential Hypergeometric

Inverse Gaussian

Inverse Weibull Johnson SB

Johnson SU

Laplace Logarithmic

Logistic

Log-Logistic

LogNormal

Negative Binomial

88 Distributions in ExtendSim

Distribution Normal

Description The well-known Gaussian or bell curve. Most often used when events are due to natural rather than man-made causes, to represent quantities that are the sum of a large number of other quantities, or to represent the distribution of errors. Represents the income distribution of a society. It is also used to model many empirical phenomena with very long right tails, such as city population sizes, occurrence of natural resources, stock price fluctuations, size of firms, brightness of comets, and error clustering in communication circuits. A distribution typically used to represent the time required to complete some task. The density takes on shapes similar to lognormal, but can have a larger spike close to x = 0. A distribution typically used to represent the time required to complete some task. A continuous distribution bounded by zero on the left and unbounded on the right. Models the rate of occurrence, such as the number of telephone calls per minute, the number of errors per page, or the number of arrivals to the system within a given time period. Note that in queueing theory, arrival rates are often specified as poisson arrivals per time unit. This corresponds to an exponential interarrival time. A continuous distribution with both upper and lower finite bounds. It is a special case of the Beta distribution with q = 1. The Uniform distribution is a special case of the Power Function distribution with p = 1. Frequently used to represent lifetimes because its hazard rate increases linearly with time, e.g. the lifetime of vacuum tubes. This distribution also finds application in noise problems in communications. Usually more appropriate for business processes than the uniform distribution since it provides a good first approximation of the true values. Used for activity times where only three pieces of information (the minimum, the maximum, and the most likely values) are known. Describes a integer value that is likely to fall anywhere within a specified range. Used to represent the duration of an activity if there is minimal information known about the task. Describes a real value that is likely to fall anywhere within a specified range. Used to represent the duration of an activity if there is minimal information known about the task. Commonly used to represent product life cycles and reliability issues for items that wear out, such as the time between failures (TBF) or time to repair (TTR) for mechanical equipment.

Pareto

Pearson Type V

Pearson Type VI Poisson

Power Function

Rayleigh

Triangular

Uniform Integer

Uniform Real

Weibull

C
ACME Steel

ACME Steel is a metal fabrication manufacturer that specializes in stamped steel products. One of the stamped steel products is a gear assembly for transmissions. ACME Steel's customer would like to purchase up to 11,000 gear assemblies each month. However ACME Steel is having difficulty producing that many. As shown below the cell layout for the stamped steel gear assembly has storage areas and several processes, such as Stamping and Assembly.

Figure C.1 Cell Layout for Stamped Steel Gear Assembly

90 Details

A flow diagram of the process would look like the one shown here.

Figure C.2 Process Flow for Gear Assembly In the process flow diagram, buffers are represented as bins at each processs input and/or output. The number on a bin is that buffers capacity in pallets; the output buffer of Inspection #1 and the input buffer of Inspection #2 are infinite ().

C.1 Details
ACME Steel operates one shift per day and has a five-day work week, for a total of approximately 160 hours per month. With its current processes, ACME Steel would have to work overtime in order to meet the customers demand. Some members of management, however, have noted that the excess WIP (work in process) is causing the throughput time to be very high; they wonder if all of the WIP is really necessary. The raw material for the stamped steel gear assembly arrives at the plant as large steel coils. Each coil can be stamped into 1000 completed assemblies. The coils come from a local distributor and can be delivered whenever needed. Since the coils can be delivered as needed, the arrival process could be simulated by a Create block set to Create items infinitely. If you take this approach, let the Create block represent pallets and route them directly to the Stamping process. (Note: Dont follow the infinite Create block with a queue that has infinite capacity. If you do, ExtendSim will continue to create items until your computer runs out of memory!)

91 The Workshop

The service times for each process, plus inspection, are shown in the table below. The service times are per pallet where every pallet holds 100 gear assemblies. The gear assemblies are put onto pallets after the stamping process and are transported from process to process in full pallets. Table C.1 Service Times for Each Process
Process Stamping Service Time per Pallet (minutes) Lognormal (5, 1)

Spot Welding #1 Lognormal (65, 13) Spot Welding #2 Lognormal (75, 15) Inspection #1 Assembly #1 Assembly #2 Inspection #2 Lognormal (25, 5) Lognormal (105, 21) Lognormal (65, 13) Lognormal (25, 5)

ACME Steel inspects the gear assemblies after Spot Welding #2 (at Inspection #1) and after Assembly #2 (at Inspection #2). Gear assemblies are inspected individually and are scrapped if found defective. Both Inspection #1 and Inspection #2 are performed by a single operator who works at both of the stations. The product failure rates are provided below. Table C.2 Failure Rates
Process Inspection #1 Inspection #2 Product Failure Rates 95% Pass & 5% Fail 95% Pass & 5% Fail

The pallets are always kept full even after the inspection process. When the inspector finds defective parts, the defective parts are scrapped and are replaced by good parts from the next pallet. Once a pallet is full of good parts (100 gear assemblies), it is sent downstream. See Inspection process and failure rate on page 92 for some hints on how to model this process.

C.2 The Workshop


The plant manager thinks the production goal of 11,000 gear assemblies per month can be accomplished without overtime work. And she thinks simulation can be used to help identify the problem and quantify the impact of a couple of proposed changes. 1. Build a model of the current gear assembly process and analyze the results. Is there a bottleneck and if so, where? 2. Assembly #1 seems to be the bottleneck in the system. What would be the impact on throughput if a second station was added at Assembly #1, doubling the capacity? Change the simulation model and help the plant manager make an informed decision regarding the additional capacity.

92 Hints

3. Assuming that the additional capacity has already been added at Assembly #1, the plant manager wonders exactly how much the plant could produce if a second dedicated station were added to the system at another step of the process. For example, how much could the system produce if Welding #1, Welding #2, or Assembly #2 had doubled capacity in addition to Assembly #1? Help the plant manager make an informed decision regarding which additional station should be added and how much it will improve the system.

C.3 Hints
C.3.1 Inspection process and failure rate
The inspection time given is per pallet. An easy way to model this construct is to grab the inspector resource before the pallet goes into the inspection activity and release the inspector resource after the pallet is finished with the inspection activity. After releasing the inspector resource, the pallet can then be un-batched so that 5% of the parts can be scrapped. This can be seen from the illustration below.

Figure C.3 Modeling the Inspection Process and Failure Rate

C.3.2 Determining where the bottlenecks are


Each part of the gear assembly production process can be modeled by an Activity block. Add a Statistics block (Value library) to the model. Set it to report on the activities then run the simulation. Throughput and utilization will indicate where the bottlenecks are in the current process.

C.3.3 Adding capacity


Adding capacity can be simulated either by adding an additional Activity block to the model or by changing the existing Activity block to have 2 as the maximum number of items it can process at a time. Notice that in either case, the service time remains the same.

93 Hints

C.3.4 Clearing statistics


After the simulation run starts, it can take some time for the assemblies to make their way through the factory. Instead of starting with most processes empty of product, you should create a warm up period to allow the system to get to its normal operating levels. This can be done with a Clear Statistics block (Value library). Using this, clear all of the statistics after the factory is at its typical operating levels. Use Plotter blocks (Plotter library) to determine this time.

94 Hints

D
ITI Healthcare ED

ITI Healthcare is a full service medical facility in the suburbs of Houston, TX. They have been in business for about 40 years. The staff is very forward thinking in most areas of the business and understands that the only way to improve is to change. This means trying new ideas even if some turn out to be failures they learn from the failures and improve through the successes. This approach has helped them respond over the years to fairly substantial changes without having to go through any significant brick and mortar changes. The process improvement group is considering more changes to the Emergency Department (ED) in order to improve patient satisfaction. Aside from quality of care, patient satisfaction is often a function of time spent in the system. The less time patients spend in the ED, the more satisfied patients tend to be. However, hospital administration is reluctant to make many changes which might involve disruptions of the ED, a very critical department. Someone has suggested that a simulation model could test changes without actually touching the real system. The administration is intrigued and has asked us to help.

96 Process Layout

D.1 Process Layout


The actual layout of the ED can be seen in the illustration below.
WaitingRoom Triage Room1 Room2 Room3 Room4 Room5

Registration NurseStation FT 1 FT 2 FT 3 FastTrack(FT) FT 4 FT 5 FT 6 RM 15 RM 16 RM 17 Meds RM 12 RM 13 RM 14 RM 7 RM 8 RM 9 RM 10

RM 6

NurseStation Supplies

RM 11

Room24

Room23

Room22

Room21

Room20

Room19

Room18

Figure D.1 Layout of the Emergency Department

D.2 Scope & Model Assumptions


The system of interest starts when patients arrive at the ED. The system ends with disposition, when the patient is either a) discharged to go home or b) admitted to the hospital. In order to simplify the modeling process while still providing valid results, the process improvement group made the following assumptions: While other ED personnel can also perform triage, registration, lab work, and radiology, this study will focus only on doctors and nurses Additional work that the doctors and nurses perform outside of the model scope will not be modeled The Radiology and Lab processes will be simplified

97 Scope & Model Assumptions

D.2.1 Overall process


The flow chart below illustrates the overall process from arrivals through disposition. This includes two distinct patient groups, Main ED and Fast Track patients. As discussed on page 98, the needs of Fast Track patients can typically be met quickly.

Figure D.2 Overall Process

D.2.2 Arrival process


The patient arrival process can be described using an exponential distribution where the mean changes based on the hour of the day. The actual hourly rates are in the table below. Table D.1 Inter-arrival Rates
Time 12:00 Midnight 1:00 AM 2:00 AM 3:00 AM 4:00 AM 5:00 AM 6:00 AM 7:00 AM 8:00 AM 9:00 AM 10:00 AM 11:00 AM Inter-Arrival Rate (minutes) 60 60 60 60 60 60 60 60 60 60 15 15 Time 12:00 Noon 1:00 PM 2:00 PM 3:00 PM 4:00 PM 5:00 PM 6:00 PM 7:00 PM 8:00 PM 9:00 PM 10:00 PM 11:00 PM Inter-Arrival Rate (minutes) 15 15 15 15 15 15 5 5 5 15 15 60

For example at 12:00 midnight the inter-arrival rate indicates that patients arrive based on an exponential distribution with a mean of 60 minutes, while at 12:00 noon the inter-arrival rate would be an exponential distribution with a mean of 15 minutes. The interarrival rate can be modeled using a Lookup Table block connected to a Create block. The Create block will be creating the patients based on the exponential distribution while the Lookup Table will be changing the mean interarrival rate of the Create block.

98 Scope & Model Assumptions

D.2.3 Triage and registration processes


After arriving, patients go through triage and registration. There is one triage station and three registration stations. If the needed process is busy, the patient will wait in the waiting room (queue).

Figure D.3 Flow for Arrival Process. Table D.2 Processing Times and Capacity
Process Triage Registration Time (minutes) Lognormal (3,2) Lognormal (9,7) Capacity 1 station 3 stations

Registration can be modeled using a single Activity block with a capacity of 3.


D.2.4 Patient beds
The ED has two types of patient beds in separate rooms: 24 Main ED beds used exclusively for the Main ED patients 6 Fast Track beds used exclusively for Fast Track patients, discussed below The bed resource can be modeled several ways. Try using the Resource Pool block, the Queue block (as a Resource Pool Queue), and a Resource Pool Release block.

D.2.5 Fast Track


The Fast Track patients are people who can be treated relatively quickly if the required resources are available. Fast Track patients dont require lab work and do not need to go to radiology. The Fast Track area has separate beds from the Main ED as well as separate health care providers (nurses and doctors). The segregation is necessary to ensure that patients with minor needs do not have to wait behind patients who require significantly longer service times. This allows the Fast Track patient to flow through the system quickly. Fast Track Hours The Fast Track area is open from 10:00 am to 12:00 midnight. During the hours Fast Track is open, approximately 50% of the ED patients go to Fast Track and 50% go to the Main ED When the Fast Track is closed all patients go to the Main ED. After 12:00 midnight, patients still in Fast Track continue their stay in the Fast Track but no new patients are routed to the Fast Track area.

99 Scope & Model Assumptions

The logic is illustrated below.

Figure D.4 Routing of Patients Depending on Fast Track Hours

This can be modeled using two Select Item Out blocks, one Select Item In block (all from the

Item library), and a Lookup Table block from the Value library. Use the first Select Item Out block and the Lookup table to split the route based on time of day. Use the second Select Item Out block to model the percentages of patients who go to the Main ED or to the Fast Track. The Select Item In block is used to merge the two Main ED patient flows shown above.

Fast Track Process After registration, the Fast Track patients wait in the waiting room for the next available Fast Track bed. After the Fast Track patients get a bed, they will see a doctor, then a nurse, and then go through the disposition process. The Fast Track patients are not admitted to the hospital; they are always discharged. One dedicated nurse and one dedicated doctor staff the Fast Track area. The process flow is shown below.

Figure D.5 Fast Track Process

If the Resource Pool is used, you will need to release the resource with the Resource Pool
Release block when the patient no longer requires the resource.

D.2.6 Main ED Process


After registration, the Main ED patients wait in the waiting room for the next available Main ED bed. Once in a bed, all Main ED patients will see a doctor and then a nurse. Approximately 50% of the Main ED patients get either lab or radiology work done. If lab or radiology work is done, the patient will have a follow-up visit with the doctor before going through the disposition process. If lab or radiology work is not done, the patient just goes through the disposition process.

100 Scope & Model Assumptions

The process flow is shown below.

Figure D.6 Main ED Process

The resources involved with the lab/radiology process are outside the scope of the model, so

model the process times of this activity but not the resources involved. Assume that any number of patients can go through this process at the same time. flow so that 50% will have either lab or radiology and the other 50% will not. patient flow going into the disposition process.

After the patient is seen by the nurse, the Select Item Out block can be used to split the patient At the end of the process for the Main ED, the Select Item In block can be used to join the
D.2.7 Process Times in Patient Rooms
The process times for all patient types and outcomes are given in the table below. Table D.3 Process Times in Patient Rooms
Process Doctor evaluation time Nurse time Doctor evaluation time Nurse time Doctor evaluation time #2 (follow-up) Lab/Radiology Area Fast Track Fast Track Main ED Main ED Main ED Main ED Process Time (minutes) Lognormal (15, 5) Lognormal (15, 5) Lognormal (20, 5) Lognormal (20, 5) Lognormal (15, 5) Weibull (90 scale, 2 shape, 20 location)

D.2.8 Doctor and Nurse Schedules


Fast Track In the Fast Track area, there is one dedicated doctor and one dedicated nurse. When the Fast Track closes, the health care providers will stay in the area until everyone has been discharged. The Fast Track health care providers will ONLY work in the Fast Track area. Since there is one dedicated doctor and one dedicated nurse, the health care providers can be modeled using either Activity blocks with a capacity of 1 or using a Resource Pool construct.

101 Scope & Model Assumptions

Main ED The Main ED has a more complex situation. The scheduling for the doctors and nurses in the Main ED is done in 6 hour shifts. The current schedule and staffing level is in the table that follows. Table D.4 Provider Schedules in Main ED
Time 12 midnight - 6am 6am - 12 noon 12 noon - 6pm 6pm - 12 midnight Doctor 1 2 2 2 Nurse 1 2 2 2

This staff schedule is for the Main ED exclusively; the Main ED staff does not work on the Fast Track patients. Also, if a change in staffing level is made, it will apply to the entire shift. This means that if 2 nurses are scheduled at 6 a.m., then both nurses will be on shift until 12 noon. In order to implement a schedule for the doctors and nurses that changes throughout the day, a Shift block can be used.

Since doctors are used in multiple activities in the Main ED, the Resource Pool should be used
to model their availability.

D.2.9 Disposition
After patients are finished in the ED, some will be discharged and leave the ED and some will be admitted to the hospital. All of the Fast Track patients are discharged to go directly home from the ED. For patients in the Main ED, 50% are discharged to go home from the ED and 50% are admitted to the hospital. The admitted patients first have to be seen by the admitting doctor (not the ED doctor) and wait for a bed in the appropriate department of the hospital. The patients who are waiting for hospital beds are called boarders. The boarders physically remain in the ED bed while awaiting a bed in the hospital. This process can take several hours. The discharge process is done by another department outside the scope of this model, so model the process times of this activity but not the resources involved. Assume that any number of patients can go through this process at the same time.

Figure D.7 Disposition of Main ED Patients

102 Assignment

After a patient leaves the ED, whether by being discharged or admitted, their bed is immediately released back into the resource pool of beds. The discharge processing times as well as the time it takes to get a visit from the admitting doctor and get a hospital bed is given below. Table D.5 Disposition Times
Process Discharge time Waiting for a hospital bed Process Time Lognormal (20, 6) Lognormal (7, 3) Time Units Minutes Hours

Note that the discharge time is in minutes and the waiting time for a bed is in hours. Make sure
to get the correct time units in the Activity.

D.3 Assignment
Some of the questions that the process improvement group is trying to determine include: 1. Management is considering taking away 6 Main ED patient rooms and adding more equipment in order to broaden their in-house capabilities. However the health care providers (doctors and nurses) are balking at this idea. The health care providers say that reducing the number of rooms to that extent will drastically increase the Main ED / Discharge patient's LOS (Length of Stay). Compare the average patient LOS with 24 rooms to the average patient LOS with only 18 rooms. 2. Management is also considering adding an additional doctor and nurse to one shift. However they are not sure which shift it should be. While in the current scenario with 24 rooms, which shift should get those additional providers and how will that affect the average patient LOS? Consider only the Main ED Discharge patients. 3. While in the current scenario with 24 rooms, if there were a serious outbreak of a flu virus that caused a 50% increase in patients, how would that affect the patient's LOS for both the Fast Track as well as the Main ED? For a 50% increase in patients, the mean interarrival rate (for the Exponential distribution) would look like the table below: Table D.6 Mean Interarrival Rate of Flu Patients
Time 12:00 Midnight 1:00 AM 2:00 AM 3:00 AM 4:00 AM 5:00 AM 6:00 AM Inter-Arrival Rate (minutes) 30 30 30 30 30 30 30 Time 12:00 Noon 1:00 PM 2:00 PM 3:00 PM 4:00 PM 5:00 PM 6:00 PM Inter-Arrival Rate (minutes) 7.5 7.5 7.5 7.5 7.5 7.5 2.5

103 Assignment

Time 7:00 AM 8:00 AM 9:00 AM 10:00 AM 11:00 AM

Inter-Arrival Rate (minutes) 30 30 30 7.5 7.5

Time 7:00 PM 8:00 PM 9:00 PM 10:00 PM 11:00 PM

Inter-Arrival Rate (minutes) 2.5 2.5 7.5 7.5 30

104 Assignment

Index

A
absolute performance 63 ACME Steel 89 activity arrival process 46
as delay in ExtendSim 25 definition of in DESS text 24

B
beta distribution 86 binomial distribution 86 block attributes 6 connection lines 79 connectors 78 definition 4

Activity block 32 agent-based models 7 animation (2D) 74 Animation On checkbox 12 applications of ExtendSim 3 arguments for distributions 40 arrays definition 27 dynamic 27 arrival process 46 arrival rate 45 arrival rate (effective) 45 attribute definition 5 of blocks 6 authors David Krahl ix Robin Clark ix

C
calling population 45 case studies 3 Cauchy distribution 86 central tendency of distribution 40 chain 24 Chi Square distribution 86 clock times 16 clone definition 74 how to create 81 confidence interval 63 connection lines 79 connector Item 79 types 79 Value 79

106

connectors 78 constant distribution 86 control panel 81 control panel interface 70 controls 11 Create block 32

D
data
raw historical 40 database in ExtendSim 27, 31 data-fitting 42 David Krahl ix delay in DESS text 25 in ExtendSim 25 design of experiments 34 DESS MM1 model 72 discrete-event concepts 23 queueing systems 45 discrete-rate models 6 distribution central tendency 40 location argument 40 shape argument 40 skewness 40 spread 40 theoretical 41 distribution fitting 57 distributions 42 beta 86 binomial 86 Cauchy 86 Chi Square 86 constant 86 continuous 43 definition 39 discrete 43 empirical 41, 42, 86 Erlang 86 exponential 86 Extreme Value Type 1A 86 Extreme Value Type 1B 86 gamma 86 geometric 87 hyperexponential 87

Hypergeometric 87 in ExtendSim 42, 86 introduction 10 inverse gaussian 87 Inverse Weibull 87 Johnson SB 87 Johnson SU 87 Laplace 87 list of, in ExtendSim 42 Logarithmic 87 Logistic 87 loglogistic 87 lognormal 87 methods for generating, in ExtendSim 41 negative binomial 87 normal 88 Pareto 88 Pearson type V 88 Pearson type VI 88 Poisson 88 Power Function 88 random 41 Rayleigh 88 triangular 88 uniform integer 88 uniform real 88 user-defined 41 using a function 42 Weibull 88

DOE 34 dynamic arrays 27

E
effective arrival rate 45 empirical distribution 42, 86 entity definition of 4 in ExtendSim 4 Equation Debugger 61 Erlang distribution 86 event calendar in ExtendSim 25 event calendaring 24 event list 24 event notice 24 event scheduling 25 evolutionary optimizer 33 Example 2.1 (Coin Tossing) 12

107

Example 2.10 (Bombing Mission) 21 Example 2.11 (Lead-Time Demand) 22 Example 2.12 (Project Simulation) 22 Example 2.2 (Random Service Times) 14 Example 2.3 (Random Arrival Times) 15 Example 2.4 (Coin Tossing) 16 Example 2.5 (The Grocery Checkout) 17 Example 2.6 (Able-Baker Call Center) 17 Example 2.7 (News Dealers Problem) 19 Example 2.8 (Refrigerator Inventory Problem) 19 Example 2.9 (Replacing Bearings in a Milling Machine) 20 Example 3.3 (Single Channel Queue) 26 Example 3.4 (Checkout-Counter) 26 Example 3.5 (Dump Truck Problem) 26 Example 4.1 (Checkout Counter) 32 Executive block 24, 32 Exit block 33 experiment (definition) 12 Experiment Results button 11 Expert Fit 58 Explain button 11 exponential distribution 86 Extend vi, 33 ExtendSim about vii applications 3 blocks 4 Case Studies & Papers 4 cloning dialog items 74 database 27 discrete-rate modeling 6 Executive block 24 full-featured versions viii getting started with 69 items 5 launching 70 limited version v, viii model structure 12 modeling capabilities viii optimizer 33 products viii Solutions Showcase 3 starting 70 User Guide vi ExtendSim AT viii

ExtendSim CP viii ExtendSim for DESS


objective of the book iii organizational structure vi other resources 83 phraseology v tutorial 69 ExtendSim LT v, viii

ExtendSim OR viii ExtendSim Suite viii Extreme Value Type 1A distribution 86 Extreme Value Type 1B distribution 86

F
factors 34

G
gamma distribution 86 geometric distribution 87 Getting Started.mox 70

H
hierarchical blocks 17, 82 hierarchy
creating a hierarchical block 82 definition 30 used in the DESS models 17

hyperexponential distribution 87 Hypergeometric distribution 87

I
in a database cell 42 interarrival time 15, 24, 48 interface 70, 81 internet 31 Inverse Gaussian distribution 87 Inverse Weibull distribution 87 item attributes 5 definition 5 index 6 preemption 25 priority 5 properties 5 quantity 5

108

Item connectors 79 ITI Healthcare 95

Monte Carlo
Coin Tossing model 12 models 9

J
Johnson SB distribution 87 Johnson SU distribution 87

N
negative binomial distribution 87 normal distribution 88 Number of Trials field 11

K
Kendalls notation 48

O
objective of this book iii Optimizer 33 other resources 83

L
Laplace distribution 87 library definition 77 opening 77 limited version of ExtendSim v, viii linear congruential generators (LCGs) 51 linked list 27 list (definition) 24 location of distribution 40 Logarithmic distribution 87 Logistic distribution 87 loglogistic distribution 87 lognormal distribution 87 LT version of ExtendSim v, viii

P
parameters
arguments 40 Pareto distribution 88 Pearson type V distribution 88 Pearson type VI distribution 88 performance measures 48, 63 Period of Integrated Environments 30 phraseology v Poisson distribution 88 Power Function distribution 88 preemption 25 processing shutting down 25 time 25 properties definition 5

M
Mean & Variance block 63 measures of performance 63 model controls 11 creating in ExtendSim 76 DESS MM1 72 interface 81 responses 16 structure 12 using an ExtendSim 69 validation 60 verification 59 Model Interface block 81 models agent-based 7 discrete-rate 6 Monte Carlo 9 types 6

Q
queue
behavior 46 characteristics 45 definition 24 discipline 46 input parameters 45 list 24 sorting 46

Queue block 32 queueing notation 48 queueing systems 45

109

R
random distributions 41 random number generator 51 random numbers random number generator 10, 51 seed 10 Random Numbers dialog 52 random seed 10 RandomCalculate function 42 Rayleigh distribution 88 reductio-ad-absurdum 59 responses 34 Results tab 33 Results Table button 11 RNG 51 Robin Clark ix Run Experiment button 11 run parameters (setting) 77 Run Trial button 11

selecting 31 skewness of distribution 40 spread of distribution 40 StatFit 42, 57 Statistics block 63 system components of 4 performance measures 48 system capacity 46

T
time between arrivals (TBA) 15, 24 trace files 60 trial (definition) 12 triangular distribution 88 tutorial for ExtendSim 69

U
Uniform Integer distribution 88 Uniform Real distribution 88 used in a title v User Guide as eBook vi user interface 70, 81

S
Scenario Manager 34 scenarios 34 scripting 31 seed 10 server multiple 17 single 17 service mechanism 46 service time 25, 48 set 24 Set Random Seed To checkbox 12 shape of distribution 40 shutdown 25 simulation clock times 16 controls 11 duration 25 model responses 16 stopping 25 uses for vii why use vii world views 25 Simulation Setup command 52 simulation software 29 history 30

V
validation 60 Value connectors 79 verification 59

W
wait time 25 web-based modeling 31 Weibull distribution 88 workshop I 89 workshop II 95 world views 25

110

Vous aimerez peut-être aussi