ch. 3 simulation software. programming of discrete-event simulation models generating random...

23
Ch. 3 Simulation Software

Upload: lizbeth-cunningham

Post on 23-Dec-2015

237 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

Ch. 3 Simulation Software

Page 2: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

Programming of discrete-event simulation models

• Generating random numbers, that is, observations from a U(0,1) probability distribution

• Generating random variates from a specified probability distribution (e.g., exponential)

• Advancing simulated time• Determining the next event from the event list and

passing control to the appropriate block of code• Adding records to, or deleting records from, a list• Collecting output statistics and reporting the results• Detecting error conditions

Page 3: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

Advantages of Using a Simulation Package

• Simulation packages automatically provide most of the features needed to build a simulation model, resulting in a significant decrease in “programming” time and a reduction in overall project cost.

• They provide a natural framework for simulation modeling. Their basic modeling constructs are more closely akin to simulation than are those in a general-purpose programming language like C.

• Simulation models are generally easier to modify and maintain when written in a simulation package.

• They provide better error detection because many potential types of errors are checked for automatically. Since fewer modeling constructs need to be included in a model, the chance of making an error will be probably smaller.

Page 4: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

Advantages of Using General-Purpose Programming Language

• Most modelers already know a programming language, but this is often not the case with a simulation package.

• A simulation model efficiently written in C or C++ may require less execution time than a model developed in a simulation package. This is so because a simulation package is designed to address a wide variety of systems with one set of modeling constructs, whereas a C program can be more closely tailored to a particular application. This consideration has, however, become less important with the availability of inexpensive, high-speed PCs.

• Programming languages may allow greater programming flexibility than certain simulation packages.

• Software cost is generally lower, but total project cost may not be.

Page 5: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

3.3 Classification of Simulation Software

• General-purpose Versus Application-Oriented Simulation Packages

• Modeling approaches

• Common Modeling Elements

Page 6: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

3.3.1 General-purpose Versus Application-Oriented Simulation Packages

• Historically, – simulation languages – application-oriented simulators.

• Advances: – simulation languages: employing graphical model-building approach

such as icons, dialog boxes– Simulators: allowing programming in certain model locations using an

internal pseudo-language. • Modify existing modeling constructs• Create new constructs

• Recently, – general-purpose simulation packages: Arena, Extend– application-oriented simulation packages: Manufacturing,

Communications Networks, Process Reengineering and Services, Health Care, Call Centers, Animation (standalone)

Page 7: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

3.3.2 Modeling Approaches• Event-scheduling approach

1. Identify characteristic events2. Write a set of event routines 3. Execute events (no simulated time passes during

its execution)

• Process approach– A process is a time-ordered sequence of

interrelated events separated by intervals of time, which describes the entire experience of an “entity” as it flows through a “system”.

Page 8: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

Process Approach

Timex x x

Entityarrives

Entity beginsservice

Entity completesservice

Possiblepassage of time

in queue

Possible of timefor serving

of entity

Event “Event” Event

FIGURE 3.1Process describing the flow of an entity through a system

Page 9: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

Process Approach

Routinecustomer

Schedule an arrivalevent for the nextcustomer entity

Isthe server

idle ?

Place thiscustomer entity

in the queue

Wait until selectedfor service

Remove thiscustomer entityfrom the queue

Make the server busy

Schedule a departureevent for the nextcustomer entity

Wait until service is completed

Make the server idle

Termination of this customer entity

Return

FIGURE 3.2Prototype customer-process routine for a single-server queueing system.

1

32

4

5

6

7

8

9

10

No

Yes

Passage ofsimulation time

Passage ofsimulation time

Arrival event

Departure event

Page 10: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

3.3.3 Common Modeling Elements

Type of system Entities Attributes Resources Queues

Manufacturing Part Part number, due date

Machines, workers

Queues or buffers

Communications Message Destination, message length

Nodes, links Buffers

Airport Airplane Flight number, weight

Runways, gates Queues

Insurance agency Application, claim

Name, policy number, amount

Agents, clerks Queues

Page 11: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

3.4 Desirable Software Features

• General capabilities (including modeling flexibility and ease of use)

• Hardware and software considerations

• Animation

• Statistical features

• Customer support and documentation

• Output reports and plots

Page 12: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

3.4.1 General capabilitiesmodeling flexibility

• Ability to define and change attributes for entities and also global variables, and to use both in decision logic (e.g., if-then-else constructs)

• Ability to use mathematical expressions and mathematical functions (logarithms, exponentiation, etc.)

• Ability to create new modeling constructs and to modify existing ones, and to be able to use the new or modified modeling constructs in current and future models

Page 13: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

3.4.1 General capabilitiesease of use

• Graphical user interface• Modeling constructs (e.g. icons or blocks) that are neither too

“primitive” nor too “macro”• Tabs in dialog boxes can help manage a large number of

options• Hierarchy allows a user to combine several basic modeling

constructs into a new higher-level construct. (reuse)• Debugging aids

– Follow a single entity through the model to see if it is processed correctly

– See the state of the model every time a particular event occurs (e.g., a machine breakdown)

– Set the value of certain attributes or variables to “force” an entity down a logical path that occurs with small probability

Page 14: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

3.4.1 General capabilitiesease of use

• Fast model execution speed• User-friendly model “front ends”• Run-time version

– Running new or existing scenarios for a model built by an internal or external consultant– Sales tool for equipment suppliers or system integrators– Training

• Import data from (and export data to) other applications (e.g., an Excel spreadsheet or a database)

• Automatically simulate different scenarios that iterate on some model parameter (e.g., the number of machines in a work station for a factory)

• Combined discrete-continuous simulation• External routines• Easily initialized in a nonempty and idle state• The state of a simulation can be saved at the end of a run• Cost

– From $500 to $50,000– Other costs: maintenance fees, upgrade fees, additional hardware and software, etc.

Page 15: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

3.4.2 Hardware and Software Requirements

• Computer platforms: Windows based PCs, UNIX workstations, Apple computers

• Required RAM: 128Mb

• Operating systems: Windows 98, Windows NT, UNIX

Page 16: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

3.4.3 Animation and Dynamic Graphics

• Uses of animation– Communicating the essence of a simulation model (or

simulation itself) to a manager or to other people who may not be aware of (or care about) the technical details of the model

– Debugging the simulation program– Showing that a simulation model is not valid– Suggesting improved operational procedures for a system

(some things may not be apparent from looking at just the simulation’s numerical results)

– Training operational personnel– Promoting communication among the project team

Page 17: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

3.4.3 Animation and Dynamic Graphics

• Types of animations– Concurrent animation– Post-processed

• Desirable features for animation– Default animation– Library of standard icons– Smooth movement of icons– Control to speed up or slow down the animation– Zoom and pan, named animation views– Vector-based graphics (pictures are drawn with lines, arcs, and fills) rather than

pixel-based graphics– 3-D animation– Import CAD drawings and clip art – Dynamic graphics and statistics: clocks, dials, level meters, dynamically

update a histograms, time plots, etc.

Page 18: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

3.4.4 Statistical capabilities

• Good random number generator– At least 100 different streams that can be assigned to different sources

of randomness– Same results on different executions– Theoretical distributions

• Continuous: exponential, gamma, Weibull, lognormal, normal, uniform, triangular, beta

• Discrete: binomial, geometric, negative binomial, Poisson, discrete uniform

– Empirical distribution• Independent replications (or runs)

– Each runs uses separate sets of different random numbers– Each run uses the same initial conditions– Each run resets the statistical counters

Page 19: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

3.4.4 Statistical capabilities

• A statistically sound method available for constructing a confidence interval for a mean

• Warmup period

• Allow the user to specify what performance measures to collect output data on

• Optimization

Page 20: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

3.4.5 Customer Support and Documentation

• Public and customized training at the client’s site• Good technical support for questions (tel. help)• Good documentation

– User’s guide or reference manual, numerous detailed examples, context-dependent online help, library of mini examples

– Detailed description of how each modeling construct works– Free demo disk– Free trail– Newsletter, yearly user’s conference– Regular updates of the software

Page 21: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

3.4.6 Output Reports and Graphics

• Standard reports for the estimated performance measures

• Customize reports• Histogram• Time plot• Database • Correlation plot• Export individual model output observations to other

software packages for further analysis and display. (spreadsheets, databases, statistics packages, and graphical packages)

Page 22: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

3.5 General-purpose Simulation Packages

• ARENA, Extend, MODSIM III,

Page 23: Ch. 3 Simulation Software. Programming of discrete-event simulation models Generating random numbers, that is, observations from a U(0,1) probability

3.6 Object-oriented Simulation

Advantages :• It promotes code reusability • It helps manage complexity• It makes model changes easier • It facilitates large projects with several

programmers. Disadvantages:• Some O-O simulation packages may have a

steep learning curve.• One must do many projects and reuse objects

to achieve its full benefits.