Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Gpss tutorial.pdf
Скачиваний:
323
Добавлен:
15.04.2015
Размер:
1.4 Mб
Скачать

Blocks and Transactions

GPSS simulations consist of a network of "Blocks", which represent actions or delays to be encountered by a set of "Transactions", which "enter" one Block, then the next. The whole simulation is simply a sequence of one Transaction entering one or more Blocks, then another Transaction, and so on.

Your job in modeling a real system is to piece together a set of Blocks that cause Transactions to behave in a manner resembling the real (or proposed) system. For example, GENERATE Blocks introduce Transactions into the simulation at simulated time intervals of your choosing. Such Transactions could represent customers, parts, telephone calls, electronic signals, or something else.

Blocks and Transactions are only two of several GPSS Entity types. Generally, when a Transaction enters a Block, some operation is performed on a third Entity. For example, the entry of a Transaction into a SEIZE Block causes a Transaction to "own" a GPSS Entity called a facility. Facility entities are generally used to represent single owner resources.

The first few lessons in this tutorial are not concerned with the action of specific Blocks. You will start to study a small subset of them in Lesson 5. After you begin to feel comfortable with the basic methods of simulation, you should make yourself aware of what the remaining Blocks can do for you. These are listed and discussed in Chapter 7 of the GPSS World Reference Manual. However, you only need to understand a few GPSS Blocks to begin to build models.

Don’t worry about the action of specific Blocks, just yet. We will begin by becoming familiar with the GPSS World Simulation Environment before we look at the GPSS language in any detail.

Lesson 1 - The GPSS World Program

Well, let’s get started. If you have not yet installed GPSS World on your 32 bit Windows-compatible system, please refer to the GPSS World Reference Manual and do so. Unless you are using the Student Version of GPSS World, you will need to get a numeric software key to activate your installation. Here, we'll assume all this has been taken care of.

Normally, installing GPSS World places an item on your Start Menu. Actually, it goes in the Programs submenu. If you prefer to customize your installation by adding a shortcut to GPSS World to your desktop, it's easy to do. Please consult your operating systems documentation for details. In this tutorial we will use only the Start Menu.

To start GPSS World click the Start button, then click Programs, and finally click GPSS World Xxxxx Version on the submenu, where Xxxxx is "Student" or "Commercial", or whatever. You have now opened the GPSS World Main Window.

If you get any error messages you should review Section 2.1 of the GPSS World Reference Manual. If at any time your encounter a GPSS World system error, please consult Chapter 13 of

The GPSS World Reference Manual.

Figure 1—1. The GPSS World Main Window

There are two ways to open a Model Object. You can double click on the file icon in a Windows folder, or you can begin by opening the GPSS World Main Window as we have just done and then use File/Open as described below.

To open a model file, you will have to go to the Samples Folder. The Samples Folder is located as follows:

C:\Program Files\Minuteman Software\GPSS World ...\Sample Model Files

Now let's start to learn some of the features of your new software.

CHOOSE File/Open

Figure 1—2. The File Menu of the Main Window

from the menu. A dialog box similar to the one shown below will appear.

Figure 1—3. The Open File Dialog

GPSS World Windows are described in Chapters 2 and 5 of the GPSS World Reference Manual. If you like, you may want to refer to that material. You do not need it to complete this lesson. At the end of this chapter there is an outline of the various drop down menus found across the top of the GPSS World Main Window. Choosing items from these menus cause the opening of dialog boxes in which you will enter requested information through the keyboard or with your mouse. These menus also allow you to execute commands.

Now, let’s continue. Double click on the Samples Folder. You will see the list of GPSS World Sample Model Files that are available. Double Click on the icon to open SAMPLE1.GPS. You may have to use the scroll bar in the Open File Dialog to find SAMPLE1.GPS in the SAMPLES folder.

SELECT SAMPLE1

SELECT Open

Figure 1—4. The Model Window — Text View of SAMPLE1.GPS

The SAMPLE1.GPS file should now be displayed in the Model Window. You’ll notice that unlike Minuteman’s DOS Version of GPSS (GPSS/PCTM), GPSS World ignores any line numbers in the text lines.

However, GPSS World does use ordinal line numbers, assigned by the full screen text editor, to identify the Statement associated with errors and other conditions. You do not have to worry about these. Later, you can use the Search / Go To Line ... menu item to jump to a specific

text line in the Model Window.

When you read in a Model File, the model has not yet been translated and is not ready to run. Before we run the simulation, let’s explore some of the settings and menu items we can use to manipulate it.

The Main Window is the starting point for GPSS World. You can use its menu to display a text view of your Model Object in a Model Window. From it you create a separate Simulation Object and from that point on, all interactions are seen in the Journal Window or Entity Windows, which are views of the Simulation Object. The Statements in the Model Object must be "Translated" in order to create the corresponding Simulation Object.

Spend a few seconds now, familiarizing yourself with the general organization of the Model Window. For easy reference, an outline of its menus is in the Appendix of this manual.

GPSS World has a full screen text editor with many features found in popular word processors. We will explore the use of this editor in a later chapter.

Let’s use the File menu to Save the model to a file with a different name.

CHOOSE File / Save As

and when the dialog box appears, enter the file name TMP in the highlighted area that currently says SAMPLE1. Then

SELECT Save

The file name at the top of the Model Window changes to TMP. The screen will appear as shown below.

Figure 1—5. The Save As Dialog

The file, which is the same as SAMPLE1.GPS is visible in the Model Window. Let’s add a BUFFER Block after the GENERATE Block. Use the mouse to position the cursor anywhere in the Queue Barber line by moving the mouse pointer to the position and clicking once.

CHOOSE Edit / Insert Line

The cursor is now positioned at the beginning of a new line, directly before the QUEUE Barber line. You can space or tab to position the new Block under the other Block names. Although it is not necessary to line up the GPSS Block statements, doing so makes them easier to read.

TYPE BUFFER

You need not type in upper case letters. We have done so in the models in this manual to make the GPSS World reserved words stand out. Let’s adjust some of the model settings.

CHOOSE Edit / Settings

You will see the Simulate Page of the Model Settings Notebook. There is an in depth discussion of the choices in the Model Settings Notebook in Chapter 2 of the GPSS World Reference Manual.

Let’s leave the Simulation Page Options as they are.

CLICK ON Reports

Figure 1—6. The Report Page of the Model Settings Notebook

You may want to take a brief look at the Random Numbers, Function Keys and Expressions pages of the Model Settings Notebook They contain options that allow you to assign the use of particular Random Number Generators; to assign operations to Function Keys and to add expressions to the Expression Window. For now, let’s leave those pages set as they are.

SELECT OK

to exit the Settings Notebook.

When you create a simulation a Journal Window is automatically opened. It will record any interactions or messages generated by GPSS World.

Let’s create a simulation.

CHOOSE Command / Create Simulation

This action translates the model into a simulation. If there were syntax errors in the model, they would be detected at this time and you would be given a chance to correct them.

We are now ready to run the simulation, but first, let’s take a brief look at the Blocks Window.

CHOOSE Window / Simulation Window / Blocks Window

Figure 1—7. The Detailed View of the Blocks Window

The Detailed view of the Blocks will appear in a new window that now appears on top of the Model Window and the Journal Window. Remember you can resize and reposition any of the windows. Also by clicking anywhere on the window, you can bring any window to the front, making it the active window. Stop to review Windows windowing if you are unsure of the manipulation of the windows. There is one useful trick that is worth mentioning here.

If you chose to just look at the Blocks Window, you will now be looking at the Non-Detailed View of the Blocks in the model. This window will experience on-line update as the simulation runs. Now, in the View menu.

CLICK ON Entity Details

Figure 1—8. The Non Detailed View of the Blocks Window.

You should now see the Non Detailed View of the Blocks Window. Let's go back to the Detailed View.

CHOOSE View

CLICK ON Entity Details

Let’s start the simulation and watch it run in the Blocks Window. Before you do that, resize the Blocks Window so you can see all the Blocks in the model, from GENERATE to TERMINATE.

Let’s now enter an interactive START 300 Command.

CHOOSE Command / START

on the main menu bar of the GPSS World Main Window. When the START dialog box appears, replace the 1.

TYPE 300

and

SELECT OK

CLICK ON Anyplace on the Blocks Window

to see the model running in the window. Now close the window.

DOUBLE click on The Block Icon in the Upper, Left Corner-Blocks Window to close the window.

The simulation will now run very quickly with the window closed. On-line windows always make the simulation run much more slowly than normal.

The simulation should complete quickly. You will see a Report Window open up automatically when the simulation ends. Report Objects are normally created when the simulation's Termination Count reaches zero. Enlarge the window to examine the contents of the report. You should see something like the window shown below.

Figure 1—9. Report Window with a Standard Report

At this point, let’s print the report. If you don’t have a printer available, just skip this part.

CHOOSE File/ Print

Make sure you have the correct printer chosen and that the Report Window is the active window.

SELECT OK

Remember, while you are running a simulation, only keep open the windows that you are actively viewing. If you are finished with a window and will not need it again, close it. The Window / Tile and the Window / Cascade menu commands are sometime useful to tidy up a

lot of windows.

If you will want to view a window again later, you can minimize it by clicking on the button just to the right of the title bar of the window. You can instantly retrieve a minimized window, as well. Icons for minimized windows are found just above the status line.

Don’t forget that when an on-line Window is open or minimized, a continuing sequence of update messages must be sent to it. This means that the simulation run time will be slowed considerably. Snapshot type Windows, on the other hand, are not updated on-line and therefore do not affect the performance of the simulation.

Let’s minimize the Journal Window.

CLICK ON Anyplace on the Journal Window

to make it the active window.

CLICK ON The Left Button in the group of three Right of the Title Bar of the Journal Window Now, let’s bring it back.

CLICK ON The First or Second button on the Right of the Minimized Window

You can see how easy it was to retrieve the window.

Let’s review. We have opened a Model File and we saved a GPSS World Model Object after altering its settings and structure. We have Created the Simulation Object and used two views in the Blocks Window to watch Transactions circulate in the simulation. We have minimized the Journal Window. Finally, we have printed and examined a Standard Report in a Report Object. Next time we will simulate customers arriving at a barber shop.

Let’s end the Session. In the GPSS World Main Window, in the Main Menu,

CLICK ON File

then

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]