Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

gpss_manual

.pdf
Скачиваний:
49
Добавлен:
05.06.2015
Размер:
1.88 Mб
Скачать

Figure 5—23. The TableWindow

Figure 5—24. The User Stops Window

Figure 5—25. The Current Events Chain Snapshot

Figure 5—26. The Future Events Chain Snapshot

Figure 5—27. The Numeric Groups Snapshot

Figure 5—28. The Transaction Snapshot

Figure 5—29. The Userchains Snapshot

Figure 5—30. The Transaction Groups Snapshot

Figure 5—31. The Journal Window

Chapter 6 - GPSS

Commands

You use Commands to define entities and to control the running of simulations. Commands may be part of the Initial

Model Translation, or they may be sent as Interactive

Statements to an existing simulation.

As part of the Initial Model Translation, Commands are sent to the Simulation Object as a group, after all the Blocks have been sent. Otherwise, they are sent when you enter them. These are called Interactive Commands.

To send a Command to an existing simulation use the Command menu in the Model Window. This will Translate a

Command and send it to the Simulation Object for execution.

Every simulation has a Command Queue associated with it. The Simulation Object performs each Command on the queue one after the other, until it is HALTed or until it runs out of things to do. Even Commands in the Model File, other than HALT and SHOW, are placed on the Command Queue before they are performed.

Commands are either Immediate or Queued. Immediate Commands, such as HALT and SHOW, are performed as soon as they are received by the Simulation Object Other Commands are queued. They are placed at the end of a list of

Commands which have not yet been completed. When a Simulation Object has no more Immediate Commands to do on behalf of a simulation, it performs the next Command on the simulation’s Command Queue. If a simulation is running when an Immediate Command is received, the simulation is temporarily suspended while the Immediate Command is performed.

The HALT Command is a special case. Not only is it an

Immediate Command, but it also deletes any remaining Commands still on the Command Queue. After a HALT

Command is performed, the Simulation Object has nothing more to do on behalf of that simulation.

It is often convenient to put a list of frequently used Commands in a small text file. You can then use an INCLUDE Command to send the whole sequence to the Simulation Object. Even easier, you can load a function key with an INCLUDE Command, and have the whole Command list performed by a single keystroke. Chapter 2 shows you how to do this.

The Commands are:

BVARIABLE - Define a Boolean Variable Entity. CLEAR - Reset statistics and remove Transaction.

CONTINUE - Resume the simulation. EQU - Assign a value to a User Variable. EXIT - End the GPSS World Session. FUNCTION - Define a Function Entity.

FVARIABLE - Define an Fvariable Entity.

HALT - Stop the simulation and delete all Queued Commands. INCLUDE - Read and Translate a secondary Model File.

INITIAL - Initialize or modify a Logicswitch, Savevalue, or

Matrix Entity.

INTEGRATE - Automatically integrate a time differential in a

User Variable.

MATRIX - Define a Matrix Entity.

QTABLE - Define a Qtable Entity.

REPORT - Set the name of the Report File or request an immediate report.

RESET - Reset the statistics of the simulation.

RMULT - Set the seeds of the first 7 Random Number Generators

SHOW - Evaluate and display Expression.

START - Set the Termination Count and begin a simulation. STEP - Attempt a limited number of Block entries.

STOP - Set a Stop Condition based on Block entry attempts.

STORAGE - Define a Storage Entity.

TABLE - Define a Table Entity.

VARIABLE - Define a Variable Entity.

Operands

Statements usually have one or more operands which you must fill in. Most operands have several different forms which are valid. In the descriptions which follow, a valid class of operands may be described by an italicized word. You must choose a member of the class and type it into the Operand field. For example, if one of the valid forms of an operand is given as PosInteger, you could type:

21

The italicized words are usually suggestive, but you may need to refer to the formal definition in the Appendix.

Windows

A wide variety of windows are available for you to observe the effects of Commands on your simulations. In general, windows are specialized by the entity type.

Model Window - Text View — Full screen textual model editor.

Journal Window - Record session events.

Blocks Window - Online view of Block dynamics.

Expressions Window - Online view of values of

Expressions.

Facilities Window - Online view of Facility Entity dynamics.

Logicswitches Window - Online view of Logicswitch Entity dynamics.

Matrix Window - Online view of the dynamics of a Matrix cross-section.

Plot Window - Online view of a plot of up to 8 Expressions.

Queues Window - Online view of Queue Entity dynamics.

Savevalues Window - Online view of Savevalue

Entity dynamics.

Storages Window - Online view of Storage

Entity dynamics.

Table Window - Online view of Table Entity dynamics.

Transaction Snapshot - Picture of the state of a

Transaction in the simulation.

CEC Snapshot - Picture of the state of the

Current Events Chain in the simulation.

· FEC Snapshot - Picture of the state of the Future Events Chain in the simulation.

Numeric Groups Snapshot - Picture of the state of the Numeric Groups in the simulation.

Userchains Snapshot - Picture of the state of the Userchain Entities in the simulation.

Transaction Groups Snapshot - Picture of the state of the Transaction Groups in the simulation.

BVARIABLE

A BVARIABLE Command defines a Bvariable Entity.

NAME BVARIABLE X Label/Operand

NAME - Entity Label for this entity. Required. The field must be

Name.

X - Expression. Required. Must be Expression. Expressions are discussed in Section 3.4.

Example

LINE11 BVARIABLE (BV$CLK’AND’BV$PHASE2)

This example defines a Bvariable Entity which is to be evaluated when a BV$LINE11 SNA is encountered. When it is evaluated, the result is 1 ("TRUE") if the CLK and the PHASE2 Bvariable Entities are TRUE when evaluated. Otherwise, the LINE11 Bvariable returns a 0 ("FALSE").

Action

The BVARIABLE Command is a Queued Command. When the

Simulation Object receives one, it places it at the end of the simulation’s Command Queue.

When a BVARIABLE Command is performed, the Simulation

Object creates or redefines a GPSS Bvariable Entity. The

Bvariable Entity so created is evaluated when a System

Numerical Attribute in the BV class, referring to this particular entity, is encountered by the Simulation Object.

The Expression contained in a BVARIABLE Command is evaluated according to the rules in Chapter 3, and may include calls to PLUS Procedures or to Library Procedures. The final result is converted to integer 0, if 0, or to integer 1 if the result was not zero. The evaluation proceeds differently in GPSS/PC

Compatibility Mode.

Expressions must be well-formed according to the rules of elementary algebra. A formal definition can be found in the

Appendix. You may use any of the arithmetic and logic operators listed in Section 3.4. If SNAs are used in the Expression field, they are evaluated with respect to the Active Transaction. A Named Value which has not been explicitly assigned a value cannot be used as an item in an Expression. To do so, you must assign a value to it before the Expression is evaluated. Assignments to User Variables are done by EQU Commands or in PLUS Procedures.

Expressions in BVARIABLE Command are not limited to logical operators. They may include arithmetic operators and calls to Library Procedures. The truth values of TRUE and FALSE are treated internally as integer 1 and 0, respectively.

Once a Bvariable Entity is created in a simulation, it is never destroyed. However, it may be redefined later by an interactive BVARIABLE Command.

GPSS/PC Compatibility

All SNAs are truncated in GPSS/PC Compatibility Mode.

In Bvariable Entity evaluation in GPSS/PC Compatibility Mode, the intermediate results are truncated.

Related SNA

BVEntnum - Result of evaluating Bvariable Entity Entnum.

CLEAR

A CLEAR Command returns the simulation to the unused state.

CLEAR A

Operand

A - ON or OFF. If the A Operand is omitted, ON is assumed.

Optional. The operand must be ON, OFF or Null.

Action

The CLEAR Command is a Queued Command. When the Simulation Object receives one, it places it at the end of the simulation’s Command Queue.

The CLEAR Command resets all statistics accumulators, clears all Transactions from the simulation, then primes each GENERATE Block with its first Transaction.

The state of all Facility Entities and Storage Entities is reset to show an unoccupied condition. The contents of all Blocks become 0.

When a CLEAR or CLEAR ON Command is performed:

All Transactions are removed from the simulation.

Current counts are set to 0.

System clock is set to 0.

Facilities are made idle and available.

Tables are set to 0.

Storages are set to full availability.

Space-time products of Facilities, Storages,

Queues, and User Chains are set to 0.

Total counts are set equal to 0.

Minimum and maximum values are set equal to

current content in Queues Entities, Userchain

Entities, and Storage Entities.

Random number generators are not reset.

The local count of generated Transactions in a

GENERATE Block is set to 0.

Members are removed from all numeric Groups.

Savevalue Entities are set to zero.

Logicswitch Entities are reset.

Matrix elements are set to 0.

If a CLEAR OFF is used, all of the above occur except the last three items. When Operand A is off, Savevalue Entities,

Logicswitch Entities, and Matrix Elements are left unchanged.

Special Restrictions

None.

Related SNAs

None.

CONDUCT

A CONDUCT Command begins an experiment.

CONDUCT A

Operands

A - PLUS Experiment Procedure Call. Optional. The operand must be ProcedureCall.

Action

The CONDUCT Command is an Immediate Command.that can only be sent to a HALTed Simulation Object.

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