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

gpss_manual

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

STEntnum - Average holding time per unit at

Storage Entity Entnum.

SVEntnum - Storage in available state.

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

Related Window

Storages Window - Online view of Storage

Entity dynamics.

SAVEVALUE

A SAVEVALUE Block changes the value of a Savevalue Entity.

SAVEVALUE A,B

Operands

A - Savevalue Entity number. Required. May be followed by +

or - to indicate addition or subtraction to existing value. Required. The operand must be Name, PosInteger,

ParenthesizedExpression, SNA, or SNA*Parameter, followed by +, -, or Null.

B - The value to be stored, added, or subtracted. Required.

The operand must be Name, Number, String,

ParenthesizedExpression, SNA, or SNA*Parameter.

Examples

SAVEVALUE Account,99.95

In this example, the Savevalue Entity named Account takes on the value 99.95.

SAVEVALUE The_Bard,"A rose by any other name ..."

In this example, the Savevalue Entity named The_Bard is assigned a string. If the Savevalue Entity does not exist, it is created.

Action

An SAVEVALUE Block is used to assign, increment, or decrement the value of a Savevalue Entity.

The A Operand is evaluated numerically, truncated, and used as the Savevalue Entity number.

Operand B is evaluated and used to determine the new value for the Savevalue Entity. If Operand A is followed by +, then the numeric equivalent of Operand B is added to the numeric equivalent of the old value. If Operand A is followed by -, then the numeric equivalent of Operand B is subtracted from the numeric equivalent of the old value. If Operand A is not followed by a sign, the old value of the SAVEVALUE is replaced by Operand B.

Refuse Mode

A Transaction is never refused entry to a SAVEVALUE Block.

Related SNA

XEntnum - Savevalue. The value of Savevalue

Entnum is returned.

Related Windows

Expressions Window - Online view of values of expressions.

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

Savevalues Window - Online view of Savevalue Entity dynamics.

SCAN

A SCAN Block passes information from a Transaction Group member to the Active Transaction.

SCAN O A,B,C,D,E,F

Operands

O - Conditional operator. Relationship of B to C for the

Transaction Group member to be chosen. These choices are explained below. Optional. The operator must be Null, E, G,

GE, L, LE, MAX, MIN, or NE.

A - Transaction Group number. Group whose members will be scanned. Required. The operand must be Name, PosInteger,

ParenthesizedExpression, SNA, or SNA*Parameter.

B - Test value. PR or Parameter number. The member attribute

which determines whether the Group member Transaction should be selected. It is evaluated with respect to the

Transaction Group member. Optional. The operand must be

PR or Null, Name, PosInteger, ParenthesizedExpression, SNA, or SNA*Parameter.

C - Reference value. The value against which the B Operand is compared. The default is 0. Optional. The operand must be

Null, Name, Number, String, ParenthesizedExpression, SNA, or SNA*Parameter.

D - Retrieved value. PR or Parameter number. The member

attribute which is to be assigned to a Parameter of the Active

Transaction. It is evaluated with respect to the Transaction Group member. Required. The operand must be PR, Name,

PosInteger, ParenthesizedExpression, SNA, or SNA*Parameter.

E - Receiving Parameter number. The Parameter number of

the entering Transaction which will receive the value retrieved from Operand D. Required. The operand must be Name,

PosInteger, ParenthesizedExpression, SNA, or SNA*Parameter.

F - Alternate Block number. The alternate destination for the entering Transaction. Optional. The operand must be Null, Name, PosInteger, ParenthesizedExpression, SNA, or

SNA*Parameter.

Examples

SCAN MAX Inventory,P$Price,,P$PartNumber,100

In this example, all Transactions in the Transaction Group

Inventory are examined in order to find the Parameter named Price with the greatest value. The first Transaction with a maximal Price Parameter value is then selected for evaluation of the D Operand. The value of the PartNumber Parameter of the selected Transaction Group member is assigned to

Parameter number 100 of the Active Transaction. If the

Transaction Group is empty, no action occurs.

SCAN E Lot11,PartNum,127,Price,Price,Phone

In this example, when a Transaction enters the SCAN Block, the Transaction Group named Lot11 is scanned for the first

Transaction which has a value of 127 in its Parameter named

PartNum If such a Transaction is found, the value in its

Parameter named Price is transferred to the corresponding Parameter of the Transaction entering the SCAN Block. The entering Transaction then proceeds to the Next Sequential Block. If no such Transaction Group member is found, the entering Transaction proceeds to the Block labeled Phone.

Operands D and E need not specify the same Transaction

Parameter.

Action

A SCAN Block finds the first Transaction in a Group which passes all tests, and stores one of its attributes in a Parameter of the Active Transaction. If no such Parameter exists for the

Active Transaction, one is created. If an appropriate Transaction Group member cannot be found, no value is stored.

The Transaction Group member may be chosen on the basis of a test of one of its attributes. This is done by using operands B, C, and/or a conditional operator. If no such test is used, the first Transaction in the Group, if any, is selected.

When a Transaction Group member is found to satisfy a test, its attribute, which is specified by Operand D, is copied into the Parameter of the Active Transaction, specified by the E

Operand. In this case, the Active Transaction always proceeds to the Next Sequential Block.

If no Transaction is found to satisfy the requirements, the

Active Transaction may optionally be directed to the Block specified by the F Operand. Otherwise, it proceeds to the Next

Sequential Block.

If you use operands B, C, or a conditional operator, the first Transaction Group member to pass the test is selected. Operand B specifies which attribute of the member

Transactions is to be tested. It may be compared to the minimum or the maximum of all such Group member attributes by using MIN or MAX as the conditional operator. The first Transaction in the Transaction Group which has the maximum or minimum attribute is selected. If you use MIN or MAX, you must not use Operand C.

You may compare the Group member attribute to Operand C,

with or without a conditional operator. In this case, the conditional operator must not be MIN or MAX. The default for

Operand C is 0.

Operands B and D always refer to the Transaction Group member under test. Notice that any SNA may be used. Any

SNA which requires a Transaction for its evaluation uses the current Transaction Group member under test. The result returned by any SNA, other than PR, is used as a Parameter number, whose value is returned as the final result.

The default for the conditional operator is E for equality. If you use no conditional operator, but you use Operand B and

Operand C, the values must be equal for the member

Transaction attribute to be selected.

The F Operand indicates an alternate destination Block to be taken by the entering Transaction when no Transaction is found which satisfies the conditions specified. If F is not used, the entering Transaction always proceeds to the Next

Sequential Block.

Conditional Operators

The conditional operator may be E, G, GE, L, LE, MAX, MIN, or

NE. If no conditional operator is used, E (equality) is assumed. When the condition is true, the Transaction being tested is selected. The conditions are defined as follows:

E - The member Transaction attribute specified by Operand B must be equal to the reference value specified by Operand C for the member Transaction to be selected.

G - The member Transaction attribute specified by Operand B must be greater than the reference value specified by Operand C for the member Transaction to be selected.

GE - The member Transaction attribute specified by Operand B must be greater than or equal to the reference value specified by Operand C for the member Transaction to be selected.

L - The member Transaction attribute specified by Operand B must be less than the reference value specified by Operand C for the member Transaction to be selected.

LE - The member Transaction attribute specified by Operand B must be less than or equal to the reference value specified by Operand C for the member Transaction to be selected.

MAX - The member Transaction attribute specified by Operand B must be equal to the greatest such attribute of all Transactions in the

Group for the member Transaction to be selected.

MIN - The member Transaction attribute specified by Operand B must be equal to the smallest such attribute of all Transactions in the

Group for the member Transaction to be selected.

NE - The member Transaction attribute specified by Operand B must be unequal to the reference value specified by Operand C for the member Transaction to be selected.

Special Restrictions

If Operand C is used, you must use Operand B.

If MIN or MAX is used for the conditional operator, Operand C must not be used.

Refuse Mode

A Transaction is never refused entry to a SCAN Block.

Related Blocks

Transactions and numbers are added to Groups by JOIN

Blocks. Transactions in Groups can be referenced by ALTER, EXAMINE, REMOVE, and SCAN Blocks.

Related SNA

GTEntnum - Transaction Group count.

GTEntnum returns the membership count of

Transaction Group Entnum.

Related Windows

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

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

SEEK

A SEEK Block sets the Current Line Position of a Data Stream.

SEEK A,B

Operands

A - New Current Line Position. Required. The operand must be

Name, PosInteger, ParenthesizedExpression, SNA or

SNA*Parameter.

B - Data Stream Entity. Optional. The operand must be Null, Name, PosInteger, ParenthesizedExpression, SNA or SNA*Parameter.

Example

SEEK 20,Data_Base

In this example, the SEEK Block changes the Current Line Pointer of the Data Stream Data_Base to 20.

Action

A Data Stream is a sequence of text lines used by a GPSS World simulation. Each Data Stream is identified by a unique number. Chapter 4 (4.16) contains a full discussion of Data

Streams, including the error code descriptions under the

Section entitled Data Streams.

Each Data Stream has a Current Line Position. This is a

1-relative index to the next line position to be read or written.

When a Transaction enters a SEEK Block, Operand A is evaluated numerically and used as next Current Line Position.

If Operand B is used, it is evaluated numerically and used as the Data Stream Entity number. It must be a positive integer. If

Operand B is not specified, the SEEK is applied to Data Stream number 1.

If an error is detected, the error code is stored internally. A CLOSE Block can be used later to retrieve the Error Code.

Refuse Mode

A Transaction is never refused entry to a SEEK Block.

Related Blocks

OPEN - Create a Data Stream.

CLOSE - Shut down a Data Stream.

READ - Retrieve a text line from a Data Stream.

WRITE - Send a text line to a Data Stream.

SEIZE

When the Active Transaction attempts to enter a SEIZE Block, it waits for or acquires ownership of a Facility Entity.

SEIZE A

Operand

A - Facility name or number. Required. The operand must be

Name, PosInteger, ParenthesizedExpression, SNA, or

SNA*Parameter.

Example

SEIZE Teller1

In this example, when a Transaction attempts to enter the

SEIZE Block, the state of the Facility named Teller1 is tested. If it is idle, ownership is given to the Active Transaction, which is allowed to enter the SEIZE Block and proceed to the Next

Sequential Block (NSB). If the Facility is busy (owned), the Active Transaction comes to rest on the Delay Chain of the

Facility.

Action

A SEIZE Block enables a Transaction to acquire ownership of a Facility. If the Facility is idle (not owned), the Transaction immediately acquires ownership of it, enters the SEIZE Block, and attempts to enter the next Block. If the Facility is already owned, the Transaction comes to rest, last within its priority, on the Delay Chain of the Facility and does not enter the SEIZE Block.

Refuse Mode

A Transaction is refused entry to a SEIZE Block if it cannot immediately receive ownership of the Facility Entity.

The Active Transaction is refused entry to the SEIZE Block if the Facility entity is in the unavailable state.

When a Transaction is refused entry, its Delay Indicator is set and remains so until the Transaction enters a "Simultaneous"

Mode TRANSFER Block. Simultaneous Mode TRANSFER Blocks are rarely used because a BOOLEAN VARIABLE can more efficiently control the coordination of the state of a number of resources when used in a TEST Block.

Related SNAs

FEntnum - Facility busy. If Facility Entnum is currently busy, FEntnum returns 1. Otherwise FEntnum returns 0.

FCEntnum - Facility capture count. The number of times Facility Entnum has become owned by a

Transaction.

FIEntnum - Facility Entnum interrupted. If Facility Entnum is currently preempted, FIEntnum returns 1. Otherwise FIEntnum returns 0.

FREntnum - Facility utilization. The fraction of time Facility Entnum has been busy. FREntnum is expressed in parts-per-thousand and therefore returns an real value 0-1000, inclusively.

FTEntnum - Average Facility holding time. The average time Facility Entnum is owned by a capturing Transaction.

FVEntnum - Facility in available state. FV Entnum returns 1 if Facility Entnum is in the available state, 0 otherwise.

Related Window

Facilities Window - Online view of Facility Entity dynamics.

SELECT

A SELECT Block chooses an entity and places its entity number in a Parameter of the Active Transaction.

SELECT O A,B,C,D,E,F Operands

O - Conditional operator or logical operator. These choices are

explained below. Required. The operator must be FNV, FV, I, LS, LR, NI, NU, SE, SF, SNE, SNF, SNV, SV, U, E, G, GE, L, LE, MIN, MAX, or NE.

A - Parameter name or number to receive the number of the selected entity. Required. The operand must be Name,

PosInteger, ParenthesizedExpression, SNA, or SNA*Parameter.

B - Lower entity number. Required. The operand must be

Name, PosInteger, ParenthesizedExpression, SNA, or SNA*Parameter.

C - Upper entity number. Required. The operand must be

Name, PosInteger, ParenthesizedExpression, SNA, or SNA*Parameter.

D - Reference value for E Operand when in Conditional Mode. Optional. The operand must be Name, Number, String,

ParenthesizedExpression, SNA, or SNA*Parameter. Not used with MAX or MIN.

E - SNA class name. Entity attribute specifier for Conditional

Mode tests. Required only for Conditional Mode. The type of

SNA implies the entity type. You do not specify the entity number in Operand E. This is done automatically as the entity number range is searched. You may use any entity SNA class.

Optional. The operand must be Null or entitySNAclass.

F - Alternate Block number. The destination Block if no entity is selected. Optional. The operand must be Null, Name,

PosInteger, ParenthesizedExpression, SNA, or

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