Top Banner
QSIM Application Discrete Event Queueing Simulation Release 6.11 Win32s, OS/2, Sun Solaris 1 & 2, HPUX, AIX
115

QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

Jun 24, 2018

Download

Documents

buikhanh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

QSIM ApplicationDiscrete Event Queueing Simulation

Release 6.11Win32s, OS/2, Sun Solaris 1 & 2, HPUX, AIX

Page 2: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the
Page 3: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

QSIM ApplicationDiscrete Event Queueing Simulation

Release 6.11Win32s, OS/2, Sun Solaris 1 & 2, HPUX, AIX

Marc-david CohenPhil Meanor

SAS Institute, Inc., SAS Campus DriveCary, NC 27513, USA(919) 677-8000 [email protected]

PRELIMINARY DRAFT

May 1995

This material is a preliminary draft, and SAS Institute Inc. makes no warrantyabout the accuracy of this document. The Institute is not responsible for errorsin the text or for any discrepancies between this documentation and the product

described as it now exists or as it will exist.

Page 4: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the
Page 5: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

Contents

1 Getting Started 1

Invoking QSIM : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 2

User Interface : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 2

A Simple M/M/1 Queueing Model : : : : : : : : : : : : : : : : : : : : : : 8

Queueing : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 9

Service : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 9

Statistics : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 9

2 Building a Model with Elementary Components 11

Elementary Components : : : : : : : : : : : : : : : : : : : : : : : : : : : 11

Source Components : : : : : : : : : : : : : : : : : : : : : : : : : : 12

Server Components : : : : : : : : : : : : : : : : : : : : : : : : : : 14

Queue Components : : : : : : : : : : : : : : : : : : : : : : : : : : 16

Logic Components : : : : : : : : : : : : : : : : : : : : : : : : : : : 18

Holder Components : : : : : : : : : : : : : : : : : : : : : : : : : : 26

Chart Components : : : : : : : : : : : : : : : : : : : : : : : : : : : 29

Port, Connector, and Label Components : : : : : : : : : : : : : : : : 35

Connecting Components : : : : : : : : : : : : : : : : : : : : : : : : : : : 36

i

Page 6: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

ii CONTENTS

Transactions : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 38

History : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 39

Attributes : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 40

Trigger Messages : : : : : : : : : : : : : : : : : : : : : : : : : : : 40

Timing Transaction Arrivals : : : : : : : : : : : : : : : : : : : : : : 41

Formulas : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 42

Unique Component IDs : : : : : : : : : : : : : : : : : : : : : : : : : : : 46

3 Building a Model with Compound Components 47

Assembling Components into Compound Components : : : : : : : : : : : 48

Controlling Subcomponent Exposure : : : : : : : : : : : : : : : : : : : : 49

Editing Components : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 52

Templates for Reusing Components : : : : : : : : : : : : : : : : : : : : : 52

4 Random and Exogenous Variation in the Model 55

Random Sources of Variation : : : : : : : : : : : : : : : : : : : : : : : : 56

FormulaDistribution : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 58

DataSource : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 59

5 Saving and Restoring 61

State : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 62

Models : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 62

Templates : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 63

Graphs : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 65

Sample Paths : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 66

The Component Dictionary Data Set : : : : : : : : : : : : : : : : : : 66

Page 7: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

CONTENTS iii

Component State Sample Paths : : : : : : : : : : : : : : : : : : : : 67

Transaction Sample Paths : : : : : : : : : : : : : : : : : : : : : : : 67

6 Analyzing the Sample Path 69

Running a Simulation : : : : : : : : : : : : : : : : : : : : : : : : : : : : 70

Statistics on Component State : : : : : : : : : : : : : : : : : : : : : : : : 72

Queue Length : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 72

Server Utilization : : : : : : : : : : : : : : : : : : : : : : : : : : : 74

Data Step Program for Extracting Information : : : : : : : : : : : : : 76

Statistics on Transaction State : : : : : : : : : : : : : : : : : : : : : : : : 77

Time in the System : : : : : : : : : : : : : : : : : : : : : : : : : : : 77

Data Step Program for Extracting Information : : : : : : : : : : : : : 78

7 Selected Examples 81

Queues with Reneging : : : : : : : : : : : : : : : : : : : : : : : : : : : : 81

Scanning a Queue : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 84

Priority Queues : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 85

Batch Arrivals I : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 87

Batch Arrivals II : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 88

Nonhomogeneous Poisson Processes : : : : : : : : : : : : : : : : : : : : 89

Markov-modulated Poisson Arrivals : : : : : : : : : : : : : : : : : : : : : 91

State-Dependent Service : : : : : : : : : : : : : : : : : : : : : : : : : : : 93

Servers that Break Down I : : : : : : : : : : : : : : : : : : : : : : : : : : 94

Servers that Break Down II : : : : : : : : : : : : : : : : : : : : : : : : : 95

Batch Service I : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 96

Page 8: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

iv CONTENTS

Batch Service II : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 97

Batch Service III : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 98

Assembly : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 99

Servers as Resources I : : : : : : : : : : : : : : : : : : : : : : : : : : : : 100

Servers as Resources II : : : : : : : : : : : : : : : : : : : : : : : : : : : 101

Special Routing : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 102

Index 105

Page 9: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

Chapter 1

Getting Started

The QSIM application is a SAS application for modeling and analyzing queueingsystems using discrete event simulation. These models are used in a wide varietyof scenarios that might be encountered in network and telecommunications systems,manufacturing systems, and transportation networks. For example, before institutinga reengineered business process, you could use QSIM to model the new process andstudy the model behavior to gain insight into how the new process might behave.

Figure 1.1. An M/M/1 Queueing Model

1

Page 10: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

2 CHAPTER 1. GETTING STARTED

The application has a graphical user interface that requires no programming andprovides all the tools for building, executing, and analyzing discrete event simulationmodels.

Figure 1.1 shows a simple M/M/1 queueing model built with the QSIM application.An M/M/1 queueing model has a Poisson arrival process, exponential service timesfor a single server, and a FIFO queueing discipline. You can build a model of such aqueueing system, control the simulation of the model, and produce summary statisticsfrom the simulation sample path from within the application. You can save the modeland the sample path in SAS data sets for reusue and further analysis. The applicationis designed to simplify model building by encouraging the construction of hierarchicalmodels based on user built model components that can be stored, shared, and replicatedeasily.

In this context a model is a directed network. Transactions flow through the networkchanging the state of the model upon arrival at vertices or nodes. The type of statechange that occurs depends on the current state of the simulation and the particulars ofthe model.

Invoking QSIM

You invoke the application by typing QSIM on a command line. You can save asimulation that is running in its current state in a catalog. Suppose that you save anexecuting simulation in the catalog SASUSER.MM1.SIM. You can continue executingit by typing QSIM C=SASUSER.MM1.SIM. There are other ways of saving modelswhen you don’t need to maintain the current state of the simulation. All of thesemethods are discussed in Chapter 5, ‘‘Saving and Restoring’’.

User Interface

When you invoke QSIM, a Simulation Window opens, as shown in Figure 1.2. Thewindow has two panels; the toolbar panel on the left and the model panel on the right.You build the model in the model panel, using the mouse to select model componentsfrom a popup menu or from the toolbar. These model components are connected by arcsto produce a directed network representation of the model. You can change parametersand other properties of model components via popup menus from the components.

Page 11: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

USER INTERFACE 3

Figure 1.2. The Simulation Window

For example, suppose you place the cursor on the background of an empty model paneland click the right mouse button. This displays the popup menu shown in Figure 1.3.

You simply select one of the components on the menu, and the component will beplaced wherever you click on the model panel. Note that the popup menu lists all thecomponents supplied with the application.

Page 12: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

4 CHAPTER 1. GETTING STARTED

Figure 1.3. The Simulation Window Popup Menu

Alternatively, you can choose a component from the toolbar on the left side of theSimulation Window by selecting the button that shows the component. If you don’tsee the component, use the scrollbar on the right side of the tool panel to scroll thetoolbar. Then, you can place the component wherever you click on the SimulationWindow background. For example, to place a Sampler in the Simulation Window,

you can select the button in the toolbar and then click on the Simulation Windowbackground.

The toolbar contains two types of buttons, state buttons and command buttons. Thestate buttons logically attach a state to the cursor so that when an object in the windowis selected using the mouse, it receives a message indicating the cursor state. Thecommand buttons operate similarly to push buttons, and they execute commands.

Page 13: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

USER INTERFACE 5

Figure 1.4. A Portion of the Simulation Toolbar

Figure 1.4 shows a section of the toolbar. Notice that there are three groups of buttons.

The buttons in the first group, which include the button, are state buttons thatthe cursor passes to a component when it is selected. The buttons in the middle group,

which include the button, are command buttons that execute a command when

pressed. The buttons in the bottom group, which include the button, are statebuttons that the cursor passes to the background of the model panel. So if you select

the and buttons and click on the background of the model panel, a Sampler

is displayed in the window. Since the is also selected, if you click on a Sampler,you pick it up, move it to another location, and place it with a second mouse click. On

the other hand, if you select a command button such as the button, an action willoccur as soon as the button is selected; in this case, animation of the simulation willstart.

This paradigm for the user interface is used throughout the QSIM application. Forexample, to initiate an action on a component, you place the cursor on the componentand click the right mouse button to popup a menu of actions, or you can select a cursorstate button and click on a component for that action.

Page 14: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

6 CHAPTER 1. GETTING STARTED

Figure 1.5. The Sampler Popup Menu

Figure 1.5 shows the popup menu on the Sampler. Notice that the first item in the menunames the type of component. The submenu from the Sampler entry lists the actionsthat are specific to that component. In this case, it includes: ‘‘Control Panel...,’’ whichopens a window that enables you to control the component; ‘‘Start,’’ which starts thetransaction sampling; and ‘‘Stop,’’ which stops the transaction sampling. Other generalactions include ‘‘Expose/Hide Detail’’ for changing the Sampler representation froman image to a line drawing, ‘‘Grab’’ for moving the component, ‘‘Arc’’ for drawing anarc from this component to another component, and ‘‘Tools’’ for other less frequentlyused tools. Choosing any of these items will start the requested action. Alternatively,

you can choose one of the icons from the toolbar. For example, if you select thebutton and you click on the Sampler, then the Sampler will follow the cursor untilyou click again and place the Sampler on the window background.

Model components are connected by arcs. Transactions flow down arcs between

components. You can connect two components with an arc by selecting the

button on the toolbar and then selecting a component, for example. You will havea rubberband line to the cursor. Now when you select another component, an arc willconnect the two components. If you move the cursor out of the Simulation Window,

Page 15: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

USER INTERFACE 7

the window may start power scrolling. Bringing the cursor back into the window willstop the scrolling. Clicking outside the window will stop the rubberband line mode.

Model components have control panels associated with them. With these panels, youspecify parameters and control the behavior of the component. The simulation also hasa control panel, as shown in Figure 1.6. It is displayed by choosing the ‘‘File’’ menuoption and the ‘‘Control Panel...’’ submenu option from the Simulation Window.

Figure 1.6. The Simulation Control Panel

The Simulation Control Panel shows the current simulation time. Time is measuredin dimensionless units. This means that you are free to interpret the units as you wish.They can be fractions of a second, seconds, days, or weeks. Just remember that all thecomponents use the same dimensionless units.

The Simulation Control Panel also has two check boxes: one for toggling theanimation and the other for collecting the simulation sample path into a SAS dataset. The ‘‘Components’’ list box shows the highest level of components in the model.Since components can be nested into a hierarchy, there can be multiple levels. Thepush buttons ‘‘<-’’ and ‘‘->’’ under the list box enable you to navigate through this

Page 16: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

8 CHAPTER 1. GETTING STARTED

hierarchy. If you select a component and press one of the five buttons to the right of the‘‘Components’’ list box, the component executes that action. For example, selectingSampler in the list box and pressing the ‘‘Start’’ button starts transaction sampling inthat sampler.

The ‘‘Start’’ button at the bottom of the window starts all the components in the model.The ‘‘Interrupt’’ button interrupts the simulation and suspends all transactions. The‘‘Reset’’ button resets all the components, destroys all events waiting to execute, andresets the simulation clock, and the ‘‘Dismiss’’ button closes the control panel.

A Simple M/M/1 Queueing Model

A simple example illustrates some of the concepts involved in model building. Thenetwork shown in Figure 1.7 models an M/M/1 queue. Transactions originate atthe source node Sampler. The user chooses the interval between transactions, calledthe inter-arrival time, to be a sample of a random variable (from one of severaldistributions), a fixed amount, or the value of a variable read from a SAS data set. Bydefault, the inter-arrival time is an observation of an exponential random variable withparameter 1. This models a Poisson Process for transaction arrivals.

Figure 1.7. An M/M/1 Queueing Model

Page 17: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

A SIMPLE M/M/1 QUEUEING MODEL 9

Queueing

When the transaction leaves the Sampler it flows down the arc to the node FIFOQueue. It is important to note that the movement of the transaction down the arcdoes not advance the simulation clock. On transaction arrival at the FIFO Queue,the queue broadcasts messages down arcs asking nodes downstream if they are busyor not. The responses depend on the types of components that are connected to thequeue and the state of the simulation when the message is received. Details are givenin the next chapter. It is important to note that broadcasting and evaluation of thesemessages also does not advance the simulation clock. If the queue gets a response thatthere is a nonbusy node, then it sends the transaction down the arc leading to that node.Otherwise, the transaction remains in the queue. When the simulation is first started theServer is empty; when it gets the message ‘‘are you busy’’ from the queue, it responds‘‘no.’’ As a result, the queue routes the transaction down the arc to the Server.

Service

When the transaction arrives at the Server, service is scheduled and the transaction tiesup the server. By default, the service time is an observation of an exponential randomvariable with parameter 1. Both the service distribution and its parameters can bechanged using the server’s control panel. While the server is serving this transaction,any ‘‘are you busy’’ messages sent to it result in a ‘‘yes’’ response. When service iscomplete, the server sends the transaction on any arcs directed away from it and alsosends a message up the arcs directed into it requesting an additional transaction. Inthis example, if the FIFO Queue is not empty, it will remove the transaction that hasbeen there the longest and send it to the Server. By default, all queues in the systemhave a capacity of 50 transactions. Of course, this capacity can be changed through theuser interface or programmatically, as discussed in the next chapter. Note that, sinceby default the inter-arrival times and the service times are E(1) exponential deviates,the transaction time in the system would not have a stationary distribution if the queuehad infinite capacity.

Statistics

Finally, the transaction flows to a StripChart, which collects simple statistics on thetransaction and displays the age of the transaction on the vertical axis versus time on thehorizontal axis. The statistics collected include ‘‘m=’’ the sample mean age, ‘‘x=’’ thethroughput (sample transaction arrival rate), ‘‘mx=’’ the maximum age, and ‘‘n=’’ thenumber of transactions that have arrived. The sample path as represented in the historyof the transactions can be saved in a SAS data set via the StripChart component.

The simulation is started either by using the right mouse button when the cursor is overthe Sampler and selecting ‘‘Start’’ from the submenu in the ‘‘Sampler’’ selection, or

Page 18: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

10 CHAPTER 1. GETTING STARTED

by selecting the button in the toolbar and then selecting the button in theSimulation Window.

Page 19: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

Chapter 2

Building a Model with ElementaryComponents

For ease in building and maintaining models, the QSIM application promotes hierarchi-cal model building, user component construction, and component reuse by providinga comprehensive set of primitive components and the ability to assemble componentsinto a compound component. For example, you can build a queue-server network, thenencapsulate it, identfy an image to represent it, use it to define a template for additionalreplication, and save the template in a SAS data set to be shared in other models andby other users.

This chapter discusses the details of the elementary components used in model building.

Elementary Components

There are several types of elementary components: sources, servers, queues, logic,holders, charts, and connectors. Although each of these has a special role, they havemuch in common, as is evident from their popup menus(displayed by pressing the rightmouse button while pointing to the component).

11

Page 20: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

12 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

Figure 2.1. The Popup Menu on the FIFO Queue Component

Figure 2.1 shows a typical popup menu. The first entry in this popup menu is thename of the component. The submenu from that entry has ‘‘Control Panel...’’ as thefirst choice. Selecting it displays the component’s control panel, which enables youto set component parameters. Other choices include ‘‘Expose/Hide Details,’’ ‘‘Grab,’’‘‘Arc,’’ ‘‘Tools,’’ and ‘‘Options.’’ The ‘‘Expose/Hide Details’’ entry toggles thedisplay of the component between an icon that represents the component, which youcan change, and a drawn representation of the component. For some of the components,the drawn representation shows state information while the simulation is in progressand animating. For example, the family of queues slowly fills as transactions arriveand queue up.

Many of the components also have internal state information that changes as the resultof transaction arrival and other kinds of message sending. There are five generaltypes of actions that either change component state or return information about thecomponent state: transaction arrival, request for transaction, are you busy message,query message, and trigger message. The query message is sent from the Probecomponents and formulas. These messages make requests about the state of thecomponent, for example, the number of transactions waiting in a queue. The triggermessage is sent when a transaction arrives at a Trigger component, and it is usedto change the state of the component. For example, since the Sampler services the‘‘start’’ message, a transaction arriving at a Trigger component can start a Sampler.The sections that follow document the elementary components and show in tables thetypes of state and information messages that the components service.

Each elementary component has a Control Panel associated with it. This panel providesyou access to parameters that control the behavior and appearance of the component.

Source Components

The source components are sources of transactions. There are two types of sources:Sampler and Transaction Pool.

Page 21: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

ELEMENTARY COMPONENTS 13

Icon Component Description

Sampler generates transactions with prescribed inter-arrival times

Transaction Pool a source of transactions

The Sampler generates a transaction, then waits a specified time interval beforegenerating another transaction. The time between transactions, called the inter-arrivaltime, can be a sample of a random variable (from one of several distributions), a fixedamount, or the value of a variable read from a SAS data set. By default, the inter-arrivaltime is an observation of an exponential random variable with parameter 1.

Figure 2.2. The Sampler Control Panel

Figure 2.2 shows the Control Panel for the Sampler. The combobox labeled‘‘Inter-Arrival-Time Distribution’’ enables you to specify the type of distribution. Ifyou press the down arrow a list of distributions is displayed. You select the inter-arrivaltime distribution by selecting one of these.

The control panel also has a slider for setting the capacity of the Sampler, that is, thenumber of transactions that can be generated by that control unit before the Samplershuts off. The ‘‘Transaction Image’’ button on the control panel enables you to choosea bitmap image that would flow through the network when the animate push button onthe simulation control panel is pressed.

The Transaction Pool (the other source component) differs from the Sampler onlyin that it does not instantiate transactions unless it receives a request for transactionmessage. In other ways, it is identical to the Sampler.

The following list documents the logic of the source components:

Page 22: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

14 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

transaction arrival A transaction that originates at or flows into a source compo-nent flows out each arc directed away from it. Note that thismeans that the transaction can traverse multiple arcs and residein multiple places simultaneously.

request for transaction A Sampler passes requests to arcs leading into it. A Trans-action Pool generates a transaction and intiates its flow.

are you busy message The source components pass this request to arcs leading out ofthem and return their answers.

query message sizeIs returns the number of transactions sent.

onIs returns TRUE if the source component isstarted, else FALSE.

idIs returns the source component’s unique iden-tifier.

capacityIs returns the capacity.

remainingIs returns the number of transactions remainingto be sent.

trigger message start starts the source component.

stop stops the source component.

reset stops the source component and resets thenumber of transactions to 1.

setCapacity sets the capacity from the transaction at-tribute ‘‘capacity.’’

setDistribution sets the distribution from the transaction at-tribute ‘‘distribution.’’ This attribute shouldbe a character string whose value is one ofthe distributions: Exponential, Gamma, Er-lang, Uniform, IUniform, and Deterministic.

setParameter1 sets the first parameter in the distributionfrom the transaction attribute ‘‘parameter1.’’

setParameter2 sets the second parameter in the distributionfrom the transaction attribute ‘‘parameter2.’’

Server Components

Server compoents model a resource used by a transaction for a specified amount oftime. There are two types of servers: Server and MServer.

Icon Component Description

Server provides service on/for a transaction

MServer provides service simultaneously on/for multiple transactions

Page 23: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

ELEMENTARY COMPONENTS 15

The Server holds the transaction while it is served. The service time can be a sampleof a random variable (from one of several distributions), a fixed amount, or the valueof a variable read from a SAS data set. By default, the service time is an observationof an exponential random variable with parameter 1.

An MServer, or multiple-server, can service multiple transactions simultaneously. Thecapacity of an MServer is set using the slider labeled ‘‘Capacity’’ on its control panel.

Figure 2.3. The Multiple-Server Control Panel

Notice that in the lower right-hand corner of the server components, there is a smallrectangle. This is a Balk node. If a transaction arrives at a Server when it is busyor at an MServer when it is at capacity, the transaction will flow out the Balk node.Consider, for example, a situation where transactions are either serviced upon arrivalby server 1 or, if server 1 is not free, wait for service from server 2. This is modeledby the network in Figure 2.4.

Figure 2.4. Server Balk Model

The following list documents the logic of the server components:

transaction arrival If the server is busy, at capacity, or stopped, the transactionflows out the Balk node; otherwise service is scheduled. On

Page 24: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

16 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

service completion, a request for transaction message is sentto arcs directed into the server. If a transaction is found, then itsflow is initiated. Regardless, the transaction that just finishedservice flows on each of the arcs directed out of the server.

request for transaction If the server is not busy or stopped, then pass on the request toall arcs directed into the server.

are you busy message If the server is not busy and not stopped, then return FALSE;otherwise, return TRUE.

query message sizeIs returns the number of mutiple-server unitsthat are busy.

busyIs returns TRUE if the Server is busy orthe MServer is at capacity; else, returnsFALSE.

idIs returns the server’s unique identifier.

trigger message start starts the server component.

stop stops the server component. Transactions inservice have normal completion.

setCapacity sets the capacity from the transaction at-tribute ‘‘capacity.’’

setDistribution sets the distribution from the transactionattribute ‘‘distribution.’’

setParameter1 sets the first parameter in the distributionfrom the transaction attribute ‘‘parameter1.’’

setParameter2 sets the second parameter in the distributionfrom the transaction attribute ‘‘parameter2.’’

seize attempts to obtain service for the transactionthat arrived at the Trigger.

preempt removes all the transactions that are beingserved. They flow out of the Balk node.

preemptContinue removes all the transactions that are beingserved. They flow out of the Balk node. Theserver requests transactions from upstreamcomponents.

removeIt removes the transaction at the Trigger, ifit is being served. It flows out of the Balknode.

Queue Components

Queue components are transient storage for transactions. There are three types ofqueues: FIFO Queues, LIFO Queues, and Priority Queues.

Page 25: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

ELEMENTARY COMPONENTS 17

Icon Component Description

FIFO Queues first-in-first-out

LIFO Queues last-in-first-out

Priority Queues priority

Each type of queue can behave as a ‘‘buffer’’ if the check box on the queue controlpanel is set. This means that when the transaction first arrives, the queue will not tryto route it to a nonbusy component but will wait for a request for transaction messagefrom a downstream component before sending it on.

The Priority Queue uses the value of the numeric transaction attribute named‘‘priority’’ to determine placement location in the queue. The numeric transactionattribute is assigned by the Modifier component, discussed in the ‘‘Logic Components’’section. The greater the value of the attribute, the higher placement in the queue andthe sooner the element will leave the queue.

Figure 2.5. The FIFO Queue Control Panel

The following list documents the logic of the Queue components.

transaction arrival If the queue is off or at capacity, the transaction flows out theBalk node; otherwise, check whether the queue is a ‘‘buffer’’type. If the queue is not a ‘‘buffer’’ type, send the message areyou busy to the nodes on arcs directed away from the queue. IfFALSE is returned, then route the transaction there; otherwise,queue the transaction. If the queue is a ‘‘buffer,’’ then do notcheck for nonbusy components; always queue the transaction.

request for transaction If the queue is not empty (size > 0), then remove the nexttransaction according to the type of queue and send it out thearc directed to the component that made the request.

Page 26: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

18 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

are you busy message always returns FALSE.

query message sizeIs returns the number of transactions that arein the queue.

idIs returns the server’s unique identifier.

trigger message empty empties the queue of all transactions. Notethat the transactions do not leave via theBalk node.

balk causes the transaction at the Trigger to leavethe queue from the Balk node.

insert inserts the transaction at the Trigger into thequeue.

filter evaluates a formula for each transaction inthe queue. If the formula evaluates to TRUE,the transaction balks; otherwise, it maintainsits place in the queue. The formula that isevaluated should be in an attribute named‘‘formula’’ in the triggering transaction.

releaseOne releases one transaction from the queue viathe the Balk node.

Logic Components

The logic components fall into two categories: those that control the flow of transactionsare Adder, Splitter, Router, and Switch; and those that change the state of thesimulation are Modifier and Trigger. Descriptions follow:

Icon Component Description

Adder assemble multiple transactions

Splitter split single transactions

Modifier assign an attribute to transactions

MultiModifier assign attributes to transactions

Trigger change components state

MultiTrigger change components state

Router direct flow as a function of system state

Switch direct flow as a function of system state

Page 27: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

ELEMENTARY COMPONENTS 19

Trigger Component

When a transaction arrives at a Trigger component, it initiates a message being sentto another component. For example, Figure 2.6 shows the control panel for a Triggercomponent. Notice that the ‘‘Queue’’ component is selected and that the ‘‘insert’’trigger is also selected.

Figure 2.6. The Trigger Control Panel

When a transaction arrives at this Trigger, the insert message is sent to the specificqueue named selected in the control panel. As documented in the section, ‘‘QueueComponents,’’ the transaction that arrives at the Trigger is the one inserted into thequeue name ‘‘FIFO Queue.’’

Notice the check box labeled ‘‘Schedule Trigger Event’’ in the trigger control panel.You select this check box to delay execution of the trigger event. You can specify thelength of the delay by pressing the ‘‘Event Interval’’ button. This opens a Distributionwindow (like the one shown in Figure 2.32) from which you can choose a distribution,a fixed interval, or a numeric variable in a SAS data set.

The following list documents the logic of the Trigger component:

Page 28: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

20 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

transaction arrival executes the trigger; then the transaction flows down each arcdirected away from the component.

request for transaction the transaction flows down each arc directed away from thecomponent.

are you busy message if any of the components on arcs directed out of the Trigger isbusy, then return TRUE; else, return FALSE.

query message idIs returns the component’s unique identifier.

trigger message none

MultiTrigger Component

When a transaction arrives at a MTrigger component, it initiates the sending ofa set of messages to a set of components, one message to each component. Forexample, Figure 2.7 shows the control panel for a MTrigger component.

Figure 2.7. The MTrigger Control Panel

Notice that the list box labeled Triggers contains two entries, one labeled ‘‘Server 2-> preempt’’ and the other labeled ‘‘Trigger.’’ The first one indicates that an arrivingtransaction will cause the ‘‘preempt’’ message to be sent to ‘‘Server 2.’’ The secondone, labeled ‘‘Trigger,’’ is selected Notice that the ‘‘Server 2ueue’’ component is

Page 29: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

ELEMENTARY COMPONENTS 21

selected. Since the ‘‘Edit’’ button was pushed the second MTrigger Control Panel isdisplayed. In that window ‘‘Server 4’’ and ‘‘seize’’ have been selected. This meansthat the second message triggered by an arriving transaction will send the ‘‘seize’’message to the component labeled ‘‘Server 4.’’

The following list documents the logic of the MTrigger component:

transaction arrival sends each message to the appropriate component, then thetransaction flows down each arc directed away from the com-ponent.

request for transaction the transaction flows down each arc directed away from thecomponent.

are you busy message if any of the components on arcs directed out of the MTriggeris busy, then return TRUE; else, return FALSE.

query message idIs returns the component’s unique identifier.

trigger message none

Modifier Component

The Modifier component assigns an attribute to a transaction. The control panel, shownin Figure 2.8, provides a field for entering the attribute name and a push button forassigning a formula to the Modifier component. By default, when a transaction arrivesat the component, a value is assigned to the attribute. How this value is evaluateddepends on how you set the radio buttons in the control panel. It could be a simplecharacter or numeric assignment, or it could be a formula evaluation, the sampling ofa random variable, or the result of reading a variable from a data set. Regardless, theresult of evaluation is the value given to the attribute. This attribute-value combinationis unique to the transaction, and the transaction carries it on its route through thesimulation network.

Page 30: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

22 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

Figure 2.8. The Modifier Control Panel

On the other hand, if you select the ‘‘Delay Formula Evaluation’’ check box, theformula is not evaluated when the transaction arrives at the modifier but is attached asan attribute to the transaction. This feature is used with the ‘‘filter’’ trigger message onqueues.

Details regarding formulas are discussed in the ‘‘Formulas’’ section.

The following list documents the logic of the Modifier component:

transaction arrival assigns the attribute; then the transaction flows down each arcdirected away from the component.

request for transaction the transaction flows down each arc directed away from thecomponent.

are you busy message if any of the components on arcs directed out of the Modifieris busy, then return TRUE; else, return FALSE.

query message idIs returns the component’s unique identifier.

trigger message none

MultiModifier Component

The MModifier component assign multiple attributes to a transaction. The controlpanel, shown in Figure 2.9, provides a field for entering the attribute name and an‘‘OK’’ push button for adding the attribute to the attributes list.

Page 31: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

ELEMENTARY COMPONENTS 23

Figure 2.9. The MModifier Control Panel

The list shows two attributes, named ‘‘class’’ and ‘‘priority.’’ By default when atransaction arrives at the component, each of the attributes is assigned a value as isdone in the Modifier component. This attribute-value combinations are unique tothe transaction, and the transaction carries them on its route through the simulationnetwork.

The following list documents the logic of the MModifier component:

transaction arrival assigns the attribute; then the transaction flows down each arcdirected away from the component.

request for transaction the transaction flows down each arc directed away from thecomponent.

are you busy message if any of the components on arcs directed out of the Modifieris busy, then return TRUE; else, return FALSE.

query message idIs returns the component’s unique identifier.

trigger message none

Router and Switch Components

The Router and Switch components are for directing the flow of a transaction as afunction of the state of the simulation. The Router can have a formula associated witheach arc directed away from it. When a transaction arrives at the Router, each formula

Page 32: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

24 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

is evaluated and the transaction flows down all arcs with formulas that evaluate toTRUE. The Switch is similar to the Router, but it has only one formula associatedwith it. The formula evaluation is interpreted as a case, which identifies an arc or setof arcs down which the transaction should flow. If the evaluation does not identify avalid case, the transaction flows out the Balk node.

Figure 2.10. Switch Control Panel

Figure 2.10 shows the control panel for a switch connected to two queues asin Figure 2.11. Selecting the button labeled ‘‘Formula’’ displays a Formula ManagerWindow (see Figure 2.30). There you build, verify, and save the formula associatedwith the switch. When a transaction arrives at the switch, the formula associated withthe switch is evaluated. This value is compared to each of the cases listed in the Switchcontrol panel. The transaction flows down the arcs associated with each of the casesthat match. You can associate arcs with a case by selecting a case and pressing the‘‘Edit’’ button. This displays the ‘‘Switch’’ window, as shown in Figure 2.10. In thiswindow you select one or more of the listed components. For example, a Switch canbe used to direct transactions to the smaller of two queues.

Page 33: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

ELEMENTARY COMPONENTS 25

Figure 2.11. Switch Controlled Queue Selection

Figure 2.11 shows what such a model might look like and Figure ?? shows how youwould identify formula values with cases and routing. See the ‘‘Formulas’’ section forfurther discussion.

The following list documents the logic of the Switch component:

transaction arrival evaluates the formula for the switch. It should evaluate to anumber i. The transaction flows down the ith arc leaving theswitch. If there is no ith arc, the transaction BALKS.

request for transaction the transaction flows down each arc directed away from thecomponent.

are you busy message if any of the components on arcs directed out of the Switch isbusy, then return TRUE; else, return FALSE.

query message idIs returns the server’s unique identifier.

trigger message none

The following list documents the logic of the Router component:

transaction arrival evaluates the formula for each arc leaving the router. If anevaluation returns TRUE, then the transaction flows down theassociated arc.

request for transaction the transaction flows down each arc directed away from thecomponent.

are you busy message if any of the components on arcs directed out of the Router isbusy, then return TRUE; else, return FALSE.

query message idIs returns the component’s unique identifier.

trigger message none

Page 34: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

26 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

Adder Component

The following list documents the logic of the Adder component:

transaction arrival if all components on arcs leading into the Adder can initiateflow, then initiate a transaction from each; otherwise, BALKthe transaction.

request for transaction if all components on arcs leading into the Adder can initiateflow, then initiate a transaction from each.

are you busy message if all components on arcs leading into the Adder can initiateflow, then return TRUE; else, return FALSE.

Query message idIs returns the component’s unique identifier.

trigger message none

Splitter Component

The following list documents the logic of the Splitter component:

transaction arrival the transaction flows down each arc directed away from thecomponent.

request for transaction if any of the components on arcs directed out of the Splitteris busy, then pass on the request to all components on arcsleading into the Splitter.

are you busy message if any of the components on arcs directed out of the Splitter isbusy, then return TRUE; else, return FALSE.

query message idIs returns the component’s unique identifier.

trigger message none

Holder Components

There are two types of holders, StringHolder and NumberHolder. These are used tohold strings and numbers that contain user defined state information.

Icon Component Description

NumberHolder storage for a number

StringHolder storage for a string

Page 35: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

ELEMENTARY COMPONENTS 27

For example, suppose that you want to save the value of a transaction attribute called‘‘weight’’ in a NumberHolder.

Figure 2.12. Number Holder Saving ‘‘weight’’ Attribute

In the model fragment in Figure 2.12, when the transaction arrives at the Trigger,the value of the ‘‘weight’’ attribute in that transaction is saved in the NumberHolder.Now, another part of the simulation can query the NumberHolder to find the currentvalue of ‘‘weight.’’

You specify the name of the attribute that is stored in the NumberHolder in theNumberHolder Control Panel , which is displayed by selecting the ‘‘Control Panel...’’selection on the popup menu on the NumberHolder.

Figure 2.13. Number Holder Control Panel

Notice that the NumberHolder control panel shown in Figure 2.13 has the attributename ‘‘weight’’ in the field labeled ‘‘Attribute.’’

The transaction sets the NumberHolder when it arrives at the Trigger because theTrigger Control Panel , as shown in Figure 2.14, has the NumberHolder componentselected and the setvalueFromAttribute selected.

Page 36: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

28 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

Figure 2.14. A Trigger Control Panel

The following list documents the logic of the holder components:

transaction arrival increments COUNT; then flows the transaction to each arcdirected away from the component.

request for transaction passes on the request to all arcs directed into the component.

are you busy message if any component on an arc leading out of the Trigger is busy,then return TRUE; otherwise, return FALSE.

query message valueIs returns the value in the holder.

countIs returns the number of transactions that haverouted through the holder.

trigger message setValueFromAttribute sets the value from the transactionattribute.

clearSetValueFromAttribute clears the value then sets it.

setValueFromTrigger sets the constant value that is given onthe Trigger Control Panel.

printValue prints the value on the SAS Log Window.

printCount prints the count on the SAS Log Window.

controls displays the Holder Control Panel.

Page 37: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

ELEMENTARY COMPONENTS 29

reset resets the value and the count.

incrementCount increments the count.

decrementCount decrements the count.

+ (for numberholder only) adds the transaction attribute to thevalue.

- (for numberholder only) subtracts the transaction attributefrom the value.

setTimenow (for numberholder only) sets the simulation timeinto the value.

Chart Components

There are three types of charts, Barchart, Stripchart and Probe. The charts are usedto display information about the performance of the system.

Icon Component Description

Barchart sample and display state information

Probe sample and display state information

Stripchart display transaction age

Stripchart Component

The StripChart displays the age of a transaction that arrives at it. The vertical axis isfor transaction age and the horizontal axis is for simulation time.

Figure 2.15. An m/m/1 Queue with StripChart

Page 38: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

30 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

In Figure 2.15 there is an m/m/1 queueing model and a StripChart. When thetransactions leave the server they travel to the StripChart. For each transaction thatarrives to it, it shows its total time in the system. This includes the time the transactionspent in all queues and all servers.

Figure 2.16. The StripChart Control Panel

The control panel in Figure 2.16 shows that a server has been selected to be monitored.This means that, when transactions leave the server they flow to the stripchart wheretheir ages are displayed. The control panel also shows simple statistics on transactionage. The ‘‘Display Controls’’ section provides control on the display scaling and on thestripchart speed. By default, the vertical axis is scaled to twice the difference betweenthe maximum and minimum values. If you select the ‘‘Autoscale’’ check box, then thestripchart is rescaled periodically; otherwise scaling is controlled by the value of the‘‘Vertical Axis Range’’ number on the Control Panel.

When you select the ‘‘Collect Data’’ check box, the history of state changes for eachtransaction are saved in a SAS data set. The details of this data set are discussed inChapter 5, ‘‘Saving and Restoring.’’ You can analyze the data you collect by pressing

Page 39: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

ELEMENTARY COMPONENTS 31

the ‘‘Analyze’’ button. This calculates additional summary statistics and prints theresults in the SAS Output Window. The details of the type of analysis is discussed inChapter 6, ‘‘Analyzing the Sample Path.’’

The following list documents the logic of the Stripchart component:

transaction arrival flows the transaction on each arc directed away from thecomponent.

request for transaction passes on the request to all arcs directed into the component.

are you busy message if any downstream component is busy then return TRUE; else,return FALSE.

query message idIs returns the source component’s unique iden-tifier.

meanIs returns the sample mean.

maximumIs returns sample maximum.

minimumIs returns the sample minimum.

throughputIs returns the sample throughput.

trigger message start starts the chart component.

stop stops the chart component.

reset stops the chart component and resets it.

Probe Component

The Probe component also displays simulation state information on the vertical axisand time on the horizontal axis. But it can display a wider variety of information thanthe StripChart.

Figure 2.17. An m/m/1 Queue with Probe

As the name implies, the Probe sends messages out to various components and receivesreplies, which it plots. In Figure 2.17 the Probe is sampling the Server to see if

Page 40: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

32 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

it’s busy or not and displaying the sample. The rate at which it sends these messagesis specified by the ‘‘Inter-Sample-Time Distribution’’ combobox on its control panel.Figure 2.18 shows a Probe control panel. By default, the samples are sent at fixed,deterministic intervals of 1.

Figure 2.18. The Probe Control Panel

Notice that the queue is the selected component and that the state being monitored isthe ‘‘busyIs.’’ If you look at the busyIs query message in the ‘‘Server Components’’section, you see that it returns a TRUE if the server is busy and a FALSE otherwise. Inthe Probe, the TRUE is displayed as a 1 and the FALSE as a 0. So, by looking at thisfactor, you measure server utilization. The mean is an estimate of the probability thatthe server is busy.

Page 41: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

ELEMENTARY COMPONENTS 33

The following list documents the logic of the Probe component:

transaction arrival flows the transaction on each arc directed away from thecomponent.

request for transaction passes on the request to all arcs directed into the component.

are you busy message if any downstream component is busy then return TRUE; else,return FALSE.

query message idIs returns the source component’s unique iden-tifier.

meanIs returns the sample mean.

maximumIs returns sample maximum.

minimumIs returns the sample minimum.

throughputIs returns the sample throughput.

sampleSizeIs returns the sample size.

trigger message start starts the chart component.

stop stops the chart component.

reset stops the chart component and resets it.

Bar Chart Component

Like the Probe, the BarChart component displays simulation state informationobtained from sampling other components in the model. The BarChart is composedof a bars. Each bar samples the state of a component in the model. The BarChartprovides an encapsulation and some synchronozation of the the bars.

Figure 2.19. The Bar Chart Popup Menu

Page 42: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

34 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

Initially, a BarChart has is empty. You add bars to the chart by choosing the ‘‘AddBar’’ selection on the popup menu on BarChart, as in Figure 2.19. Figure 2.20shows an m/m/1 model with a bar chart with two bars.

Figure 2.20. An m/m/1 Queue with Bar Chart

One of the bars is sampling the server and displaying the sample mean server utilization.This is the same quantity sampled by the Probe in the example in the last section.The other bar is sampling the queue and displaying the sample mean queue size. Thecontrol panel for a bar, as shown in Figure 2.21, has a check box that controls whetherthe bar is to display the sample mean or the actual sample. By default, the sample meanis displayed.

Page 43: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

ELEMENTARY COMPONENTS 35

Figure 2.21. The Bar Control Panel

Notice that this control panel looks similar to the control panel for the Probe. That isbecause of the similar function of the bar and the Probe

The following list documents the logic of a bar:

transaction arrival flows the transaction on each arc directed away from thecomponent.

request for transaction passes on the request to all arcs directed into the component.

are you busy message if any downstream component is busy then return TRUE; else,return FALSE.

query message idIs returns the source component’s unique iden-tifier.

meanIs returns the sample mean.

maximumIs returns sample maximum.

minimumIs returns the sample minimum.

throughputIs returns the sample throughput.

sampleSizeIs returns the sample size.

trigger message start starts the chart component.

stop stops the chart component.

reset stops the chart component and resets it.

Port, Connector, and Label Components

Ports and Connectors aid in connecting components to each other and are usefulwhen building hierarchical models and assembling components into larger aggregatecomponents. You can annotate the simulation with text by using Labels. In addition,you can attach labels to many of the elementary components. You do this by selecting‘‘Add label’’ from the popup menu on the component you want to annotate. Then, typethe text you want to appear in the label.

Icon Component Description

Port for connecting multiple components

Connector for connecting multiple components without using arcs

Label for annotating the model

Page 44: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

36 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

Figure 2.22 shows an example with a connector labeled ‘‘a.’’ When a transactionflows into connector ‘‘a,’’ it will flow out of all other connectors ‘‘a.’’

Figure 2.22. Simple Example Using a Connector

The three ‘‘a’’ connectors are treated as identical. An equivalent model using aninstance of a Port is shown in Figure 2.23.

Figure 2.23. Simple Example Using a Port

Here, you see the port explicitly connects the three components, which were implicitlyconnected using the Connector.

You duplicate a Connector by selecting ‘‘Duplicate’’ on the popup menu. If you labelthe interior of the Connector, then all the duplicates of that connector will display thesame text.

Connecting Components

The examples presented thus far used arcs to connect components. This sectiondescribes arcs and some of the features they provide in a more detail. The arc selection

on the toolbar is a type of component state button. If it is selected and youclick in a component, a rubberband line displays from the component to the cursor. If

Page 45: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

CONNECTING COMPONENTS 37

you don’t see this line, it means that the component doesn’t support arcs directed awayfrom it. You will not get an error message. If there is a rubberband line attached tothe cursor, when you click in another component that supports arcs directed towardsit, the rubberband line is replaced by a solid arc. If, while the rubberband line isconnected to the cursor, you move the cursor to the right or below the window border,the window will automatically scroll. This is power scrolling, and it allows you toconnect components that may not be visible in the window simultaneously. If you clickoutside the window border while power scrolling, then the rubberband line is dropped.

There are two types of arcs, regular arcs and segmented arcs. As the name implies,segmented arcs are composed of multiple line segments. Figure 2.24 shows the twotypes of arcs.

Figure 2.24. Two Types of Arcs

If you click on the simulation window background while a rubberband line is connectedto the cursor, the selected point ends one line segment and begins another. In this wayyou can create circuitous routes between components.

Notice the rectangular handle in the center of the arc. This is the arc’s ‘‘hot spot’’. Ifyou click the right mouse button while the cursor is over the hot spot, a menu associatedwith the arc pops up.

Page 46: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

38 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

Figure 2.25. Popup Menu for a Segmented Arc

Notice that in the popup menu for segmented arcs in Figure 2.25, there is a selectiontitled ‘‘Perpendicular.’’ This selection causes the arc to be drawn so that the linesegments are perpendicular to each other. As the numerous selections in Figure 2.25show, a full range of capabilities are available.

Although there are no visual indicators of the order in which arcs are initially drawnbetween components, this order can be important. For example, when a server sendsthe message up the arcs directed towards it requesting additional transactions, it sendsthe message first to the arc connected to it last. If that request results in no transactions,it sends the message to the next to last arc that was connected to it. Validating a modelusing animation can help you determine the order in which these events occur.

Transactions

Transactions are generated in three components: Sampler, Transaction Pool, andAdder. Transactions are discrete entities that traverse the simulation network, and theycan be used to represent physical and conceptual things such as a partially assembledrefrigerator on an assembly line, a telephone call in a phone system, or a check on thesize of a queue.

You can view the movement of transactions through the network by selecting the‘‘Animate’’ check box on the Simulation Control Panel (see Figure 1.6). Bitmapimages can be assigned to transactions in each of the three components in which they are

Page 47: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

TRANSACTIONS 39

generated. For example, the ‘‘Transaction Image’’ push button on the Sampler controlpanel (see Figure 2.2) opens a window from which you can choose an image to displayon the transactions that originate at that Sampler. Figure 2.26 shows an example.Note that, although Figure 2.26 shows the image SASHELP.ORIMAGE.PHONE,any image in a SAS catalog can be used.

Figure 2.26. Setting an Image for a Sampler Transaction

When there are no references to transactions in the simulation the transaction isdisposed of. This means that if a transaction does not reside in a queue, is busy in aserver, is traversing an arc, or is being processed by another elementary component, itwill be disposed of. You do not have to explicitly have to destroy them.

History

The transaction maintains a history of the processing it has received. For example,when a transaction enters a queue, it records the time it entered the queue and whenit leaves the queue, it records the time it left the queue. When a transaction enters aStripChart, if the ‘‘Collect Data’’ check box is set (see Figure 2.16), then its historyis written to a SAS data set.

Page 48: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

40 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

Note that the transaction history is saved for only 1000 state changes. This limitenables transactions to travel in some cyclical networks. In particular, if a cycle has asimulation time delay resulting from time in a queue or in a server, then it is allowed.If the cycle does not, it can result in the standard ‘‘infinite loop’’ and a machine stackoverflow. When this happens, the error is identified, and you can reset the simulationand continue.

Attributes

You assign an attribute to a transaction in the Modifier component. There are twotypes of attributes, numeric and character. An attribute is attached to the transactionfor the duration of the transaction, but it can be given another value at any time.

By default, the age of the transaction is stored as an attribute in the transaction. Thisis the quantity that is displayed in the StripChart. You can access it with the attributename ‘‘age’’.

Trigger Messages

The Trigger component includes an entry labeled ‘‘Transaction’’ in the ‘‘Components’’list. Figure 2.27 shows a Trigger control panel with this entry selected.

Page 49: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

TRANSACTIONS 41

Figure 2.27. Transaction Trigger Messages

Notice the entries in the ‘‘Trigger’’ list box. These entries are possible behaviors totrigger when a transaction arrives at the Trigger component.

removeFromServers removes the transaction from any servers by sending the ‘‘re-moveIt’’ message to all servers.

removeFromQueues removes the transaction from any queues by sending the ‘‘balk’’message to all queues.

routeToId routes the transaction to the component that has id equal to the valueof the ‘‘routeToId’’ attribute attached to the transaction.

These options provide you additional modeling flexibility. The two examples ‘‘Serversas Resources II’’ and ‘‘Special Routing’’ in Chapter 7, Selected Examples, illustratetwo uses of these capabilities.

Timing Transaction Arrivals

There are some issues concerning timing of transaction arrivals at a component.Consider model fragment A in Figure 2.28.

Page 50: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

42 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

Figure 2.28. Model Fragment A

Although transactions leaving the multiple-server will arrive at the Trigger and theStripChart at the same simulation time, the logic and behavior of each of thesecomponents will be executed in sequence. There is no guarantee which will occur first.

Figure 2.29. Model Fragment B

To guarantee that the Trigger ‘‘Server Off’’ executes before the transaction traversesto the StripChart, connect the components as in Figure 2.29.

Formulas

The Router, Switch, and Modifier components use formulas to control routing andset attributes. Formulas are specified in a Formula Manager window. Figure 2.30shows one such window with the formula 5:0+X , where X is a random variable withdistribution E(1).

Page 51: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

FORMULAS 43

Figure 2.30. Formula Manager Window

Formulas are built using the same type of user interface as that for building models.The toolbar has a set of command buttons and a set of state buttons. The state buttonsare associated with the elements used to build formula expressions. You choose astate button to identify an element with the cursor. Then, click on the background toinstantiate the formula element. The following table shows some of the elements:

Icon Description

another formula

a transaction attribute

the simulation clock

a component in the model

an observation of a variable in a SAS data set

a number constant

a string constant

Page 52: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

44 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

Each of these selections has a popup menu associated with it. For example, the random

variable icon shown in Figure 2.30 has a popup menu, shown in Figure 2.31.

Figure 2.31. Popup Menu on the Random Variable Formula Element

If you select ‘‘Edit,’’ the window shown in Figure 2.32 is displayed. From this windowyou select the distribution for the random variable. When the formula is evaluated (toset an attribute or determine transaction routing, for example), an observation of therandom variable is made.

Figure 2.32. Control Panel for the Random Variable Formula Element

Another important formula element is the model . Recall an example discussedin the ‘‘Switch Components’’ section. There, the model in /frefswitchmodel routestransactions to the smallest queue. The control panel on the Switch shown in Fig-ure 2.10 has ‘‘TRUE’’ as a case for routing to component ‘‘Queue 1’’. This means thatyou want the formula associated with this switch to return TRUE if queue 1 is smallerthan queue 2. To accomplish this, you compare the sizes of the two queues and returnTRUE if the size of ‘‘Queue 1’’ is less than the size of ‘‘Queue 2.’’

Page 53: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

FORMULAS 45

Figure 2.33. Formula for Comparing the Size of Two Queues

Figure 2.33 shows the formula for accomplishing this. The edit window on theleft-hand model element is shown in Figure 2.34.

Figure 2.34. The Model Element Edit Window

The ‘‘Component’’ list box contains the simulation components. When you select oneof these components the ‘‘Query’’ list box displays query messages for that component.When the formula is evaluated, the result of the query of the identified componentwill be used. For example, when the formula shown in Figure 2.33 is evaluated, themodel element will query ‘‘Queue 1’’ with the message ‘‘sizeIs,’’ which will returnthe number of elements in its queue. Similarly, if you edit the model element on theright-hand side of the > and set it to query ‘‘sizeIs’’ of ‘‘Queue 2,’’ the formula willevaluate to TRUE if ‘‘Queue 1’’ has fewer elements than ‘‘Queue 2.’’ In this case, theswitch will send the transaction to ‘‘Queue 1.’’

You should be careful when validating your models that they are behaving as youwant them. There is not a great deal of error checking being done when formulas areevaluated, particularly with regard to type. For example, a Router may expect a TRUEor FALSE returned from a formula, but you could enter a valid formula that evaluatesto a number or a string. QSIM would not detect this type of error but would functionas if a nonzero number were TRUE.

Page 54: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

46 CHAPTER 2. BUILDING A MODEL WITH ELEMENTARY COMPONENTS

The formula syntax is standard with two exceptions. First, functions of one argument,such as the trigonometric functions, are specified in reverse polish style. So, anexpression like log(X)would be displayed as in in Figure 2.35.

Figure 2.35. A Formula for the Log of a Random Variable

Functions of two arguments, such as max and min, are specified between the arguments.So, an expression like max(X; :75)would be displayed as in Figure 2.36.

Figure 2.36. A Formula for the Maximum of a Random Variable and .75

Unique Component IDs

The system assigns a unique component id to each of the elementary components. Thisis done so that you can unambiguously identify each component that appears in a listbox. For example, when you instantiate a Server all that appears in the Simulation

Window is the icon . If you have several of these icons and you look at a Probecontrol panel, such as the one shown in Figure 2.18, you cannot distinguish themunless you give each a unique label. By default, each will have a unique id, which isappended to the name of the object and displayed in the list box. As an alternative, youcan give the component a label, which will be displayed in the list box. By default, theiconic representation of a component in the Simulation Window, includes the uniqueid.

Page 55: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

Chapter 3

Building a Model with CompoundComponents

The ability to assemble elementary components into larger aggregates is an importantfeature of QSIM. It encourages hierarchical model building, information hiding, andcomponent reuse. This chapter discusses the details of compound components in modelbuilding.

Figure 3.1. A Compound Component with Queue and a Server

47

Page 56: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

48 CHAPTER 3. BUILDING A MODEL WITH COMPOUND COMPONENTS

Assembling Components into Compound Components

Recall that the popup menu on the Simulation Window (see Figure 1.3) has as its firstentry ‘‘Assemble Components.’’ When you choose this selection, you get a rubberbandrectangle with which you can sweep out an area on the Simulation Window. Anycomponents that are completely within this region will be encapsulated in a compoundcomponent.

Figure 3.1 shows an example compound component. This encapsulated queue andserver can now be treated as a single unit, called a compound component, It has apopup menu, shown in Figure 3.2, which includes ‘‘Assemble Components’’ and‘‘Disassemble Components’’ for assembling additional compound components withinit and for removing the encapsulation.

Figure 3.2. The Compound Component Popup Menu

This compound component also includes ‘‘Edit,’’ a selection that opens a separatewindow for editing the contents of the compound component, and ‘‘Expose/HideDetails,’’ a selection that toggles the compound component with an icon. The default

icon, , can be replaced with a user icon by using the ‘‘Options’’ selection on theSimulation Window popup menu (see Figure 1.3).

Page 57: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

CONTROLLING SUBCOMPONENT EXPOSURE 49

You can use the Port with nested compound nodes to build useful components forsubsequent reuse. For example, by adding two Ports, one for transactions to enterthe queue and the one for transactions to leave after service, and then assembling theports and the compound component into a larger unit, you can further encapsulate thequeue-server combination as shown in Figure 3.3.

Figure 3.3. A Multi-Level Compound Component with Queue, Server, and Ports

This demonstrates how you can nest compound components and build hierarchicalmodels.

Controlling Subcomponent Exposure

Another feature that helps encourage the use of hierarchical models is the ability tolimit the exposure of compound components. Even though the model in Figure 3.3 isnested and allows you to connect to ports, it still exposes submodel detail. However,the popup menu on the compound component also has an entry labeled ‘‘Expose/HideDetails.’’ Selection of this entry hides the detail in the compound component behind

the icon .

With the inner compound component hidden, the model shown in Figure 3.3 lookslike Figure 3.4.

Figure 3.4. A Multi-Level Compound Component with Ports

You can expose the detail in the inner ‘‘Queue/Server’’ component by selecting‘‘Expose/Hide Details’’ again on the inner component labeled ‘‘Logic.’’ With

Page 58: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

50 CHAPTER 3. BUILDING A MODEL WITH COMPOUND COMPONENTS

these features, you assemble components with complex behavior, attach ports to thesubstructures, then hide the detail, exposing only the structure necessary for using thecompound component.

Not only can you hide the visual details of compound components, but you can also hidethe details of the logic in a compound component. Consider the model from Figure 3.4but with additional labeling.

Figure 3.5. A Multi-Level Compound Component with Details Hidden

The popup menu on compound components in Figure 3.2 shows the selection ‘‘SelectComponents...’’. When this is selected for the component labeled ‘‘Logic,’’ thewindow in Figure 3.6 is displayed. In this window, you can select those componentsthat you want exposed when queries are made on the ‘‘Logic’’ compound component.

Figure 3.6. A Compound Component Control Panel

The ‘‘All Components’’ list box contains all the components in the ‘‘Logic’’ compoundcomponent. The ‘‘Expose Components’’ list box contains only those that will beexposed. You move selections between the list boxes by pressing the push buttons

Page 59: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

CONTROLLING SUBCOMPONENT EXPOSURE 51

labeled ‘‘->’’ and ‘‘<-’’ after selecting those items you want moved. Notice that only‘‘FIFO Queue’’ will be exposed. For example, consider the model shown in Figure 3.7.

Figure 3.7. A Model with Switch and Compound Component

Suppose that you want to use a model element in the formula for a Switch routing.You open an edit window on the model element, as shown in Figure 3.8.

Figure 3.8. Control Panel for the Formula Model Element

Notice that when the ‘‘Queue/Server’’ is selected, the ‘‘Query’’ list box displays thequery messages from the FIFO Queue component. This is because you had previouslyselected only that element to be exposed.

Page 60: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

52 CHAPTER 3. BUILDING A MODEL WITH COMPOUND COMPONENTS

Editing Components

Suppose that you want to edit the ‘‘Logic’’ component in the model in Figure 3.7.One way is to visually expose the detail in an edit window by selecting ‘‘Edit...’’ fromthe popup menu on compound components (see Figure 3.2). Figure 3.9 shows suchan edit window for the ‘‘Logic’’ component.

Figure 3.9. Editing the ‘‘Logic’’ Compound Component

In this new window, you can modify the detail structure of the ‘‘Logic’’ compoundcomponent.

Templates for Reusing Components

Another powerful feature of compound components is the ability to use them astemplates for replication.

Figure 3.10. The Window for Naming Templates

Page 61: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

TEMPLATES FOR REUSING COMPONENTS 53

Selecting ‘‘Create Template...’’ from the popup menu on compound components, asshown in Figure 3.2, opens the window in Figure 3.10. Here you enter the name youwant to give to the template, ‘‘Q/S’’, for example. When you press ‘‘OK,’’ a new statebutton is added to the toolbar, as shown in Figure 3.11.

Figure 3.11. The Toolbar with the New ‘‘Q/S’’ Button

Now, this button can be used to replicate the ‘‘Queue/Server’’ compound component.When you press it, the cursor has the state ‘‘Queue/Server,’’ and if you click on theSimulation Window background, you will get and instance of ‘‘Queue/Server.’’ Youcan also save these templates in SAS datasets for future use (see Chapter 5, ‘‘Savingand Restoring’’, for details).

Note that it is possible to create templates that reference components not in the templateitself. For example, you can have a Trigger as a template that references a queuenot in that template. When the template is replicatated, the Trigger will no longerreference the queue and its reference to a component in the model will have to bereestablished. However, any references to components within the template will bepreserved in replicates.

Page 62: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

54 CHAPTER 3. BUILDING A MODEL WITH COMPOUND COMPONENTS

Page 63: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

Chapter 4

Random and Exogenous Variationin the Model

Random and exogenous sources of variation play a central role in discrete eventsimulation. The Sampler, Server, MServer, and formulas are the principle sources ofthis variation in the QSIM models. However, there are other situations where variationcan be useful. For example, you may want to delay the effect of a Trigger for somerandom or fixed amount of time. In each of these cases you have access to a combobox,such as the one in the Probe control panel shown in Figure 2.2, labeled to show theuse of the source of variation. In this case, it is the time between samples that the Probetakes. If you click on the down arrow, a list that includes the possible distributions isdisplayed as in Figure 4.1.

Figure 4.1. Source of Variation Combobox

55

Page 64: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

56 CHAPTER 4. RANDOM AND EXOGENOUS VARIATION IN THE MODEL

When you select one of these distributions, the selection is displayed in the text area tothe left of the down arrow. For each distribution you select, you can set one or moreparameters which further define the choice.

There are two types of sources of variation, random and exogenous. These arenot mutually exclusive. That is, an exogenous source of variation can be randomlygenerated.

Random Sources of Variation

The random sources of variation are generated using pseudo-random number generators.The QSIM application provides a set of standard generators. These include:

� Exponential, with mean 1=� and density function

f(x) =1�

exp�x=�; for 0 � x; 0 � �

� Nonhomogenous Poisson, with rate paramter �(t) and density function

f(x) =1

�(t)exp�x=�(t); for 0 � x; 0 � �(t)

where �(t) is cyclic and continuous for all t � 0 with

�� � supt�0

�(t)

� Gamma, with parameters � and n and density function

f(x) =xn�1 exp�x=�

�n�(n); for 0 � x; 0 � �; n�Z+

� Erlang, with parameters � and n and density function

f(x) =xn�1 exp�x=�

�n�(n); for 0 � x; ��Z+; n�Z+

� Uniform, with parameter U and density function

f(x) =1U; for 0 � x; 0 � U

� IUniform, with parameter U and density function

f(x) =1bUc

; for x�Z; 0 � U

Page 65: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

RANDOM SOURCES OF VARIATION 57

� Deterministic, with parameter U and density function

f(x) = 1; for x = U

Each of these generators has a control panel for setting parameters. For example, ifyou pick Exponential from the list box in Figure 4.1 and then press the ‘‘Parameters’’push button, the exponential control panel in Figure 4.2 will be displayed. In thiswindow, you set the inital seed value and the mean 1=�.

Figure 4.2. The Exponential Control Panel

The seed value for each distribution is initialized to 123456789. You have theresponsibility of explicitly changing this value unless you want the same stream usedfor each random variable. Note that this means you are introducing a significant amountof correlation into the model that in all likelihood is not the system being modeled.

Note that, by default, the Exponential mean in Figure 4.2, is set to 1. You can changethe mean with the slider. The slider has a range of 0 to 10 for this parameter. If 10is not large enough for the mean, you can increase it by pointing the cursor at theslider and pressing the right mouse button. This displays a popup menu with the entry‘‘Attributes.’’ Selecting this will display the window in Figure 4.3.

Figure 4.3. The Slider Attribute Window

Page 66: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

58 CHAPTER 4. RANDOM AND EXOGENOUS VARIATION IN THE MODEL

In this window you can change various parameters of the slider including the minimumand maximum values. To change the maximum value that an Exponential mean canhave, enter a maximum value for the Exponential mean slider and press the button‘‘Ok.’’ Now the slider can be moved to any value up to that maximum.

FormulaDistribution

QSIM provides a general function writing capability with the ‘‘FormulaDistribution’’selection, shown in the list box in Figure 4.1. After you select it and then pressthe ‘‘Parameters’’ button, a Formula Manager Window (as shown in Figure 2.30)is displayed. From this window, you can write a function that returns a number thatis used as the sample. For example, suppose you wanted a mixture distribution withdensity function

f(x) = :5f1(x) + :5f2(x)

where f1(x) is exponential with parameter � and f2(x) is uniform. Figure 4.4 showsa portion of the four windows needed to express this.

Figure 4.4. An Example of a Mixture Distribution

The bottom-most window is the FormulaDistribution Formula window, and it contains

the conditional element . Editing this element provides you with the capability

to specify the condition . If the condition evaluates to TRUE

it returns the formula in the True Expression window , which is the appropriateexponential random variable; if it evaluates to FALSE, it returns the formula in the

False Expression window , which is the uniform random variable.

Page 67: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

DATASOURCE 59

DataSource

You have another opportunity to customize the source of variation with the ‘‘Data-Source’’ selection shown in Figure 4.1. With this choice, you can select a SASdata set and a numeric variable. Whenever a sample is needed, an observation is readfrom the data set and the value of the selected variable is used as the sample value.You choose the data set by pressing the ‘‘Parameters’’ button, which displays theDataSource Control Window in Figure 4.5.

Figure 4.5. The DataSource Control

Suppose that you had executed the following data step which sampled 10000 observa-tions from the mixture distribution with density function

f(x) = :5f1(x) + :5f2(x)

where f1(x) is exponential with parameter 1 and f2(x) is uniform.

data mixture;keep sample;do i = 1 to 10000;

if ranuni(123456789) < .5 thensample = ranexp(98765432);

else sample = ranuni(54321678);output;end;

Then, the selections highlighted in Figure 4.5 would result in the sample being used.Note that the simulation may require more than 10000 observations of the random

Page 68: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

60 CHAPTER 4. RANDOM AND EXOGENOUS VARIATION IN THE MODEL

variable with this mixture density. In this case the DataSource will rewind the dataset to the beginning and reuse the sample. If this feature is not accounted for, it couldresult in some unexpected and incorrect estimates of performance measures.

Page 69: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

Chapter 5

Saving and Restoring

There are several ways to save information about the simulation. You can save thestate of the simulation at a particular simulation instance; save a picture of the modelas a SAS Graph object; save the sample path of a simulation; or save a representationof the simulation model or a piece of the model. Each of these saved representationscan be reused, each in its own special way.

Figure 5.1. The ‘‘Save As’’ Pull-down on the Simulation Window

Figure 5.1 shows the pull-down menu on the Simulation Window from which youchoose whether you want to save the state, a graph, or a model.

61

Page 70: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

62 CHAPTER 5. SAVING AND RESTORING

State

The state of the simulation includes the value of all parameters and settings, the logicaland physical structure of the model, transactions in service, transactions waiting forservice, and transactions in transit. The state does not include the sample path that thesimulation may have taken to get to its current state. When you select ‘‘State...’’ fromthe pull-down in Figure 5.1, the Save State window in Figure 5.2 opens.

Figure 5.2. Save State Window

The state is saved in a SAS catalog whose name you can enter in this window.

Suppose you have saved a simulation in catalog entry SASUSER.QSIM.DEFAULT.You can restart this simulation by entering the command ‘‘QSIM C=SASUSER.QSIM.DEFAULT’’in any SAS window. The simulation will be continued from the state that it was inwhen it was saved. Any control panels or windows that were open will a be reopened.

Models

A model of the simulation includes the values of all parameters and settings, andthe logical and physical structure of the model. It does not include information ontransactions in service or those waiting for service. Nor does it include information onwhich windows and panels are open. When you select ‘‘Model...’’ from the pull-downin Figure 5.1, the Save Model window in Figure 5.3 opens. The model is saved ina SAS data set whose name you enter in the Save Model window. You can restore amodel by selecting ‘‘Open...’’ from the pull-down in Figure 5.1.

Page 71: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

TEMPLATES 63

Figure 5.3. Save the Simulation Model

Since a model is saved in a SAS data set it is possible to edit the model. However, thisshould not be done since it will result in errors when reading the model back into thesimulation.

Templates

A template is the information attached to a state button in the toolbar. You definetemplates and add them to the toolbar as discussed in section ‘‘Templates for ReusingComponents’’ in Chapter 3. If you want to save a template for use in a subsequentsession or to share with other users you can save it in a SAS data set, which is very

similar to a model data sets. If you press the command button in the simulationwindow toolbar, then the Toolbar Manager window will be displayed.

Page 72: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

64 CHAPTER 5. SAVING AND RESTORING

Figure 5.4. The Toolbar Manager Window

You can customize the toolbar by selecting from the appropriate listbox, (see Fig-ure 5.4) those icons you want displayed in the toolbar. When you press the ‘‘Apply’’button the toolbar will be reconfigured as you requested. If you press the ‘‘SaveTemplates’’ button the Save Templates window will be displayed as in Figure 5.5.

Figure 5.5. Save Templates Window

A template is saved in a SAS data set whose name you enter in this window.In Figure 5.5, ‘‘Q/S’’ has been selected for saving.

Page 73: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

GRAPHS 65

To restore a template to the toolbar press the ‘‘Load Templates’’ button in the ToolbarManager window in Figure 5.4. This displays the ‘‘Load Templates’’ window shownin Figure 5.6.

Figure 5.6. Load Templates Window

Here ‘‘SASUSER’’ and ‘‘Q/S’’ are selected. When the load button is pushed, thetemplate will be loaded into the toolbar as in Figure 3.11.

Graphs

A graph is a visual representation of the model. There is no state information saved inthe graph of the model. When you select ‘‘Graph...’’ from the pull-down in Figure 5.1,the ‘‘Save Graph’’/sbjiSave Graph Window window in Figure 5.7 opens.

Figure 5.7. Save the Graph of the Simulation

Page 74: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

66 CHAPTER 5. SAVING AND RESTORING

There you enter the name of the entry in a catalog into which the graph representationis stored as a SAS/GRAPH grseg.

Sample Paths

There are two ways of accumulating sample path data. One is from the perspective ofthe components and the other is from the perspective of the transactions. Each of theseputs the sampled data into a SAS data set that can be analyzed by your own programs.Each also relies on another SAS data set named ‘‘DICT,’’ which contains a dictionaryfor tying together components and unique component ids.

Unlike the other pieces that are saved (state, models, templates, and graphs), thesample paths cannot be reconstituted by the QSIM application or by other applicationsor procedures within the SAS System. This information can be useful in user writtenSAS programs to further analyze these data.

The Component Dictionary Data Set

The component dictionary data set is always in WORK.DICT. It has two variables,CMPONENT and ID. Figure 5.8 shows a printout of the data set for a simple m/m/1model.

Figure 5.8. An M/M/1 Example Dictionary Data Set

The value of the CMPONENT variable will be whatever label is associated with thecomponent. Note that only elementary components will appear in this data set.

Page 75: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

SAMPLE PATHS 67

Component State Sample Paths

The component state information is saved in the data set WORK.SAMPLE. For eachchange of state in the simulation a new observation is added. This data set containsthree variables: TIMENOW, the simulation time when the state change occurred; ID,the id of the component that is changing state; and STATE, the value of the new state.Figure 5.9 shows an example. Notice that the ID corresponds to either the server orthe queue as given in the dictionary in Figure 5.8.

Figure 5.9. An M/M/1 Component State Sample Path Data Set

Sample path data are not saved to WORK.SAMPLE until the ‘‘Collect Data’’ checkbox in the Simulation Control Panel (see Figure 1.6) is selected.

Transaction Sample Paths

The state information on the components in a transaction’s sample path can be saved toa data set in a StripChart. Figure 2.16 shows the ‘‘Collect Data’’ check box, whichmust be set to start saving data on the transactions arriving to that StripChart. Thesedata are placed in a data set named for the StripChart’s id. If the StripChart’s id is9, then the data set is named 9.

Page 76: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

68 CHAPTER 5. SAVING AND RESTORING

Figure 5.10. An M/M/1 Transaction State Sample Path Data Set

Page 77: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

Chapter 6

Analyzing the Sample Path

The QSIM application provides some built-in analysis capabilities. You can obtainsample means, variance estimates, sample histograms, and other simple statistics onseveral measures of performance using the Probe and StripChart components. Futurereleases of the QSIM application will provide more built-in analysis capabilities.

An additional feature is the ability to accumulate the sample paths in SAS data sets asdiscussed in Chapter 5, ‘‘Saving and Restoring.’’ With these data in data sets you canwrite your own programs to do more sophisticated analyses.

When calculating statistics, QSIM uses the following measures of system performance:

� number in a queue

� time in a queue

� number of multiple-servers busy

� server utilization

� time in service and

� time in the system

To illustrate some of the analysis features, this chapter uses the multiple-serversingle-input queueing model shown in Figure 6.1.

69

Page 78: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

70 CHAPTER 6. ANALYZING THE SAMPLE PATH

Figure 6.1. A Single Queue 3-Server Model

The inter-arrival time distribution is E(:33) and the service time distribution for eachserver is E(1). Transactions queue in a FIFO discipline and go to the first availableserver. This corresponds to the type of queueing that you encounter at check-in inmany airports.

Running a Simulation

Suppose that you have built the model in Figure 6.1. There are several ways to start,

stop and validate a simulation such as this. The toolbar has command buttonsthat send a start message to each of the components in the model. Alternatively, the

state button can be used to logically associate the start message with the cursor.Then, selecting any component would start that component. So, you could start each of

the samplers without starting other components by pressing individually on eachSampler.

Another way to control the simulation is with the Simulation Control Panel as shownin Figure 6.2.

Page 79: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

RUNNING A SIMULATION 71

Figure 6.2. The Simulation Control Panel

Notice the ‘‘Start’’ button at the bottom of the control panel. When pressed, it alsostarts each of the components in the model. Alternatively, you can select a componentfrom the ‘‘Components’’ list box and start it by pressing the ‘‘Start’’ button to the rightof the Components list box. Each of the buttons to the right of the components list boxsends that message to the selected component.

The ‘‘Reset’’ button at the bottom of the control panel resets all the components.But first it stops the simulation, resets the simulation clock, and removes all pendingactions. This means, for example, that all queues are emptied and transactions inservice are discarded.

One effective way to validate a model is by animating the simulation and observingthe behavior. The ‘‘Animate’’ check box on the Simulation Control Panel will turnanimation on. In addition, you can add Triggers and StringHolders to display andprint state information to help you with model validation.

Page 80: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

72 CHAPTER 6. ANALYZING THE SAMPLE PATH

Statistics on Component State

The queues and servers are two of the component types for which performance measuresare typically of interest. For queues you want to know the distribution on queue length,and for servers you want to know about server utilization. Other performance measuresthat may be of interest are time in the queue and time in service. These are discussedin the section ‘‘Statistics on Transaction State’’ later in this chapter.

Queue Length

You can obtain statistics on queue length and server utilization using the Probecomponent. On the Figure 6.3 control panel you can select the queue you want tomonitor and the state you want to monitor using the list boxes.

Figure 6.3. Probe Control Panel

The component collects the sample mean, the sample throughput, the maximum, theminimum, and the number in the sample. These are displayed in the Probe Controlpanel and at the bottom of the Probe component. So, if you select to monitor a queueand you select to monitor the queue size, then the sample mean is the sample meanqueue length.

Page 81: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

STATISTICS ON COMPONENT STATE 73

Figure 6.4. Probe Statistics on the FIFO Queue length

The Probe can display more detailed statistics on queue length via SAS data sets. TheSimulation Control panel in Figure 6.2 shows a ‘‘Collect Data’’ check box. If thisis selected, then data on all component state changes are routed to the SAS data setnamed WORK.SAMPLE. If sample data have been collected for a time, then you canselect a component and press the ‘‘Analyze’’ button to obtain some simple statistics.For example, you display data on the queue length on the single-queue multiple-servermodel in Figure 6.1 by selecting ‘‘FIFOQueue’’ in the Simulation Control panel andthen pressing ‘‘Analyze.’’

Figure 6.5. Statistics on Queue Length

Page 82: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

74 CHAPTER 6. ANALYZING THE SAMPLE PATH

This generates the report shown in Figure 6.5 in the SAS Output Window. Figure 6.5shows that the sample mean queue length is approximately 46.12 and that the samplevariance is approximately 2.16.

The ‘‘Analyze’’ button also opens a graphics window with the histogram on the queuelength as in Figure 6.6. This shows the sample distribution of queue length for thecomplete sample path that was collected from the time the ‘‘Collect Data’’ check boxis selected until the time the analyze button is pressed.

Figure 6.6. Queue Length Histogram

It is important to note that the observations in the sample path are not independent.There can be a significant amount of autocorrelation in the observations of queuelength.

Server Utilization

The utilization of a server is another measure of system performance that is oftenof interest. Estimates on the probabality that a server is busy is one statistic formeasuring utilization. If after collecting data using the ‘‘Collect Data’’ check box onthe Simulation Control panel, you select a server from the components list box andpress the ‘‘Analyze’’ button, you get a printout similar to that shown in Figure 6.7.

Page 83: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

STATISTICS ON COMPONENT STATE 75

Figure 6.7. Statistics on Server Utilization

The mean shown is approximately .7214. This is an estimate of the probability that theserver is busy.

Figure 6.8. Server Utilization

The pie chart in Figure 6.8 shows percent of time that the server is busy.

Page 84: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

76 CHAPTER 6. ANALYZING THE SAMPLE PATH

Data Step Program for Extracting Information

When you press the ‘‘Analyze’’ button, the QSIM application executes SAS code toextract and summarize the sample path saved in the WORK.SAMPLE data set. Youtoo can write a SAS program to extract and analyze these data. For example, supposeyou want to subset the data on the time the queue is in each state. The following datastep subsets WORK.SAMPLE with those observations that have state information onqueue with ID 5:

data subset;set sample;if id=5;keep timenow number time;label number="Queue Length";time = ( timenow - lag(timenow) );number = lag(state);

The resulting data set has three variables: TIMENOW for the time that the statechanges; NUMBER for the number in the queue; and TIME for the length of time inthat state. The following SAS code executes the UNIVARIATE procedure to producesummary statistics and the GCHART procedure to produce a histogram as shown inFigure 6.6.

proc univariate data=subset;weight time;var number;

proc gchart;label = ‘‘Time in Queue’’;vbar number / subvar=time discrete;

A similar SAS program subsets the data on server utilization and produces the outputin Figure 6.8 and Figure 6.7.

data subset;set sample;if id=4;keep timenow number time;label number="Utilization";time = ( timenow - lag(timenow) );number = lag(state);

proc univariate data=subset;weight time;var busy;

proc gchart;pie busy / sumvar=time discrete percent=outside;

Page 85: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

STATISTICS ON TRANSACTION STATE 77

Statistics on Transaction State

As a transaction goes through the simulation it maintains a history of time spent atvarious components. When a transaction arrives at a StripChart, it displays its age onthe vertical axis of the chart. The StripChart can also direct the transaction to store arecord of its history in a SAS data set. The name of the data set is derived from the IDof the StripChart. If the StripChart has ID=14, then the data set is WORK. 14. Sincethe number of entries in the history of transactions can differ, the history informationis stored sequentially in the data set. Figure 5.10 shows one such data set.

Time in the System

The StripChart component accumulates the sample mean age or system time of thetransactions arriving to it. The Stripchart Control panel has a check box which whenset, records the transaction histories in the SAS data set. Figure 2.16 shows such acontrol panel.

If a simulation has been executing and the ‘‘Collect Data’’ check box has been set,then you can press the ‘‘Analyze’’ button to calculate statistics on the sample.

Figure 6.9. A Histogram Showing Time in the Queue

Univariate statistics are calculated and histograms are printed for each of the com-ponents that a transaction has visited before arriving at the StripChart. Figure 6.9shows one such histogram on the time in FIFO queue 4 for all the transactions thatarrived at the StripChart. Univariate statistics and a histogram on system time andfor time in any other component that was visited by a transaction that arrives to theStripChart is also printed.

Page 86: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

78 CHAPTER 6. ANALYZING THE SAMPLE PATH

Data Step Program for Extracting Information

The transaction’s sample path or history that is saved in a SAS data set is somewhatmore complicated than that for components. This is because a transaction can be inservice in multiple servers at a single time. A typical fragment of one is shown inFigure 5.10. As a result, a SAS program to take this data set and organize it so that thereis a variable for each component and an observation for each transaction is somewhatmore complex than the datastep that serves a similar purpose for components as shownabove in the section ‘‘Data Step Program for Extracting Information.’’ The followingprogram accomplishes this for transactions. It assumes that there was a StripChartwith an ID of 14 that collected data into the corresponding data set named 14.

data chart;retain l 0 no 0 b 0;keep no t id;set _14;if id=0 then do;

t = b;if b>0 then output;no = no + 1;b=0;end;

else if state=0 then do;t=timenow-l;b = b + t;output;end;

else if state=1 then do;l=timenow;end;

run;

proc sort;by no id;

run;

data chart1;set chart;retain time;if id=lag(id) then time = t + lag(t);else do; time = t; output; end; by no;

run;

proc transpose data=chart1 out=chart2;by no;id id;var time;

run;

data chart2; set chart2; drop no _name_;label _0="Time in the System";

Page 87: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

STATISTICS ON TRANSACTION STATE 79

run;

Figure 6.10 shows some of the observations in a CHART2 data set, from the precedingprogram, on data collected by the StripChart in the single-queue multiple-server modelin Figure 6.1.

Figure 6.10. A Portion of the CHART2 Data Set

Each observation in the data set corresponds to a transaction that has traveled throughthe network. The variable 0 has the total system time for the transactions; the variable9 has the time the transactions spent in the component with ID equal to 9; variable 11

has the time the transactions spent in the component with ID equal to 11; and so forth.With these data you can construct the sample path of each transaction that eventuallyarrived at StripChart 14.

Page 88: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

80 CHAPTER 6. ANALYZING THE SAMPLE PATH

Page 89: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

Chapter 7

Selected Examples

This chapter shows examples of several common modeling structures. These modelsaddress such subjects as queues with reneging, priority queues, batch arrivals, andservers that break down. The examples are meant only to show how you would modelthese typical situations using the QSIM application. They are not meant to show howyou would analyze these models to evaluate them or identify optimal parameterizations.

Queues with Reneging

When a customer arrives at a facility that includes queues and service, they may chooseto enter a queue, if there is room, or leave the facility. Once in a queue, they maychoose to leave it if they have waited ‘‘too’’ long. Not entering a queue and leavinga queue are two types of reneging. This example shows how to model some typicalqueues with reneging.

The model in Figure 6.1 shows a single queue for three servers. It models the m/m/c/Ksystem where c = 3 and K = 50. This system has Poisson arrivals to a single queuewith a capacity of K transactions for service by c parallel servers. Another way tomodel this system is with the Multiple-Server, as in Figure 7.1.

Figure 7.1. An m/m/c/K Model

81

Page 90: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

82 CHAPTER 7. SELECTED EXAMPLES

This model is often compared to one with c parallel queues and servers, as in Figure 7.2.

Figure 7.2. A 3-Queue 3-Server Model

In this model, the switch component directs the transaction to one of the three queues.In this case, the transaction is routed to the shortest length queue. This is accomplishedwith two formulas tied to the switch. These are shown in Figure 2.11.

Another variant on the parallel server models in Figure 7.1 and Figure 7.2 hascustomers entering a queue and, if they have waited for ‘‘too long,’’ deciding to switchto another queue. This decision making and queue switching policy is more complexbut can be modeled as in Figure 7.3.

Figure 7.3. A 2-Queue 2-Server Model with Reneging

Page 91: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

QUEUES WITH RENEGING 83

In this model, upon arrival, the transaction is assigned an attribute named ‘‘priority,’’whose value is the current simulation time. This is done in the Modifier componentlabeled ‘‘priority.’’ Next, the transaction goes to a Switch which compares the twoqueues and sends the transaction down the path leading to the shorter of the two queues.Next, the transaction encounters a trigger which schedules the transaction to balk whenit has spent a given amount of time in the queue. The default is a random variablewith exponential with mean 1. When a transaction balks, it goes into another Switchwhich checks whether the other queue is shorter. If it is, the transaction is routed tothe Connector ‘‘a’’ and goes to the end of the other queue. Otherwise the transactiongoes back into the queue it just came out of at the same location after scheduling, inthe Trigger, another, future check.

Page 92: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

84 CHAPTER 7. SELECTED EXAMPLES

Scanning a Queue

In the preceding example, transactions balked from a queue at a time scheduled, by atrigger, before the transaction entered the queue. Similar behavior can be modeled byperiodically scanning all the transactions in a queue and balking those transactions thatmeet some criteria that may be based on the state of the system.

Figure 7.4. Scanning a Queue

Figure 7.4 shows a simple model where the ‘‘Scanning Process’’ controls the periodicsearching of the queue in the main process. The sampler in the ‘‘Scanning Process’’has deterministic, inter-arrival time distribution so that at fixed times a transaction getsa formula and goes to the trigger that starts the scan of the queue. The formula has

where the transaction attribute is ‘‘random.’’ Since the trigger is set tothe queue in the main process and the ‘‘filter’’ trigger message, when the transactionarrives at the trigger the queue is scanned and each transaction whose value of the‘‘random’’ attribute is less than .8 is balked.

Page 93: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

PRIORITY QUEUES 85

Priority Queues

Many types of models require that multiple classes of transactions be served by a singleserver. For example, two different types of customers arrive at an auto repair shop. Onetype needs only minor repairs, the other type needs more major work. If one class haspriority on getting service, then a priority queue is the appropriate modeling choice.Figure ?? shows one such model having two classes.

Figure 7.5. A Priority Queue Example with Two Transaction Classes

The two classes of transactions arrive according to independent Poisson processes asrepresented by the two Samplers. Transactions travel to Modifiers that set the priorityto be either a 1 or a 2. They then enter a Priority Queue with the priority leveldetermining their position in the queue; the higher priority transactions are servicedbefore the lower priority transactions. When the transactions finish service, they entera Switch that directs them to one of two StripCharts as a function of priority class.

The model in Figure ?? assumes that if a class 1 transaction is in service whena class 2 transaction arrives, the class 1 transaction completes service before theclass 2 transaction starts service ahead of any other class 1 transactions in the queue.Figure 7.6 shows how you would modify the model if you wanted to preempt a class1 transaction that was in service when a class 2 arrived.

Page 94: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

86 CHAPTER 7. SELECTED EXAMPLES

Figure 7.6. A Priority Queue Example with Two Transaction Classes and Preemption

For this preemption, you would store the class of the transaction currently in servicein a number holder. This storage is done by the trigger just below the number holder.Then, when a class 2 transaction arrives, it causes a check of the class of the transactionin service. If it is class 1 then it is preempted. Notice that any preempted class 1transactions are routed back into the queue.

Page 95: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

BATCH ARRIVALS I 87

Batch Arrivals I

The model in Figure 7.7 shows one way to represent batch arrivals. The compoundcomponent labeled ‘‘Arrival Process’’ has a sampler with the batch inter-arrival timedistribution set. When a transaction arrives in this process, it traverses to the Triggerlabeled ‘‘Reset’’ which resets the Sampler labeled ‘‘Batch Source.’’

Figure 7.7. Batch Arrivals

The transaction then goes to the Trigger labeled ‘‘Start’’ which starts the ‘‘BatchSource’’ sampler. The ‘‘Batch Source’’ sampler has a deterministic inter-arrival timedistribution with parameter 0 and capacity c, the batch size. Because of this inter-arrivaltime distribution, when the ‘‘Batch Source’’ sampler is started by the ‘‘Start’’ triggerthe ‘‘Batch Source’’ generates c transactions at the current simulation time and sendsthem to the queue. This is the batch arrival of transactions.

Notice the Probe labeled ‘‘Number in the Queue.’’ The periodic discrete jumps inqueue length show a batch arrival.

Page 96: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

88 CHAPTER 7. SELECTED EXAMPLES

Batch Arrivals II

Another variant on batch arrivals has batch size as a random variable. A simpleextension to the previous model provides this alternative.

Figure 7.8. Batch Arrivals

Figure 7.8 shows two components added to the model of Figure 7.7: a Modifierlabeled ‘‘capacity’’ and a Trigger labeled ‘‘Set Capacity.’’ The ‘‘capacity’’ modifiersamples a uniform random variable on the interval [0; 30] and sets it in the attributenamed ‘‘capacity’’ on the transaction in the ‘‘Arrival Process.’’ The ‘‘Set Capacity’’trigger then sets the capacity of the ‘‘Batch Source’’ sampler to that value. Then, the‘‘Start’’ trigger starts the ‘‘Batch Source’’ arrivals as before.

Compare the Probe labeled ‘‘Number in the Queue’’ in this model to the previousexample. Here, in addition to the timing of the discrete jumps in queue length, the sizeof the discrete jumps in queue length is random.

Page 97: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

NONHOMOGENEOUS POISSON PROCESSES 89

Nonhomogeneous Poisson Processes

In many situations, the arrival rate or service rate is determined by a Poisson processwhose parameter varies as a function of time. For example, if the arrival rate to afast food restaurant varies with the time of day and increases to a local maximumduring meal times, you can sample from a nonhomogeneous Poisson process. In QSIMthere are some limitations to the shape of the rate function that are allowed. Thisfunction must be cyclical and bounded. The software takes the absolute value of therate function to guarantee that it is nonnegative.

In this example, shown in Figure 7.9, the model has deterministic arrival rate andnonhomogeneous Poisson service times.

Figure 7.9. Nonhomogeneous Poisson Service

The service rate is 9 + cos(0:001t), where t is the value of the simulation time whena sample is taken. This rate function is specified via the control panel for the randomvariable, as shown in Figure 7.10.

Page 98: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

90 CHAPTER 7. SELECTED EXAMPLES

Figure 7.10. Nonhomogeneous Poisson Control Panel

In this window you can set two parameters of the process: the rate function and themaximum value that the rate function can take. The rate function is specified as aQSIM formula. When you press the ‘‘Rate Function’’ button, a Formula Managerwindow opens and allows you to specify the function.

Figure 7.11. Rate Function

Figure 7.11 shows the function used in this example. The maximum is needed by thealgorithm that does the sampling. If this is not the correct maximum or the functionspecified is not cyclical, then the sample is not from the desired distribution.

When the transactions from this simple model are displayed in the StripChart as inFigure 7.9, you can see the impact of the cyclical rate function on the transaction timein the system.

Page 99: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

MARKOV-MODULATED POISSON ARRIVALS 91

Markov-modulated Poisson Arrivals

A Markov-modulated Poisson Process (MMPP) is a Poisson process that has itsparameter controlled by a Markov process. These arrival processes are typicalin communications modeling where time-varying arrival rates capture some of theimportant correlations between inter-arrival times. This example has a Markov-modulated Poisson process that serves to control the arrival process to a single queue,single server queueing model.

Figure 7.12. Markov-Modulated Poisson Arrivals

Figure 7.12 shows one way to model an MMPP. The process labeled ‘‘Markov-modulated Poisson Process’’ samples from an MMPP distribution and sets the value ofthe parameter lambda, the mean inter-arrival time for an exponential random variablein the Sampler labeled ‘‘MMPP Arrivals.’’ In the upper process, lambda is given thevalues 10, .1, and 1 based on the state of a Markov chain. The state state is changedin the Modifier components labeled ‘‘state.’’ Each has a conditional componentdriven by an observation of a uniform random variable. So, for a given state, thestate is changed to the next state and the value of lambda is chosen for the ‘‘MMPPArrivals’’ Sampler. The selected lambda is set in the ‘‘MMPP Arrivals’’ Sampler,and the process is delayed for an exponential amount of time whose parameter is state

Page 100: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

92 CHAPTER 7. SELECTED EXAMPLES

dependent. The transaction then goes to a switch that routes based on the state for thenext state change.

Page 101: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

STATE-DEPENDENT SERVICE 93

State-Dependent Service

In many situations, the rate of service depends on the type of service being performed.For example, the time it takes for a teller to service a customer in a bank depends on thetype of service requested. State-dependent service distributions are modeled similarlyto the Markov-modulated Poisson arrivals. Consider the example shown in Figure ??,in which there are multiple classes of transactions to a single queue.

Figure 7.13. State Dependent Service

Figure 7.13 shows this model with the addition of a Modifier to set the exponentialmean service time. When the transaction leaves the queue to begin service, it passesthrough a Trigger that sets the parameter for the service time as a function of the classof transaction that is to receive the service. In addition to the parameter, other modelscan change the shape of the service distribution.

Page 102: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

94 CHAPTER 7. SELECTED EXAMPLES

Servers that Break Down I

You may have a need to model a server that periodically breaks down and is repaired.For example, a machine on an assembly line may periodically fail. Figure 7.14 showssuch a model. The component labeled ‘‘Server’’ is the server that experiences downperiods when it cannot service transactions.

Figure 7.14. A Server that Breaks Down

The process in the compound component labeled ‘‘Break Down Loop’’ models thebreakdown behavior. The transaction pool has a capacity of 1 so that, when it is started,one transaction is generated that cycles through the breakdown loop for the rest of thesimulation. This loop has two delays: ‘‘Delay 1’’ models the time when the ‘‘Server’’is in operation; ‘‘Delay 2’’ models the time when the ‘‘Server’’ is broken. The twotriggers, labeled ‘‘Down’’ and ‘‘Up,’’ stop and start the ‘‘Server.’’

Page 103: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

SERVERS THAT BREAK DOWN II 95

Servers that Break Down II

Another variant of the server breakdown model concerns what happens to the transactionthat is in service when the breakdown occurs. In the model in Figure 7.14, even thoughthe ‘‘Server’’ is stopped when it breaks down, the transaction in service completesservice. The model in Figure 7.15 adds the preemption of the transaction in service,which is routed back into the queue.

Figure 7.15. A Server that Breaks Down

By default, the transaction is placed at the end of the FIFO queue. So, if there wereother transactions waiting for service, the preempted transaction would be behind them.Another variant on this model would place the preempted transaction into the frontof the queue even though the queue was a FIFO for nonpreempted transactions. Thisvariant could be accomplished using a priority queue where the transaction priority isthe simulation time at the time the transaction arrived to the queue. See the precedingexample on priority queues.

Page 104: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

96 CHAPTER 7. SELECTED EXAMPLES

Batch Service I

Suppose that you want to service transactions in a batch where you start servicesimultaneously on all the items in the batch but the individual service times areindependent and identically distributed. This might occur in a drying process, whereyou have arrivals to a drying machine determined by some arrival process. Whenthere are enough items to fill the batch, the baking of all the items in the batch begins.However, as each item drys it is removed individually from the drying machine.

Figure 7.16. Batch Service

The model in Figure 7.16 accomplishes this batch service. In this model the multiple-server is set to the batch size and the ‘‘Server On’’ compound component turns theserver on if it is empty and there are 10 or more transactions in the FIFOQueue.The Trigger labeled ‘‘Server Off’’ turns the server off when each transaction leavesservice. When a server is off all transactions currently in service complete normallybut the server will not send out messages for additional transactions. As a result serviceon all transactions in process will complete but additional arrivals to the system willqueue until there are at least 10 and the server is empty.

Notice the Probe labeled ‘‘Server Utilization.’’ It shows the number of transactions inservice over time. It demonstrates graphically the batch service and independent natureof the service completions.

Page 105: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

BATCH SERVICE II 97

Batch Service II

Some situations demand a somewhat different approach to batch service; for example,consider a washing machine. The machine is started when enough items have arrivedfor service to complete the batch. However, unlike the preceding example, all the itemsin the batch finish at the same time. The model in Figure 7.17 accomplishes this.

Figure 7.17. Batch Service

In this model the service distribution in the Multiple-Server labeled ‘‘Batch Server’’is deterministic with a large parameter value for example, D. The Server labeled‘‘Delay’’ provides the actual sample of the service time for the entire batch. And the‘‘Batch Server’’ is turned on before the ‘‘Delay’’ and off after service for the batchis complete. Since turning the server off does not preempt transactions currently inservice, there is another Trigger labeled ‘‘Preempt’’ that preempts all the transactionsin the ‘‘Batch Server.’’ Since the transactions are preempted, they leave the server viathe balk node.

Notice the Probe labeled ‘‘Server Utilization.’’ It shows the number of transactions inservice over time. It demonstrates graphically the batch service and dependent natureof the service completions.

Note that, because of the modeling technique used here the service time distribution isthe minimum of D andX , an exponential random variable. If you want the service timedistribution to be X , then use caution in choosingD so that the probability thatX > D

is very small and highly unlikely to occur within the number of samples planned.

Page 106: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

98 CHAPTER 7. SELECTED EXAMPLES

Batch Service III

Another variant on batch service has the transactions accumulating into a batchaccording to the arrival process and has service scheduled as soon as the firsttransaction arrives. Service on the entire batch completes at once.

Figure 7.18. Batch Service

Figure 7.18 shows a model of this batch service. When the first transaction arrivesto the Server labeled ‘‘Delay’’ it initiates the definition of a batch. Any othertransactions that arrive to that server are disgarded through the balk node. When thedelay is complete the Trigger labeled ‘‘Preempt Service’’ terminates service on allthe transactions in the Multiple-Server labeled ‘‘Batch Server.’’ As the transactionsarrive they accumulate in the Multiple-Server for batch service. This server has adeterministic service distribution with a large parameter value for example, D. Notethat because of the modeling technique used here, the service time distribution is theminimum of D and X , an exponential random variable. If you want the service timedistribution to be X , then use caution in choosingD so that the probability thatX > D

is very small and highly unlikely to occur within the number of samples planned.

Notice the Probe labeled ‘‘Server Utilization.’’ It shows the number of transactions inservice over time. It demonstrates graphically the accumulation of the batch and thedependent nature of the service completions.

Page 107: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

ASSEMBLY 99

Assembly

In a model of manufacturing systems there is often assembly of subunits into largerunits. The assembly cannot occur unless all of the subunit pieces are available. Animportant component for modeling this behavior is the Adder.

Figure 7.19. Assembly Unit

Figure 7.19 shows the assembly of two subunits into a larger unit. Each subunit lineproduces components as modeled by servers 1 and 2. These subunits queue in thebuffers at the end of the subunit assembly lines. When the multiple-server is free itrequests a transaction from the Adder. The Adder requests one transaction from eachof the lines going into it. If there is a transaction available from each of these lines,then it requests one. When all the transactions have arrived at the Adder, it generatesa new transaction, which is sent down the arc to the multiple-server.

Page 108: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

100 CHAPTER 7. SELECTED EXAMPLES

Servers as Resources I

There are instances in which where the system needs to schedule concurrent servicefrom multiple servers on a single transaction. In these situations you can think ofservers as resources that are being utilized by the transactions. For example, in anauto repair facility, several mechanics (modeled as servers) can work on a single car(the transaction) at a time. The Splitter is useful for treating servers as resources andcapturing concurrent use of the resources.

Figure 7.20. Servers as Resources

Figure 7.20 shows a simple model with arrivals from two sources, each sending thetransactions into a queue. If the two servers are free and there is a transaction in FIFO1, then the first transaction inserted into the queue will flow to both the servers andservice will start in each. The service times in each of these is independent (unless youconstruct and use a service time distribution that destroys this independence). WhenServer 2 becomes free, it requests a transaction. If Server 1 is busy, then the requestcan only be honored by a transaction in the FIFO 2 queue. When Server 1 becomesfree, it requests a transaction that can only be honored if Server 2 is free and there is atransaction in FIFO 1.

Page 109: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

SERVERS AS RESOURCES II 101

Servers as Resources II

In the preceding example, the resources (servers) performed service independently ona transaction. However, there are situations where the resource may be used in a morecontrolled way. Suppose there are two parallel lines that each require the use of ashared resource (a crane, for example).

Figure 7.21. Servers as Resources

Figure 7.21 shows such a model. As in the last example, the Splitter is used tocapture the shared use of the resources by a transaction. In addition, there is a Triggerafter each of the servers in the parallel lines. These triggers release the transactionfrom service in any other servers. So the time the transaction uses the Crane is theminimum of the time scheduled for Crane use and the line service time. In particular,if the service time in Server 1 is X and the service time specified for the Crane is Y ,then the service time that the transaction actually receives in the Crane is min(X; Y ).This occurs because either the transaction finishes with the Crane before it is done withservice in Server 1 (or Server 2) or it finishes with service in Server 1 (or Server 2)before the Crane service is completed. In this case, Trigger 1 (or Trigger 2) sends the‘‘RemoveFromServers’’ messages (see Figure 2.27), which removes that transactionfrom any servers in which it may be receiving service. In this case, the transaction canbe explicitly removed from service by the Crane.

Page 110: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

102 CHAPTER 7. SELECTED EXAMPLES

Special Routing

There are other ways that independent streams can share resources. One is illustratedin Figure 7.22.

Figure 7.22. Special Routing

Here the Modifiers labeled ‘‘routeToId’’ set the attribute ‘‘routeToId’’ to the id of‘‘FIFO 1’’ or ‘‘FIFO 2.’’ When the transaction finishes with the service of the ‘‘Crane’’and traverses to the Trigger labeled ‘‘RouteToId,’’ it is routed to the component whoseid is in its attribute ‘‘routeToId.’’ This is another way that transactions can be routedthrough the network.

Page 111: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

References

Bratley, P., Fox, B.L. and Schrage, L.E. (1983), A Guide to Simulation, New York:Springer-Verlag.

Fischer, W. and Meier-Hellstern K. (1992), “The Markov-modulated Poisson process(MMPP) cookbook,” Performance Evaluation, 18, 149-171.

Fishman, G.S. (1978), Principles of Discrete Event Simulation, New York: John Wiley& Sons.

Gross D., and Harris C.M. (1985), Fundamentals of Queueing Theory, Second Edition,New York: John Wiley & Sons.

Kleijnen, J.P.C. (1987), Statistical Tools for Simulation Practitioners, New York:Marcel Dekker, Inc.

Kleijnen, J.P.C. (1974), Statistical Techniques in Simulation - Part I, New York:Marcel Dekker, Inc.

Kleijnen, J.P.C. (1975), Statistical Techniques in Simulation - Part II, New York:Marcel Dekker, Inc.

Law, A.M., and Kelton, W.E. (1982), Simulation Modeling and Analysis, New York:McGraw-Hill Book Company.

Rubinstein R.Y. (1981), Simulation and the Monte Carlo Method, New York: JohnWiley & Sons.

103

Page 112: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

104 CHAPTER 7. SELECTED EXAMPLES

Page 113: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

Index

AAdder, 26, 38, 99Analyze, 73--74, 77analyze data, 31animation, 38arcs, 6, 36

segmented, 38are you busy message, 12arrivals

batch, 87--88attribues, 42attributes, 21--22, 40

BBalk node, 15, 24Bar Chart, 33--35buffer, 17

Ccheck box

Collect Data, 73--74, 77Collect Data, 73--74, 77component dictionary data set, 66component id, 46, 66component state sample path, 67, 72compound components, 47

controlling exposure, 49editing, 52popup menu, 48

connecting components, 36Connector, 35, 83, 102control panel, 7

Bar, 35Compound Component, 50DataSource, 59Exponential Control Panel, 57FIFO Queue, 17MModifier, 23Modifier, 22MServer, 15MTrigger, 20NumberHolder, 27Probe, 32, 55, 72Sampler, 13Simulation, 70, 73--74StripChart, 30Switch, 24Trigger, 19, 28

Ddata collection, 30, 39DataSource Control Window, 59DataSource Distribution, 59Deterministic Distribution, 56distribution, 19, 55

DataSource, 59Deterministic, 56Erlang, 56Exponential, 56Formula, 58Gamma, 56IUniform, 56Markov-modulated Poisson, 91Mixture, 58Nonhomogeneous Poisson, 56, 89Uniform, 56

Eelementary components, 11Erlang Distribution, 56Exponential Distribution, 56--57Expose/Hide Details, 12

FFIFO Queue, 16Formula Distribution, 58Formula Manager Window, 24, 42, 90formulas, 42

GGamma Distribution, 56graphs, 65

Hhistogram

queue length, 74time in queue, 77

Iimages, 39IUniform Distribution, 56

LLabel, 35LIFO Queue, 16Load Templates Window, 65

105

Page 114: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

logicAdder, 26Bar, 35MModifier, 23Modifier, 22MTrigger, 21NumberHolder, 28Probe, 33Queue components, 17Router, 25Server components, 15Source components, 13Splitter, 26StringHolder, 28StripChart, 31Switch, 25Trigger, 19

Logic Components, 18

MM/M/1 Queue, 8Markov-modulated Poisson Process, 91MModifier, 22model, 62

assembly, 99batch arrivals, 87--88batch service, 96--98queue with reneging, 81, 84routing, 102scanning a queue, 84servers as resources, 100--102service break down, 94--95state-dependent service, 93

Modifier, 21, 40, 42, 83MServer, 14, 55MTrigger, 20

NNonhomogeneous Poisson Distribution, 56Nonhomogeneous Poisson Process, 89Nonhomogeneous Possion Parameter Window, 89number in a queue, 69NumberHolder, 26NumberHolder Control Panel, 27

Ppie chart

server utilization, 75popup menu, 6

Bar Chart, 33popup menu selections

Add Bar, 33Arc, 6Assemble Components, 48Attributes, 57Control Panel..., 6, 12Create Template..., 53

Disassemble Components, 48Duplicate, 36Edit, 48, 52Expose/Hide Details, 6, 12, 48Grab, 6on arcs, 37Options, 48Select Components..., 50Start, 6Stop, 6Tools, 6

Port, 35, 49Priority Queue, 16, 83, 85Probe, 29, 31, 55, 69, 72Probe Control Panel, 72pull-down menu selections

Graph..., 65Model..., 62Open..., 62State..., 62

pulldown menu selectionsSave As, 61

push buttonAnalyze, 73--74, 77

Qquery message, 12queue

priority, 83reneging, 81, 84scanning a queue, 84

Queue Components, 16queue length statistics, 72

Rrandom variation, 55Router, 23, 42

Ssample path, 66, 69Sampler, 6, 12, 38, 55, 70

batch arrivals, 87--88SAS data set, 30, 39, 73--74, 76, 78SAS Graph, 65Save Model Window, 62Save State Window, 62Save Templates Window, 64saving information, 61

component dictionary data set, 66component state sample path, 67graphs, 65model, 62sample path, 66state, 62template, 63transaction state sample path, 67

Server, 55

Page 115: QSIM Application: Discrete Event Queueing … Application Discrete Event Queueing Simulation ... QSIM Application Discrete Event Queueing Simulation ... queueing system, control the

as resource, 100--102batch, 96--98break down, 94--95state-dependent service, 93

Server Components, 14server utilization, 69server utilization statistics, 74Simulation Control Panel, 7, 70, 73--74Simulation Window, 3slider

changeing the slider range, 57Source Components, 12Splitter, 26, 100--101start the simulation, 70state, 62, 72state change, 12, 19--20, 23statistics, 31, 72

queue length, 72server utilization, 74time in the system, 77

stop the simulation, 70StringHolder, 26StripChart, 29Stripchart, 29StripChart, 67, 69, 77Switch, 23, 42, 44, 83system performance

queue length, 72server utilization, 74time in the system, 77

Ttemplate, 63Template Name Window, 53templates, 52time in a queue, 69time in service, 69time in system, 69time in the system statistics, 77toolbar, 4

command buttons, 4customizing, 64Formula Manager, 43state buttons, 4

Toolbar Manager Window, 63transaction

attributes, 21--22, 40generation, 13history, 39, 77timing of arrivals, 41

transaction arrival, 12Transaction Pool, 12, 38transaction state sample path, 67transactions, 38

saving state information, 67Trigger, 19, 55

delayed trigger event, 19

Trigger Control Pane, 27trigger message, 12, 40

UUniform Distribution, 56User Interface, 2

Wwindow

Compound Node Editor, 52DataSource Control, 59Formula Manager, 24, 42, 58, 90Load Templates, 65Nonhomogeneous Possion Parameter, 89NumberHolder Control Panel, 27Probe Control Panel, 72Save Graph, 65Save Model, 62Save State, 62Save Templates, 64Simulation Control Panel, 7, 70, 73--74Simulation Manager, 3Slider Attributes, 57Template Name, 53Toolbar Manager, 63

Trigger Control Panel, 27