extendsim for dess textbook

124

Upload: lavizon

Post on 26-Oct-2014

624 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: ExtendSim for DESS Textbook
Page 2: ExtendSim for DESS Textbook
Page 3: ExtendSim for DESS Textbook

3

ExtendSim for DESS

ExtendSim®

for

Discrete-Event System Simulation

The companion to “Discrete-Event System Simulation” – 5th editionby Banks, Carson, Nelson, and Nicol

David KrahlImagine That Inc.

Robin ClarkThe Quantitative Modeling & Training Group

ExtendSim 8 EditionImagine That Inc.San Jose

Page 4: ExtendSim for DESS Textbook

4

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 re-trieval 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 publisher’s Rights and Per-missions Department at the address below.

TrademarksImagine That!, the Imagine That logo, ExtendSim, Extend, and ModL are either registered trade-marks 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 Win-dows is a trademark of Microsoft Corporation. All other names used in this publication are the trade-marks of their respective owners.

Multimedia version and license agreementThe ExtendSim software described in this publication is furnished under a separate license agree-ment 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 lim-itation, all copyrights in the ExtendSim software shall at all times remain the property of Imagine That Inc. or its Licensors.

Published byImagine That Inc.6830 Via Del Oro, Suite 230San Jose, CA 95119 USAwww.ExtendSim.com

ISBN: 978-0-9825040-2-4

Page 5: ExtendSim for DESS Textbook

Contents

Preface

How to Use This Book

About ExtendSim

About the Authors

Part I Introduction to Discrete Event System Simulation

1 Introduction to Simulation ............................................................................................31.5 Some Recent Applications of Simulation........................................................................................31.7 Components of a System .................................................................................................................41.10 Types of Models ............................................................................................................................6

2 Simulation Examples [] ..................................................................................................92.1 The Basics of [] Simulation .............................................................................................................102.2 A Coin Tossing Game......................................................................................................................162.3 Queueing Simulation []....................................................................................................................172.4 Inventory Simulation []....................................................................................................................182.5 Other Examples of Simulation.........................................................................................................20

3 General Principles ..........................................................................................................233.1 Concepts in Discrete-Event Simulation...........................................................................................233.2 List Processing.................................................................................................................................27

4 Simulation Software .......................................................................................................294.1 History of Simulation Software .......................................................................................................304.2 Selection of Simulation Software ....................................................................................................31

Page 6: ExtendSim for DESS Textbook

ii Table of Contents

4.3 An Example Simulation...................................................................................................................314.7 Simulation Environments ................................................................................................................334.8 Experimentation and Statistical-Analysis Tools ..............................................................................33

Part II Mathematical and Statistical Models

5 Statistical Models in Simulation ....................................................................................395.1 Review of Terminology and Concepts.............................................................................................395.2 Useful Statistical Models .................................................................................................................405.3 Discrete Distributions ......................................................................................................................435.4 Continuous Distributions .................................................................................................................43

6 Queueing Models ...........................................................................................................456.1 Characteristics of Queueing Systems ..............................................................................................456.2 Queueing Notation...........................................................................................................................486.3 Long-Run Measures of Performance...............................................................................................48

Part III Random Numbers

7 Random-Number Generation ........................................................................................517.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.....................................................5910.1 Model Verification .........................................................................................................................5910.2 Model Validation............................................................................................................................60

11 Absolute Performance ..................................................................................................63

12 Relative Performance....................................................................................................65

Part V Appendices

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

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

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

D ITI Healthcare ED ........................................................................................................95D.1 Process Layout ................................................................................................................................96D.2 Scope & Model Assumptions .........................................................................................................96D.3 Assignment .....................................................................................................................................102

Page 7: ExtendSim for DESS Textbook

Preface

The objective of this book is to complement and supplement the fifth edition of the textbook Dis-crete-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 mas-ter-level graduates, the DESS book provides an in-depth discussion of the important aspects of dis-crete-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 envi-ronment, 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 variabil-ity, and especially for analyzing and presenting results, it has severe limitations as a basis for simu-lation 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 teach-ing two types of courses:

1. Introductory simulation courses in engineering, computer science, and management2. A second course in simulation, when outside projects are added to the textbook material

Page 8: ExtendSim for DESS Textbook

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

Page 9: ExtendSim for DESS Textbook

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 stu-dent 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”.

Page 10: ExtendSim for DESS Textbook

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 dis-cussed 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 Extend-Sim” on page 69 or view the Tutorial video (accessed through the DESS QuickStart) before build-ing 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 Extend-Sim\Documentation folder. The store at www.ExtendSim.com/store/ also has printed ver-sions 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.

Page 11: ExtendSim for DESS Textbook

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 mod-els. (The four products are described in “ExtendSim packages” on page viii.) The ExtendSim prod-ucts 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, analyz-ing 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

Page 12: ExtendSim for DESS Textbook

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 gov-

ernmental 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.

Page 13: ExtendSim for DESS Textbook

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, sup-port, development, and technical sales. He has worked extensively with a range of simulation pro-grams 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 addi-tion, 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 envi-ronment. 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 Roches-ter Institute of Technology. He is a member of the Institute of Industrial Engineers (IIE) and INFORMS. His email address is [email protected].

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 pro-cesses, his primary passion is teaching and mentoring students. He has developed several web-based and face-to-face simulation courses including graphical simulation databases, simulation development environments, rate-based modeling, and simulation modeling for health care. In the

Page 14: ExtendSim for DESS Textbook

x About the Authors

last 8 years he has trained over 400 beginner and advanced simulation students to use the Extend-Sim 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: [email protected].

Page 15: ExtendSim for DESS Textbook

Part IIntroduction to Discrete Event System Simulation

Page 16: ExtendSim for DESS Textbook

2 Introduction to Discrete Event System Simulation

Page 17: ExtendSim for DESS Textbook

1Introduction 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.

Page 18: ExtendSim for DESS Textbook

4Components 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 text’s 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.

BlocksIn 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 inter-face with other blocks and are attached to a block’s 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 block’s dialog is accessed by double-clicking the block’s icon. The dialog of the Queue block is shown below.

Page 19: ExtendSim for DESS Textbook

5Components 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

ItemsItems are the “things” that are passed between blocks in discrete-event models. An item is an indi-vidual 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, trans-formed, 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 cus-tomer, 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 differ-ence is that for ExtendSim an attribute is just one of several types of properties.

ItemsItems 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 item’s 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-

Page 20: ExtendSim for DESS Textbook

6Types 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.

BlocksEach 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.

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 mod-eling. 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 dis-crete-event modeling.

ExtendSim discrete-rate models are a unique third type of modeling that combines the rate-based 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

Table 1.1 Entities and Attributes in ExtendSim

Blocks Items

Object Fixed Mobile

Attributes Dialog values Properties and attributes

Examples Activity (machine), Queue (waiting line) Parts, people

Page 21: ExtendSim for DESS Textbook

7Types 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 mecha-nism 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 simula-tions, 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 model’s artifi-cial 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 glo-bal 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 over-sight of calculations is unique to ExtendSim; it preserves mass balance while resolving contentions when flows are merged or diverged, such as in feedback loopsI☞ Discrete-rate modeling is available in the ExtendSim AT and ExtendSim Suite products, as

well as the ExtendSim LT version..

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-

Table 1.2 Types of Models

Modeling Method What is Modeled Examples

Continuous Processes Chemical, geological, economic, and biological systems

Discrete-Event Individual items Traffic, equipment, people, work product, data, messages

Discrete-Rate Flows of stuff Homogeneous products (powders, fluids, oil, and gas), high-speed or high-volume production and packaging, mining, data feeds and streams

Page 22: ExtendSim for DESS Textbook

8Types 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 inter-action, contextual and spatial awareness, and the ability to learn. The object of agent-based model-ing 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-pro-grammed; 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 informa-tion about block dialog values and data table settings

• Message sending functions can use the results of inter-block communications to send mes-sages 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 Ani-mation; 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. Mönch, 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.

Page 23: ExtendSim for DESS Textbook

2Simulation Examples []

The DESS text uses Excel-based examples as a convenient and familiar method to introduce simu-lation 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 simu-lation tool to teach/learn simulation concepts. Notice that ExtendSim can comfortably be used not only for Chapter 2’s 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 chap-

ter 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\Exam-ples\DESS Book.

Page 24: ExtendSim for DESS Textbook

10The 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 block’s 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 distri-butions, 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. Double-clicking a hierarchical block reveals the other blocks that have been used to create it.

Page 25: ExtendSim for DESS Textbook

11The Basics of [] Simulation

Opening and running an example modelThe default location for the example models for this chapter is ExtendSim\Examples\DESS Text-book\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 controlsNo 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 tri-als entered in the Number of Trials field, discussed below. Unless a seed is used, the exper-iment 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.

Page 26: ExtendSim for DESS Textbook

12The Basics of [] Simulation

• Animation On. Controls whether 2D animation runs while the simulation is running. Run-ning with animation on provides a more visually descriptive representation of what is hap-pening 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 exe-cuted. (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 structureThe ExtendSim models are designed to illustrate the examples of the DESS text. While dis-

crete-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 record-ing 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.

Page 27: ExtendSim for DESS Textbook

13The 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.

Page 28: ExtendSim for DESS Textbook

14The 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 ser-vice 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.

Page 29: ExtendSim for DESS Textbook

15The 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 Execu-

tive block’s 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 soft-ware 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

Page 30: ExtendSim for DESS Textbook

16A 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 calcu-lated 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 Uni-form 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 Block’s Table Displaying Results of 10 Coin Tosses

Page 31: ExtendSim for DESS Textbook

17Queueing 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 simu-lation 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. Typi-cally there would only be a few blocks in a model of this type and they would not be hierarchi-cal. 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 ran-dom 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 Chan-

nel 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,

Page 32: ExtendSim for DESS Textbook

18Inventory 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 Gro-cery 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 fre-quent purchases. Each alternative has its associated costs such as carrying costs, loss of volume dis-counts, loss of good will when customers experience shortages, and so forth. The following examples examine inventory systems and policies.

Page 33: ExtendSim for DESS Textbook

19Inventory Simulation []

2.4.1 Simulating the News Dealer’s Problem

In Example 2.7:The News Dealer’s 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 Dealer’s 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 characteris-

tic of each day, it is a discrete-event model. The system could also have been simulated as a contin-uous 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 exam-ple, 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 daysThe 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

Page 34: ExtendSim for DESS Textbook

20Other 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 com-pares 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

Page 35: ExtendSim for DESS Textbook

21Other Examples of Simulation

person items are unbatched from each other. The bearings begin another time between fail-ure 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 depot’s perim-eter. 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 infor-mation 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

Page 36: ExtendSim for DESS Textbook

22Other 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 backo-rders 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 Informa-tion 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

Page 37: ExtendSim for DESS Textbook

3General 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 time—those points when an event occurs.” Chapter 3 of the DESS text explains:

• The concepts underlying all discrete-event software• Event scheduling• The modeler’s 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 dif-ferences are discussed below.

Page 38: ExtendSim for DESS Textbook

24Concepts in Discrete-Event Simulation

EntitiesAs 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.

AttributesExtendSim 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.

ListIn 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 repre-sented by the Queue block. Depending on the sort method chosen in the Queue’s dialog, items can be ordered as first in, first out; last in, first out; or based on an item’s 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 infor-mation 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 in“List Processing” on page 27.

Event notice and event listExtendSim 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 Cre-ate 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 Executive’s 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.

ActivityThe 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.

Page 39: ExtendSim for DESS Textbook

25Concepts 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 block’s Process tab and can be specified by a distribution or a constant, taken from the arriving item’s 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 block’s 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.

DelayThis 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 block’s 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 actu-ally 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 text’s 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 develop-ing a model:

• Event scheduling• Process interaction• Activity scanning

☞ Discrete-event modeling in ExtendSim directly supports the process-interaction world view.

Page 40: ExtendSim for DESS Textbook

26Concepts 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 inter-action 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 modelsThe location for this chapter’s 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 Executive’s Count connectorSelect Stop simulation at: end time on the Executive’s Control tabSet 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.

Page 41: ExtendSim for DESS Textbook

27List 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 point-ers 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 item’s index – which is used to look up the item’s information. The stored information includes an item’s attributes, pri-ority, 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 man-age 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 fig-ure “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.

Page 42: ExtendSim for DESS Textbook

28List Processing

Page 43: ExtendSim for DESS Textbook

4Simulation 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 cre-ate custom components.The simulation environment category can be further divided into:• General purpose simulation environments. These packages supply components for general-

purpose discrete event model building. While not oriented to any vertical market, they usu-ally 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 manufac-turing 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 model-building. Examples include flight and training simulators.

Page 44: ExtendSim for DESS Textbook

30History 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 simula-tion programs have 3D animation capabilities, their models operate properly even if 3D ani-mation 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 soft-ware’s 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 devel-opers of the simulation software. This allows modelers to seamlessly extend the base simula-tion 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. Mod-ern 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. Hierar-chy 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

Page 45: ExtendSim for DESS Textbook

31Selection 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 model’s 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 environ-ments, 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 capabil-ity, 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 simu-lation 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 modelsThe default location for these following examples is ExtendSim\Examples\DESS Textbook\Chap-ter 4. You can also open the models using the DESS QuickStart file as discussed on page 71.

Page 46: ExtendSim for DESS Textbook

32An 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 Extend-Sim this model is constructed using just five blocks.

ExecutiveControls 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 block’s Total Exited output connector to the Executive block’s Count input connector.

Figure 4.1 Executive Option Where the Count Ends the Simulation

CreateCreates items randomly or by schedule. For this model, the Create block’s 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

QueueHolds 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.

ActivityDelays 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 block’s dialog.

Figure 4.3 Setting Process Time in Activity Block

Page 47: ExtendSim for DESS Textbook

33Simulation Environments

ExitRemoves 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 block’s 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 manage-ment 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.

Page 48: ExtendSim for DESS Textbook

34Experimentation 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 mod-els 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 con-venient 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 infor-mation.

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 exer-cises are given here.

Exercise 1For 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: 60In that same dialog, select Global time units: hoursIn 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 min-utes.

☞ 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 2See 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 process-ing.

Page 49: ExtendSim for DESS Textbook

35Experimentation and Statistical-Analysis Tools

Exercise 4See 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 Executive’s Count connector causes the simulation to run until exactly 500 ambulance dispatches have been completed.

Exercise 5See 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 com-plete a call.

Page 50: ExtendSim for DESS Textbook

36Experimentation and Statistical-Analysis Tools

Page 51: ExtendSim for DESS Textbook

Part IIMathematical and Statistical Models

Page 52: ExtendSim for DESS Textbook

38 Mathematical and Statistical Models

Page 53: ExtendSim for DESS Textbook

5Statistical 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 dis-tribution 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)

Page 54: ExtendSim for DESS Textbook

40Useful 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 prop-erty; 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 inves-tigator may choose to introduce probabilistic events.” This is accomplished by doing one of the fol-lowing:

• 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 advan-tages 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 miss-

ing from or overlooked during data collection. For example, distributions account for extreme or outlying values which may have been missed during typically short data-gather-ing 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 distributionsThe functions that produce a distribution have one or more parameter arguments which define and control its characteristics. The most important characteristics are a distribution’s 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 accord-ing 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.

Page 55: ExtendSim for DESS Textbook

41Useful Statistical Models

Choosing a distributionUsing 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 fit-ting 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

☞ See also the description of the ExtendSim distributions starting on page 86.

In ExtendSim

Methods for generating random distributionsExtendSim 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 block’s dialog.

2. Random distributions that are specified directly in the dialog of a block. The Activity, Cre-ate, Workstation, Select Item In, Select Item Out, and Shutdown blocks all allow the mod-eler to directly enter random information. The distributions (including an empirical or user-defined distribution), are selected using a popup menu in a block’s 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

System Random Variables Typical Distributions

Queueing Interarrival Exponential, gamma, WeibullService Exponential, gamma, Weibull, lognormal

Inventory and supply chain Units demanded Geometric, Poisson, negative binomialTime between demands Exponential, gamma, Weibull, constantLead time Gamma

Reliability and maintainability Time to failure Exponential, gamma, Weibull, normal, lognor-mal

Limited data Uniform, triangular, beta

Page 56: ExtendSim for DESS Textbook

42Useful Statistical Models

block’s 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 dis-tribution. 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 infor-mation.

☞ 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 ExtendSimExtendSim 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 Distribu-tions” on page 85.

Table 5.2 Distributions in ExtendSim

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

Beta Binomial Cauchy Chi SquaredConstant Erlang Exponential Extreme Value Type 1AExtreme Value Type 1B Gamma Geometric HyperexponentialHypergeometric Inverse Gaussian Inverse Weibull Johnson SBJohnson SU Laplace Logarithmic LogisticLog-Logistic Lognormal Negative Binomial NormalPareto Pearson type V Pearson type VI PoissonPower Function Rayleigh Triangular Uniform IntegerUniform Real Weibull

Page 57: ExtendSim for DESS Textbook

43Discrete Distributions

5.3 Discrete Distributions

Table 5.3 Typical Discrete Distributions

5.4 Continuous Distributions

Table 5.4 Typical Continuous Distributions

References

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

Bernoulli BinomialGeometric Negative binomialPoisson Empirical

Uniform ExponentialGamma ErlangNormal WeibullTriangular LognormalBeta Empirical

Page 58: ExtendSim for DESS Textbook

44Continuous Distributions

Page 59: ExtendSim for DESS Textbook

6Queueing 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 sys-tem 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

Page 60: ExtendSim for DESS Textbook

46Characteristics 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 theo-retically 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 systemsThere 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 activity’s 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

Page 61: ExtendSim for DESS Textbook

47Characteristics 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 jockeyingThese 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.1In 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.2As in Example 6.1 additional information has been added in order to make a running model. Pro-cessing times for the machines are all lognormal with the following parameters:

Table 6.1 Processing Times

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

Machine Average Process Time (seconds)

Standard Deviation (seconds)

Candy maker/wrapper 1 0.25Packer 1.1 0.30Sealer/wrapper 54 10

Page 62: ExtendSim for DESS Textbook

48Queueing Notation

6.2 Queueing Notation

Using Kendall’s 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 exam-ple 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 block’s 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 actu-ally 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 condi-tions contribute to the utilization calculation. In ExtendSim they do contribute – since the Activity’s capacity is being taken up by these conditions, it is considered “busy”.

References

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

Page 63: ExtendSim for DESS Textbook

Part IIIRandom Numbers

Page 64: ExtendSim for DESS Textbook

50 Random Numbers

Pref

ace

Page 65: ExtendSim for DESS Textbook

7Random-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 L’Ecuyer 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.

Page 66: ExtendSim for DESS Textbook

52Techniques for Generating Random Numbers

Pref

ace

• 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.

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 off-set 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 Block’s Options Tab

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

References

Pierre L’Ecuyer and Serge Cote, Implementing a Random Number Package with Splitting Facili-ties. ACM Transactions on Mathematical Software, Volume 17, Number 1, page 98-111, March 1991

Page 67: ExtendSim for DESS Textbook

8Random-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 Random-Calculate 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 distri-butions, 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.

Page 68: ExtendSim for DESS Textbook

54

Table 8.1 Equation-Based Blocks in ExtendSim

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 “Meth-ods for generating random distributions” on page 41.

References

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

Block Name Library Use

Buttons Utilities Creates a push-button interface for a model. A user-defined equa-tion is executed whenever the button is pushed.

Equation Value Outputs the results of the equations entered in its dialog. The equations can have any number of inputs and outputs.

Equation(I) Item Calculates equations when an item passes throughQueue Equation Item Queues items and releases them based on the results of user-

entered equationsQuery Equation Value (AT & Suite) A user-defined equation selects one record from an ExtendSim

database tableQuery Equation(I) Item (AT & Suite) When an item arrives, a user-defined equation selects one record

from an ExtendSim database table

Page 69: ExtendSim for DESS Textbook

Part IVAnalysis of Simulation Data

Page 70: ExtendSim for DESS Textbook

56 Analysis of Simulation Data

Page 71: ExtendSim for DESS Textbook

9Input 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 histori-cal data that documents the system’s 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 Software2. ExpertFit from Averill Law and Associates 3. JMP from SAS InstituteThese 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.

Page 72: ExtendSim for DESS Textbook

58

☞ Stat::Fit is a Windows application included with the ExtendSim AT and ExtendSim Suite prod-ucts. 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.

Page 73: ExtendSim for DESS Textbook

10Verification, 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-ad-absurdum (reducing to the absurd), which means reducing a complex model to an aggressively sim-ple 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.

Page 74: ExtendSim for DESS Textbook

60Model 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 model’s 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 struc-ture of the model should correspond to the actual system and the output statistics should appear rea-sonable. 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 simula-tion results with historical data. For example, when validating model performance compared to his-torical 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 move-ment 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 tim-ing 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.

Page 75: ExtendSim for DESS Textbook

61Model 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 his-togram, 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

Page 76: ExtendSim for DESS Textbook

62Model Validation

Page 77: ExtendSim for DESS Textbook

11Absolute 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 activ-ities 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

Page 78: ExtendSim for DESS Textbook

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

Page 79: ExtendSim for DESS Textbook

12Relative Performance

Scenario Manager

The easiest way to compare the performance of different model configurations is to use the Extend-Sim 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 alter-nate 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-

Page 80: ExtendSim for DESS Textbook

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 objec-tive 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

Page 81: ExtendSim for DESS Textbook

Part VAppendices

Page 82: ExtendSim for DESS Textbook

68 Appendices

Page 83: ExtendSim for DESS Textbook

AGetting 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 Chap-

ter 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 application2. Open an existing model3. Enter or change parameters4. Enable or disable animation5. Run the simulation

Page 84: ExtendSim for DESS Textbook

70Using an Existing Model

6. View model status and results7. 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 menuFor 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” fileIf 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

Page 85: ExtendSim for DESS Textbook

71Using 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 “Don’t 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 fileIf 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.

Page 86: ExtendSim for DESS Textbook

72Using an Existing Model

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

Figure A.2 DESS QuickStart File

☞ Although we think you will find it useful, you don’t 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 but-

tons for opening this text, viewing the tutorial videos that correspond to this chapter, and opening the example models.

Opening the DESS MM1 modelTo 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 Extend-Sim\Examples\DESS Textbook.

Page 87: ExtendSim for DESS Textbook

73Using an Existing Model

Exploring the DESS MM1 modelThe 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 aver-age 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 discrete-event 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 Queue’s L (length) out-

put 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 eas-ily 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.

Page 88: ExtendSim for DESS Textbook

74Using an Existing Model

In the block’s dialogA block’s 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 block’s processing time.

Figure A.4 Portion of Activity Block’s 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 Activity’s processing time is specified by an exponential distribution with a mean of 1

Using a cloned parameter fieldMany 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 model’s Note-book, onto the model worksheet, or within a hierarchical block’s submodel. This makes it easier to view or enter important model parameters.☞ A cloned field is a virtual copy of a field in a block’s dialog. Each clone is identical to its origi-

nating 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 anima-tion objects to something more realistic, as discussed in “Enable 2D animation (optional)” on page 80.

Page 89: ExtendSim for DESS Textbook

75Using 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 simu-lation runtime. To turn off animation, uncheck the Animation On check box on the model work-sheet. 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 simula-tion. This model is so simple it is easiest to just double-click the blocks and look at their Results

Page 90: ExtendSim for DESS Textbook

76Creating 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 don’t want to spend a long time building a

model only to have a power interruption cause you to lose everything you’ve 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 window2. Set simulation run parameters3. Open one or more libraries of blocks4. Place blocks on the model worksheet5. Connect the blocks6. Enter parameters for the blocks7. Enable 2D animation (optional)8. Clone dialog items to model worksheet (optional)9. Add a user interface (optional)10. Create a hierarchical block (optional).

Page 91: ExtendSim for DESS Textbook

77Creating 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 ModelOr use the New Model Worksheet button in the toolbarOr 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 SetupSelect the Setup tabCustomize 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, Plot-ter, and Value libraries.☞ By default, the most-used libraries will already be open when you launch ExtendSim.

If a needed library isn’t 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.

Page 92: ExtendSim for DESS Textbook

78Creating 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 library’s Library menu. To do this, give the com-

mand 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 work-sheet.

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 modelUse 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 block’s icon. Information and items flow into a block at its input connectors and out of the block at its output

Page 93: ExtendSim for DESS Textbook

79Creating a new model

connectors. Connection lines from one connector to another indicate the flow of information and items.

Connector typesConnectors on a block are visually different, depending on how they’re used. While each connec-tor’s specific purpose is described in the block’s Help, the following table describes the two main types of ExtendSim connectors.

Table A.1 Value and Item Connectors

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 connectorIf 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 block’s item output to the Queue’s item inputFrom the Queue’s item output to the Activity’s item inputFrom the Activity’s item output to the Exit’s item input

2. So that the model will display the length of the waiting line in the Queue:Connect from the Queue’s L (length) value output to the top input on the Plotter, Dis-crete Event

Type Input Output How they’re used

Value 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.

Item 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.

Page 94: ExtendSim for DESS Textbook

80Creating 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 don’t need to be changed.

Use default settingsThe 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 distri-bution 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 pro-

cessing time• The Exit counts the number of items that have left the model

Change settingsThe 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 blockIn the Activity’s Process tab, choose Delay is: specified by a distributionSelect Distribution: Exponential from the popup listEnter Mean: 1 (leave the Location blank)Close the block’s dialog

A.2.7 Save and run the model

Give the command File > Save Model and name the modelFor 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 doesn’t 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.

Page 95: ExtendSim for DESS Textbook

81Creating 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 block’s Item Animation tab, select the People object for the 2D picture, as shown to the rightIn the Queue block’s Item Animation tab:

Select Change all items to from the popup menuSelect 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 dialogSelect 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 paneDrag the pane onto the model worksheet and position it where you wantTo 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 but-tons, text, graphics, and popup menus to a model enhances its accessibility and usability. Extend-

Page 96: ExtendSim for DESS Textbook

82Creating 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 modelDouble click the Model Interface block to open its dialog, shown belowIn 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 block’s 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 rightGive the command Model > Make Selection HierarchicalIn the dialog, give the hierarchical block a name and click Make H-Block

Page 97: ExtendSim for DESS Textbook

83Other resources

A new block with a plain icon appears on the worksheet, connected to the Create and Exit blocks. Double-clicking the new block’s icon reveals the 3-block submodel it encloses. The sub-model 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 gen-eral 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.

Page 98: ExtendSim for DESS Textbook

84Other resources

Figure A.10 Toolbar Buttons

References

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

New model

Open model

Save model

Print

Cut

Copy

Paste

Undo

Zoom

NavigatorNotebook

Hide/Show connectors

RunRun Optimization or Scenarios

Stop

Pause/Continue

Step

Animation on/off

Animation faster

Animation slower

Graphics layer

Clone layer

All layers

Block/text tool

Colors

Patterns

Shapes popup menu

Shuffle graphics

Cursor position

Icon tools popup menu

Rectangle

Round rectangle

Oval

Polygon

Line

Right angle line

3D Window

Page 99: ExtendSim for DESS Textbook

BRandom Distributions

B.1 Blocks For Generating Random Numbers

ExtendSim provides several blocks that have popup lists in their dialogs for selecting a random dis-tribution and generating a random number.

Table B.1 Blocks That Generate Random Numbers

☞ 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.

Block Library

Activity ItemCreate ItemRandom Number ValueSelect Item In ItemSelect Item Out ItemShutdown ItemWorkstation Item

Page 100: ExtendSim for DESS Textbook

86Distributions 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 Description

Beta Distribution of random proportion, such as the proportion of defective items in a shipment, or time to complete a task.

Binomial The number of outcomes in a given number of trials. Most often used to express suc-cess/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.

Cauchy 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.

Chi Squared 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.

Constant 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.

Empirical 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).

Erlang Frequently used for queueing theory to represent service times for various activities or when modeling telephone traffic.

Exponential 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.

Extreme Value Type 1A

describes the limiting distribution of the greatest values of many types of samples. Used to represent parameters in growth models, astronomy, human lifetimes, radio-active 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.

Extreme Value Type 1B

Describes the limiting distribution of the least values of many types of samples. Rep-resents parameters in growth models, astronomy, human lifetimes, radioactive emis-sions, strength of materials, flood analysis, seismic analysis, and rainfall analysis.

Gamma 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.

Page 101: ExtendSim for DESS Textbook

87Distributions in ExtendSim

Geometric 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.

HyperExponential Usually used in telephone traffic and queueing theory.

Hypergeometric 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.

Inverse Gaussian 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 aggre-gates, reliability and lifetimes, and repair time.

Inverse Weibull 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.

Johnson SB Used in quality control to describe non-normal processes, which can then be trans-formed to the Normal distribution for use with standard tests. It is a continuous distri-bution that has both upper and lower finite bounds.

Johnson SU Used in quality control to describe non-normal processes, which can then be trans-formed to the Normal distribution for use with standard tests. It is an unbounded con-tinuous distribution.

Laplace Used in error analysis and to describe the difference of two independent, and equally distributed, exponentials.

Logarithmic 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.

Logistic Most often used a growth model: for populations, for weight gain, for business fail-ure, etc. Can also be used to test for the suitability of such a model, with transforma-tion 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.

Log-Logistic 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.

LogNormal 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 activi-ties. This distribution is widely used in business for security or property valuation, such as the rate of return on stock or real estate returns.

Negative Binomial Number of failures before Sth success. P specifies the probability of success.

Distribution Description

Page 102: ExtendSim for DESS Textbook

88Distributions in ExtendSim

Normal The well-known Gaussian or bell curve. Most often used when events are due to nat-ural 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.

Pareto Represents the income distribution of a society. It is also used to model many empiri-cal 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.

Pearson Type V 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.

Pearson Type VI 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.

Poisson 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 arriv-als per time unit. This corresponds to an exponential interarrival time.

Power Function 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.

Rayleigh 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.

Triangular 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.

Uniform Integer 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.

Uniform Real 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.

Weibull 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.

Distribution Description

Page 103: ExtendSim for DESS Textbook

CACME 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 sev-eral processes, such as Stamping and Assembly.

Figure C.1 Cell Layout for Stamped Steel Gear Assembly

Page 104: ExtendSim for DESS Textbook

90Details

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 process’s input and/or out-put. The number on a bin is that buffer’s 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 customer’s 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 pal-lets and route them directly to the Stamping process. (Note: Don’t 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!)

Page 105: ExtendSim for DESS Textbook

91The 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

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

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 pro-cess 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 accom-plished 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 bot-tleneck 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.

Process Service Time per Pallet (minutes)

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

Process Product Failure Rates

Inspection #1 95% Pass & 5% FailInspection #2 95% Pass & 5% Fail

Page 106: ExtendSim for DESS Textbook

92Hints

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 addi-tion 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 illustra-tion 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 Sta-tistics 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.

Page 107: ExtendSim for DESS Textbook

93Hints

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.

Page 108: ExtendSim for DESS Textbook

94Hints

Page 109: ExtendSim for DESS Textbook

DITI 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 satis-fied 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 sim-ulation model could test changes without actually touching the real system. The administration is intrigued and has asked us to help.

Page 110: ExtendSim for DESS Textbook

96Process Layout

D.1 Process Layout

The actual layout of the ED can be seen in the illustration below.

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

Fast Track (FT)

Waiting Room

Triage

Registration

Room 1 Room 2 Room 3 Room 4 Room 5

Room 18

RM6

RM7

RM 8

RM 9

RM10

RM11

RM12

RM13

RM14

RM15

RM16

RM17

Room 19Room 20Room 21Room 22Room 23Room 24

FT 4

FT 5

FT 6

FT1

FT 2

FT 3

Nurse Station Meds

Nurse Station Supplies

Page 111: ExtendSim for DESS Textbook

97Scope & 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

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.

Time Inter-Arrival Rate (minutes) Time Inter-Arrival Rate (minutes)

12:00 Midnight 60 12:00 Noon 151:00 AM 60 1:00 PM 152:00 AM 60 2:00 PM 153:00 AM 60 3:00 PM 154:00 AM 60 4:00 PM 155:00 AM 60 5:00 PM 156:00 AM 60 6:00 PM 57:00 AM 60 7:00 PM 58:00 AM 60 8:00 PM 59:00 AM 60 9:00 PM 1510:00 AM 15 10:00 PM 1511:00 AM 15 11:00 PM 60

Page 112: ExtendSim for DESS Textbook

98Scope & Model Assumptions

D.2.3 Triage and registration processes

After arriving, patients go through triage and registration. There is one triage station and three reg-istration 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

☞ 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 don’t 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 HoursThe 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.

Process Time (minutes) Capacity

Triage Lognormal (3,2) 1 stationRegistration Lognormal (9,7) 3 stations

Page 113: ExtendSim for DESS Textbook

99Scope & 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 ProcessAfter 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.

Page 114: ExtendSim for DESS Textbook

100Scope & 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 num-ber of patients can go through this process at the same time.

☞ After the patient is seen by the nurse, the Select Item Out block can be used to split the patient flow so that 50% will have either lab or radiology and the other 50% will not.

☞ At the end of the process for the Main ED, the Select Item In block can be used to join the patient flow going into the disposition process.

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

D.2.8 Doctor and Nurse Schedules

Fast TrackIn 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.

Process Area Process Time (minutes)

Doctor evaluation time Fast Track Lognormal (15, 5)Nurse time Fast Track Lognormal (15, 5)Doctor evaluation time Main ED Lognormal (20, 5)Nurse time Main ED Lognormal (20, 5)Doctor evaluation time #2 (follow-up) Main ED Lognormal (15, 5)Lab/Radiology Main ED Weibull (90 scale, 2 shape, 20 location)

Page 115: ExtendSim for DESS Textbook

101Scope & Model Assumptions

Main EDThe 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

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 await-ing 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

Time Doctor Nurse

12 midnight - 6am 1 16am - 12 noon 2 212 noon - 6pm 2 26pm - 12 midnight 2 2

Page 116: ExtendSim for DESS Textbook

102Assignment

After a patient leaves the ED, whether by being discharged or admitted, their bed is immedi-ately 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

☞ 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 equip-

ment 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. How-ever 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

Process Process Time Time Units

Discharge time Lognormal (20, 6) MinutesWaiting for a hospital bed Lognormal (7, 3) Hours

Time Inter-Arrival Rate(minutes) Time Inter-Arrival Rate

(minutes)

12:00 Midnight 30 12:00 Noon 7.51:00 AM 30 1:00 PM 7.52:00 AM 30 2:00 PM 7.53:00 AM 30 3:00 PM 7.54:00 AM 30 4:00 PM 7.55:00 AM 30 5:00 PM 7.56:00 AM 30 6:00 PM 2.5

Page 117: ExtendSim for DESS Textbook

103Assignment

7:00 AM 30 7:00 PM 2.58:00 AM 30 8:00 PM 2.59:00 AM 30 9:00 PM 7.510:00 AM 7.5 10:00 PM 7.511:00 AM 7.5 11:00 PM 30

Time Inter-Arrival Rate(minutes) Time Inter-Arrival Rate

(minutes)

Page 118: ExtendSim for DESS Textbook

104Assignment

Page 119: ExtendSim for DESS Textbook

Index

Aabsolute performance 63ACME Steel 89activity

arrival process 46as delay in ExtendSim 25definition of in DESS text 24

Activity block 32agent-based models 7animation (2D) 74Animation On checkbox 12applications of ExtendSim 3arguments for distributions 40arrays

definition 27dynamic 27

arrival process 46arrival rate 45arrival rate (effective) 45attribute

definition 5of blocks 6

authorsDavid Krahl ixRobin Clark ix

Bbeta distribution 86binomial distribution 86block

attributes 6connection lines 79connectors 78definition 4

Ccalling population 45case studies 3Cauchy distribution 86central tendency of distribution 40chain 24Chi Square distribution 86clock times 16clone

definition 74how to create 81

confidence interval 63connection lines 79connector

Item 79types 79Value 79

Page 120: ExtendSim for DESS Textbook

106

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

Ddata

raw historical 40database in ExtendSim 27, 31data-fitting 42David Krahl ixdelay

in DESS text 25in ExtendSim 25

design of experiments 34DESS MM1 model 72discrete-event

concepts 23queueing systems 45

discrete-rate models 6distribution

central tendency 40location argument 40shape argument 40skewness 40spread 40theoretical 41

distribution fitting 57distributions 42

beta 86binomial 86Cauchy 86Chi Square 86constant 86continuous 43definition 39discrete 43empirical 41, 42, 86Erlang 86exponential 86Extreme Value Type 1A 86Extreme Value Type 1B 86gamma 86geometric 87hyperexponential 87

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

DOE 34dynamic arrays 27

Eeffective arrival rate 45empirical distribution 42, 86entity

definition of 4in ExtendSim 4

Equation Debugger 61Erlang distribution 86event calendar

in ExtendSim 25event calendaring 24event list 24event notice 24event scheduling 25evolutionary optimizer 33Example 2.1 (Coin Tossing) 12

Page 121: ExtendSim for DESS Textbook

107

Example 2.10 (Bombing Mission) 21Example 2.11 (Lead-Time Demand) 22Example 2.12 (Project Simulation) 22Example 2.2 (Random Service Times) 14Example 2.3 (Random Arrival Times) 15Example 2.4 (Coin Tossing) 16Example 2.5 (The Grocery Checkout) 17Example 2.6 (Able-Baker Call Center) 17Example 2.7 (News Dealer’s Problem) 19Example 2.8 (Refrigerator Inventory Problem)

19Example 2.9 (Replacing Bearings in a Milling

Machine) 20Example 3.3 (Single Channel Queue) 26Example 3.4 (Checkout-Counter) 26Example 3.5 (Dump Truck Problem) 26Example 4.1 (Checkout Counter) 32Executive block 24, 32Exit block 33experiment (definition) 12Experiment Results button 11Expert Fit 58Explain button 11exponential distribution 86Extend vi, 33ExtendSim

about viiapplications 3blocks 4Case Studies & Papers 4cloning dialog items 74database 27discrete-rate modeling 6Executive block 24full-featured versions viiigetting started with 69items 5launching 70limited version v, viiimodel structure 12modeling capabilities viiioptimizer 33products viiiSolutions Showcase 3starting 70User Guide vi

ExtendSim AT viii

ExtendSim CP viiiExtendSim for DESS

objective of the book iiiorganizational structure viother resources 83phraseology vtutorial 69

ExtendSim LT v, viiiExtendSim OR viiiExtendSim Suite viiiExtreme Value Type 1A distribution 86Extreme Value Type 1B distribution 86

Ffactors 34

Ggamma distribution 86geometric distribution 87Getting Started.mox 70

Hhierarchical blocks 17, 82hierarchy

creating a hierarchical block 82definition 30used in the DESS models 17

hyperexponential distribution 87Hypergeometric distribution 87

Iin a database cell 42interarrival time 15, 24, 48interface 70, 81internet 31Inverse Gaussian distribution 87Inverse Weibull distribution 87item

attributes 5definition 5index 6preemption 25priority 5properties 5quantity 5

Page 122: ExtendSim for DESS Textbook

108

Item connectors 79ITI Healthcare 95

JJohnson SB distribution 87Johnson SU distribution 87

KKendall’s notation 48

LLaplace distribution 87library

definition 77opening 77

limited version of ExtendSim v, viiilinear congruential generators (LCGs) 51linked list 27list (definition) 24location of distribution 40Logarithmic distribution 87Logistic distribution 87loglogistic distribution 87lognormal distribution 87LT version of ExtendSim v, viii

MMean & Variance block 63measures of performance 63model

controls 11creating in ExtendSim 76DESS MM1 72interface 81responses 16structure 12using an ExtendSim 69validation 60verification 59

Model Interface block 81models

agent-based 7discrete-rate 6Monte Carlo 9types 6

Monte CarloCoin Tossing model 12models 9

Nnegative binomial distribution 87normal distribution 88Number of Trials field 11

Oobjective of this book iiiOptimizer 33other resources 83

Pparameters

arguments 40Pareto distribution 88Pearson type V distribution 88Pearson type VI distribution 88performance measures 48, 63Period of Integrated Environments 30phraseology vPoisson distribution 88Power Function distribution 88preemption 25processing

shutting down 25time 25

propertiesdefinition 5

Qqueue

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

Queue block 32queueing notation 48queueing systems 45

Page 123: ExtendSim for DESS Textbook

109

Rrandom distributions 41random number generator 51random numbers

random number generator 10, 51seed 10

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

SScenario Manager 34scenarios 34scripting 31seed 10server

multiple 17single 17

service mechanism 46service time 25, 48set 24Set Random Seed To checkbox 12shape of distribution 40shutdown 25simulation

clock times 16controls 11duration 25model responses 16stopping 25uses for viiwhy use viiworld views 25

Simulation Setup command 52simulation software 29

history 30

selecting 31skewness of distribution 40spread of distribution 40StatFit 42, 57Statistics block 63system

components of 4performance measures 48

system capacity 46

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

UUniform Integer distribution 88Uniform Real distribution 88used in a title vUser Guide as eBook viuser interface 70, 81

Vvalidation 60Value connectors 79verification 59

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

Page 124: ExtendSim for DESS Textbook

110