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

gpss_manual

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

Chapter 4.

A Storage Entity may be redefined by entering a new STORAGE Command with the same label as the old one.

If you must refer to Storage Entities by number, not name, an

EQU Command should precede the STORAGE definition. This is necessary if you wish to reference a range of STORAGES in a SELECT or COUNT Block.

Related SNAs

REntnum - Unused storage capacity. The storage content (or "token" spaces) available for use by entering Transactions at storage Entnum.

SEntnum - Storage in use. SEntnum returns the amount of storage content (or "token" spaces) currently in use by entering Transactions at storage Entnum.

SAEntnum - Average storage in use. SAEntnum returns the time weighted average of storage capacity (or "token" spaces) in use at storage

Entnum.

SCEntnum - Storage use count. Total number of storage units that have been entered in (or "token" spaces that have been used at) storage

Entnum.

SEEntnum - Storage empty. SEEntnum returns 1 if storage Entnum is completely unused, 0 otherwise.

SFEntnum - Storage full. SFentnum returns 1 if storage Entnum is completely used, 0 otherwise.

SREntnum - Storage utilization. The fraction of total usage represented by the average storage in use at storage Entnum. SREntnum is expressed in parts-per-thousand and therefore returns an real value 0-1000, inclusively.

SMEntnum - Maximum storage in use at storage Entnum. The "high water mark".

STEntnum - Average holding time per unit at storage Entnum.

SVEntnum - Storage in available state.

SVEntnum returns 1 if storage Entnum is in the available state, 0 otherwise.

Related Blocks

ENTER - take or wait for available storage space.

LEAVE - release storage space for use by other

Transactions.

Related Windows

GPSS storage entities are visible in the

Storages Window.

Any SNA can be viewed in an Expressions or

Plot Window.

TABLE

A TABLE Command initializes a frequency distribution table.

NAME TABLE A,B,C,D Label / Operands

NAME - Entity Label for this entity. Required. The field must be Name. The length of a Table name is limited to 32 characters.

A - Table argument. The data item whose frequency distribution is to be tabulated. Required. The operand must be

ParenthesizedExpression, SNA or SNA*Parameter.

B - Upper limit of first frequency class. The maximum argument

which causes the first frequency class to be updated. Required.

The operand must be Number or String.

C - Size of frequency classes. The difference between the

upper limit and lower limit of each frequency class. Required. The operand must be Number or String.

D - Number of frequency classes. Required. The operand must be PosInteger.

Action

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

A TABLE Command is used to define a GPSS Table Entity for collecting a frequency distribution, its cumulative relative frequencies, its mean, and its standard deviation.

To collect a data item, a Transaction must enter a TABULATE

Block which refers to this TABLE. When a TABULATE Block is entered, the table argument (Operand A in the TABLE

Command) is evaluated. If it is less than or equal to the B

Operand of the TABLE Command, the first frequency class of the table is chosen. If the table argument does not fit into the first frequency class, the class is chosen by dividing the argument value by the C Operand of the TABLE Command.

The lower limit of a frequency class is included in the previous class. If the table is not large enough to accommodate this value, the last frequency class in the table is chosen.

Then the integer in the chosen frequency class and the accumulated count is incremented by the B Operand of the

TABULATE Command. The default increment is 1.

Finally, accumulators for the mean and standard deviation of the table are updated.

A Table Entity can be redefined or reinitialized by a second

TABLE Command with the same label as the first.

Example

SalesTable TABLE P$Price,9.95,10,10

In this simple example, the distribution of the Price Parameter of Transactions is entered into the table named SalesTable. The TABLE Command creates a table with a total of 10 frequency classes.

All Price values at or below 9.95 cause the first frequency class of the table to be updated. Normally, this means that the integer for the first frequency class is increased by 1. However, a weighting factor is available in the B Operand of the TABULATE Block. This has the effect of adding the weighting factor to the current integer value in the appropriate frequency class. The weighting factor applies to the mean and standard deviation as well, having the same effect as multiple entries into the TABULATE Block.

If the value of the Price Parameter is greater than 89.95, the tenth, and last, frequency class will be updated. If the value of

the Price Parameter falls in neither the first nor the last frequency class, it is used to choose from the equally spaced frequency classes from the second to the ninth.

For example, if the Price value is 29.49, the third frequency class would be updated.

The statistics collected in a GPSS Table Entity are printed in the standard report. An example is in Chapter 11.

Memory Restriction

Table Entities are limited to the maximum memory request in the Model Settings Notebook.

This is discussed in Chapter 2.

Related SNAs

TBEntnum - Nonweighted average of entries in table Entnum.

TCEntnum - Count of nonweighted table entries in table Entnum.

TDEntnum - Standard deviation of nonweighted table entries in table Entnum.

Related Blocks

TABULATE - register statistics for a data item in a Table Entity.

Related Windows

A Table can be viewed in the online Table

Window.

Any SNA can be viewed in an Expressions or Plot Window.

VARIABLE

A VARIABLE Command defines an arithmetic Variable Entity.

NAME VARIABLE X Label / Operand

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

Name.

X - Expression. Required. Expressions are discussed in

Section 3.4.

Example

Var1 VARIABLE 5#LOG(Q$WaitingLine)

This Command defines a Variable Entity which is to be evaluated when a V$Var1 is encountered. When this SNA is evaluated, the Expression defining the Variable Entity named Var1 is evaluated and returned as the result.

Action

The VARIABLE 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 VARIABLE Command is performed, the Simulation

Object creates or redefines a GPSS Variable Entity. The

Variable Entity so created is evaluated when a System Numerical Attribute in the V class, referring to this particular entity, is encountered by the Simulation Object.

The Expression in a VARIABLE Command is evaluated according to the rules in Chapter 3, and may include calls to PLUS Procedures or to Library Procedures. 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.

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

VARIABLE Command.

If the simulation is not run in GPSS/PC Compatibility Mode,

FVARIABLE and VARIABLE Commands are treated the same.

GPSS/PC Compatibility

All SNAs are truncated in GPSS/PC Compatibility Mode.

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

Related SNA

VEntnum - Returns the result of evaluating an arithmetic Variable Entity Entnum.

Related Windows

Any SNA can be viewed in an Expressions or Plot Window.

Chapter 7 - Block

Statements

You use Block Statements to create GPSS Block Entities.

Block Statements which are part of the Initial Model Translation create permanent Blocks in the simulation. A Block Statement sent to an existing simulation creates a one-time temporary

Block to be used in a mode called Manual Simulation. This is discussed in more detail in Section 2.3.

A model is simply a sequence of Model Statements. A GPSS

World Model Statement is either a GPSS Statement or a PLUS

Procedure definition. The GPSS Statements, in turn, are either

Block Statements, which cause a Block to be created, or

Commands, which do not. Any Model Statement can be sent to an existing simulation as an Interactive Statement.

This chapter contains reference information for each Block Statement supported by GPSS World.

The GPSS Block statements are: ADOPT - Change Assembly Set.

ADVANCE - Place Transaction on Future Events Chain. ALTER - Test and modify Transactions in a Group. ASSEMBLE - Wait for and destroy related Transactions. ASSIGN - Modify Transaction Parameter.

BUFFER - Place Transaction at end of the Current Events Chain.

CLOSE - End the Data Stream.

COUNT - Place count of entities into a Transaction Parameter.

DEPART - Decrement content of a Queue Entity.

DISPLACE - Change the Next Sequential Block of a Transaction.

ENTER - Occupy or wait for storage units in a Storage Entity.

EXAMINE - Test group membership.

EXECUTE - Perform action specified by a different Block. FAVAIL - Change status of a Facility Entity to "available".

FUNAVAIL - Change status of a Facility Entity to "not available".

GATE - Test entity and modify Transaction flow. GATHER - Wait for related Transactions.

GENERATE - Create Transaction and place on Future Events

Chain.

INDEX - Modify Transaction Parameter.

INTEGRATION - Turn the integration of a User Variable On or Off.

JOIN - Place a member into a Numeric or Transaction Group. LEAVE - Release storage units of a Storage Entity.

LINK - Move Transaction to Userchain Entity. LOGIC - Modify Logicswitch Entity.

LOOP - Decrement Parameter, jump to different Block if result is nonzero.

MARK - Place value of system clock into Transaction Parameter.

MATCH - Wait for related Transaction to reach conjugate MATCH Block.

MSAVEVALUE - Assign value to Matrix Entity element. OPEN - Initialize a Data Stream.

PLUS - Evaluate PLUS Expression and save result in Parameter.

PREEMPT - Displace Facility owner. PRIORITY - Modify Transaction priority.

QUEUE - Increment content of a Queue Entity.

READ - Bring the next line of data from a Data Stream.

RELEASE - Free Facility Entity.

REMOVE - Take a member out of Numeric or Transaction Group.

RETURN - Free Facility Entity.

SAVAIL - Change status of Storage Entity to "available". SAVEVALUE - Assign a value to Savevalue Entity.

SCAN - Test Transaction group, place value in Parameter.

SEEK - Change the line pointer in a Data Stream. SEIZE - Assume ownership of or wait for a Facility Entity.

SELECT - Place selected entity number into Transaction

Parameter.

SPLIT - Create related Transaction.

SUNAVAIL - Change status of Storage Entity to "not available".

TABULATE - Update Table Entity.

TERMINATE - Destroy Transaction, decrement Termination Count.

TEST - Test arithmetic condition and modify Transaction flow. TRACE - Set Trace Indicator of the Active Transaction.

TRANSFER - Move to specified Block.

UNLINK - Remove Transaction from Userchain Entity. UNTRACE - Turn off Trace Indicator in the Active Transaction.

WRITE - Send a value to a Data Stream.

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 state of Blocks and their effects on the other entities in your simulations. In general, windows are specialized by the entity type.

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

Block Input Window - Drag and Drop model building.

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 User Chains in the simulation.

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

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