Tutorial

From Sigma

(Difference between revisions)
Jump to: navigation, search
(Edges)
(Vertices)
Line 75: Line 75:
-
[[image:tutorial4.png|thumb|494px|The Dialog Box for the RUN Vertex|center]]
+
[[image:tutorial4.png|thumb|418px|The Dialog Box for the RUN Vertex|center]]
The ENTER vertex is where customers join the line. Open the dialog box for the ENTER vertex. This vertex simply increments the number of customers waiting in line (QUEUE=QUEUE+l). Note that QUEUE has been entered as a display variable, so its value will be shown while the simulation is running. Close this dialog box and then double-click on the START vertex.
The ENTER vertex is where customers join the line. Open the dialog box for the ENTER vertex. This vertex simply increments the number of customers waiting in line (QUEUE=QUEUE+l). Note that QUEUE has been entered as a display variable, so its value will be shown while the simulation is running. Close this dialog box and then double-click on the START vertex.

Revision as of 23:22, 23 July 2008

Contents

A Tutorial on the Basics of SIGMA

An overview of the SIGMA software environment is presented in this chapter in tutorial format. All primary elements of event relationship graph modeling are explained. Technical details are presented in later sections.

Starting a SIGMA Session

Double click on SIGMA.EXE to begin a SIGMA modeling session. SIGMA does not automatically load a model, but they can easily be recalled using the File/Recall menu command.

The SIGMA Modeling Environment

A simulation graph window similar to the one in Figure 3.1 will appear when a SIGMA session begins. This is the primary window for a SIGMA modeling session. Linked to this modeling session are simulation plot windows and output windows. Note: Several SIGMA modeling sessions may run simultaneously; thus, several simulation graph windows representing different models may be open at one time.

SIGMA's Simulation Graph Window
SIGMA's Simulation Graph Window

There are three regions in the simulation graph window: the model creation area (the region in the center of the window), the menu bar (located along the top of the window), and the toolbar (located along the right side of the window).

The various push buttons in the toolbar are identified in Figure 3.2. The Start Run and End Run tools allow you to start or stop a simulation run; the Select or Edit, Create Process, and Create Single Edge tools let you quickly create a model; the Single Step tool allows you to watch the simulation as each event is executed; and the Run Time Information and Show SIGMA Version tools provide you with additional information. In addition, fifteen User Tool buttons allow you to add previously created models to a new modeling session.

SIGMA Toolbar
Image:buttons1.png Select or Edit
Image:buttons2.png Create Process
Image:buttons3.png Create Single Edge
Image:buttons4.png Show SIGMA Verion
Image:buttons5.png Start Run
Image:buttons6.png End Run
Image:buttons7.png Single Step
Image:buttons8.png User Tool

A window is activated when the mouse pointer is clicked anywhere on it. As the various windows are activated, the menu bar changes. The menu bar for the simulation graph window contains the following menus: File, Edit, Run, Variables, Zoom, Window, and Help. The simulation plot window contains the File, Edit, Options, Window, and Help menus; the output window contains the File, Edit, Search, Window, and Help menus.

When a SIGMA session is started, the mouse pointer is normally in Create Process mode (*). It is in this mode that the graphical components of a simulation model are created. If you click the right mouse button, the mouse pointer will change to Select or Edit mode (*). This mode is used to add or change information related to specific vertices or edges. Just double-click on a vertex or edge, and an Edit Edge or Edit Vertex dialog box will appear. Add information or make changes by clicking on the appropriate box and entering the data from the keyboard. Clicking the right mouse button will cause the mouse to alternate between the Create Process mode and Select or Edit mode. Pressing the appropriate push buttons on the tool bar will also activate the Create Process mode or the Select or Edit mode.

Exploring Our Carwash Model

We will use a previously created model, CARWASH.MOD, to examine the components of a SIGMA model. To begin, start a SIGMA session. Open CARWASH.MOD by pressing the File\Open command, pressing Event Graph, and then double-clicking on CARWASH.MOD from the list of previously created models in the dialog box.. This model is represented in Figure 3.3.

An Event Graph for a Single Server Queue, CARWASH.MOD
An Event Graph for a Single Server Queue, CARWASH.MOD

Recall that CARWASH.MOD has only two state variables: QUEUE, the number of cars waiting in line, and SERVER, the status of the machine, 0=BUSY and 1=IDLE.. Four events are represented by the four vertices in the carwash model. The RUN vertex starts the simulation, the ENTER vertex models customers entering the carwash, the START vertex occurs when a car starts service in the washing bay, and the LEAVE vertex occurs when a car finishes service and leaves the washing bay. The time intervals between successive customer arrivals to the carwash are independent and random.

Network Users

WARNING: You should not use a floppy drive or a write-protected network drive as your default drive.

[[this text must be rephrased]]

NETWORK USERS: If you are running SIGMA from a network server, your default drive is probably write-protected. Thus, you will get a system error message if you run the simulation as described in Step 4. You must add a drive letter before the output file name in the Run Options dialog box. For example, you should change UNTITLED.OUT to C:\UNTITLED.OUT so you can write the output to your C: drive. (Click on the Options command under the Run menu. In the Run Options dialog box, add the drive letter to the name of the file in the Output File text box. Next, click on the OK button and proceed to Step 4.) You should not use a floppy drive as your default drive as this will slow the running of your simulation considerably.

State Variables

Click the mouse on the Create/Edit Variables command under the Variables menu to see the list of state variables for this model in the State Variable Editor dialog box. Any state variables you define can be used anywhere in your SIGMA model. We refer to them as state variables to emphasize that they are accessible to all parts of the model. Clicking on one of the state variables in this dialog box will cause the details associated with that state variable to be displayed in the input boxes above (as in Figure 3.4.)

The State Variable Editor Dialog Box
The State Variable Editor Dialog Box

The dialog box for state variables, like other SIGMA dialog boxes, has a line for a brief description of the object. These descriptions are important; they appear as comments in your SIGMA-generated simulation source code and make your model much easier to understand. Click on the Cancel command button to close the state variable dialog box and return to the simulation graph seen in Figure 3.3.

We will further explore this model by clicking the mouse on elements in the event graph. Make sure that the mouse pointer is in Select or Edit mode. Read the description in each dialog box as we

Vertices

Double-click on the RUN vertex. This vertex, whose dialog box is shown in Figure 3.5, was the first vertex created in this model. SIGMA calls the first vertex created vertex number 1; it will always be executed first when the model is run. (This first vertex is colored green on the screen.)

The RUN vertex has a parameter: the state variable, QUEUE. When CARWASH.MOD is run, you will be asked to provide an initial value for the number of customers in the QUEUE when the system opens for service. All SIGMA state variables are initialized to be equal to zero. The only state change associated with the RUN vertex is to make the SERVER available (SERVER=1). To exit, click your mouse on the Cancel command button.


The Dialog Box for the RUN Vertex
The Dialog Box for the RUN Vertex

The ENTER vertex is where customers join the line. Open the dialog box for the ENTER vertex. This vertex simply increments the number of customers waiting in line (QUEUE=QUEUE+l). Note that QUEUE has been entered as a display variable, so its value will be shown while the simulation is running. Close this dialog box and then double-click on the START vertex.

The START service vertex is where the server is made busy (SERVER=O) and the number of customers waiting in line is decremented (QUEUE=QUEUE-1). Close the START vertex dialog box and open the LEAVE dialog box.

The LEAVE vertex makes the server available to serve other customer (SERVER=1). Note that if the variable, QUEUE, were defined as the number of customers in the total system (in service as well as in line), QUEUE would be decremented in the LEAVE vertex rather than in the START vertex. Close this dialog box.

The event vertices are relatively straightforward in discrete event models. The complexity of the models comes at the edges of the event graph, where the dynamic and logical relationships between events are specified.

Edges

Next, we will examine each of the edges in our model. Figure 3.6 is the edge dialog box that you should see if you double-clicked on the edge between the RUN vertex and the ENTER vertex.

Edge Dialog Box from RUN Vertex to ENTER Vertex Schedules the First Customer Arrival
Edge Dialog Box from RUN Vertex to ENTER Vertex Schedules the First Customer Arrival


Back to Main Page

Personal tools