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

gpss_manual

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

Action

JOIN Blocks operate in "Numeric Mode" when a number is specified by the B Operand, and otherwise in "Transaction

Mode".

In Numeric Mode, operands A and B are evaluated numerically, and the number specified by B is included in the

Numeric Group specified by A. If this number is already a member of the Numeric Group, no operation is performed.

There is some loss of efficiency when non-integers are used in

Numeric Groups.

In Transaction Mode, the entering Transaction is included in the Transaction Group specified by the A Operand. If the Transaction is already a member of the Transaction Group, no operation is performed.

Numeric Groups are distinct from Transaction Groups even if they have the same Group number.

Transactions are in no way restricted because of their membership in a Transaction Group. After membership is achieved, the entering Transaction proceeds to the Next

Sequential Block. The only way that a Transaction can be removed from a Group is to be terminated in a TERMINATE or ASSEMBLE Block, or to be chosen for removal in a REMOVE Block.

Special Restriction

A must be positive.

Refuse Mode

A Transaction is never refused entry to a JOIN Block.

Related Blocks

Transactions in Transaction Groups can be referenced by

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

REMOVE Blocks.

Related SNAs

GNEntnum - Numeric Group count. GNEntnum returns the membership count of Numeric Group

Entnum.

GTEntnum - Transaction Group count.

GTEntnum returns the membership count of

Transaction Group Entnum.

Related Windows

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

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

LEAVE

A LEAVE Block increases the accessible storage units at a Storage Entity.

LEAVE A,B

Operands

A - Storage Entity name or number. Required. The operand must be Name, PosInteger, ParenthesizedExpression, SNA, or

SNA*Parameter.

B - Number of storage units. The default is 1. Optional. The operand must be Null, Name, PosInteger,

ParenthesizedExpression, SNA, or SNA*Parameter.

Example

LEAVE RepairMen,10

In this example, when a Transaction enters the LEAVE Block, the available storage units at the Storage Entity named

RepairMen is increased by 10.

Action

When a Transaction enters a LEAVE Block, Operand A is evaluated and truncated, and the corresponding Storage Entity is found. If no such entity exists, an Error Stop occurs. Storage entities must be defined in STORAGE Commands.

The number of storage units to be freed is found by evaluating and truncating Operand B. If B was not used, then it is assumed to be 1.

Then the available storage at the Storage Entity is increased by the value of the B Operand. If the result exceeds the original storage capacity of the Storage Entity, an Error Stop occurs.

If no error occurs, the Transaction is scheduled for the Next Sequential Block and is placed on the Current Events Chain ahead of its priority peers.

When storage becomes available, the Delay Chain of the

Storage Entity is examined in decreasing priority for Transactions whose demands can now be met. A "first-fit-with-skip" discipline is used. Successful Transactions are allowed to enter the ENTER Block which refused them and then are placed on the CEC behind their priority peers. This is done before the current Active Transaction in the LEAVE Block proceeds in the simulation. In this way, no other Transaction can buck the line of Transactions waiting on the Delay Chain of the Storage Entity. You can see this in the Blocks Window. You will see the Transaction enter the ENTER Block and come to rest. The current Active Transaction in the LEAVE Block will then resume its movement.

Special Restrictions

A must refer to a previously defined Storage Entity defined by a STORAGE Statement.

B must be nonnegative.

An attempt to free more storage than was defined will cause an Error Stop.

Refuse Mode

A Transaction is never refused entry to a LEAVE Block.

Related Command

A Storage Entity must be defined in a STORAGE Command before it can be updated by an LEAVE Block. The STORAGE

Command must exist in the model, or must be sent to the

Simulation Object interactively, before a Transaction can enter the LEAVE Block. Any attempt to do so before the Storage

Entity is defined, cases an Error Stop.

A Storage Entity can be redefined by an interactive STORAGE

Command.

Related SNAs

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

Entnum.

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

Storage Entity Entnum.

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

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

SEEntnum - Storage empty. SEEntnum returns

1 if Storage Entity Entnum is completely unused,

0 otherwise.

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

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

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

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.

LINK

A LINK Block controls the placement of the Active Transaction on the User Chain of a Userchain Entity.

LINK A,B,C

Operands

A - Userchain number. The Userchain Entity which may receive the entering Transaction. Required. The operand must be Name, PosInteger, ParenthesizedExpression, SNA, or

SNA*Parameter.

B - Chain ordering. The placement of new Transactions on the

Userchain. Required. The operand must be LIFO, FIFO,

ParenthesizedExpression, SNA, or SNA*Parameter.

C - Next Block location. The destination Block for Transactions

which find the Link Indicator of the Userchain in the off state

(reset). Optional. The operand must be Null, Name,

PosInteger, ParenthesizedExpression, SNA or SNA*Parameter.

Example

LINK OnHold,FIFO

In this example, the Active Transaction is placed at the end of the User Chain Entity named OnHold. It is removed from all chains except Transaction Groups and Interrupt Chains. In other words, preemptions are not cleared. The Transaction remains on the User Chain until some other Transaction enters an UNLINK Block and specifically removes it. In the present example, the Transaction is placed at the end of the User

Chain named OnHold.

Action

The simplest operation of a LINK Block occurs when the C

Operand is not used. In this case, the entering Transaction is always placed on the User Chain specified by Operand A. It is removed from all other chains except transaction groups and interrupt chains.

The placement of the Transaction in the User Chain is controlled by Operand B. If FIFO (First-In-First-Out) is used for

Operand B, newly arriving Transactions are placed at the tail of the User Chain. If LIFO (Last-In-First-Out) is used for Operand

B, newly arriving Transactions are placed at the head of the

User Chain. Any other item used in Operand B is evaluated for the Active Transaction and again for each Transaction on the

User Chain, beginning at the front, until the value for the Active

Transaction is greater. When a Transaction whose value is less than that of the Active Transaction is found, the Active Transaction is placed on the User Chain immediately in front of it. If the value for the Active Transaction never exceeds the value for an occupant of the User Chain, the Active Transaction is placed at the end of the chain. This leads to a descending order. P class SNAs are an exception. They are queued in ascending order of Parameter value.

If you do not use LIFO or FIFO in Operand B, you will normally use a Transaction oriented SNA such as PR, M1 or a class P

SNA. However, indirect addressing may also be useful. If PR is used, the Transactions are placed in priority order. And finally, if a Parameter number is specified, the Transaction is inserted into the chain immediately behind those Transactions whose Parameter value is less than that of the entering Transaction.

The situation is more complicated when the C Operand is used.

A flag called a "Link Indicator" is part of each Userchain Entity. The Link Indicator is useful for using a User Chain to control the queuing of Transactions on a resource. It is on (set) when the hypothetical resource is "busy" and off (reset) when the hypothetical resource is "not busy". When the Link Indicator of a Userchain Entity is off, if the C Operand is used, the LINK Block will not place the Transaction on the User Chain. The Link Indicator is useful for letting the first of several Transactions avoid the User Chain and for causing following Transactions to be placed on the User Chain.

If the C Operand is used, the entering Transaction will NOT be placed on the User Chain if the Link Indicator is off. Instead, the Transaction will proceed to the Block specified by C, and then the Link Indicator will be set. Following Transactions entering the LINK Block will go onto the User Chain.

The Link Indicator is manipulated by both LINK and UNLINK Blocks. It is turned off (reset) when an UNLINK Block finds the

User Chain empty. It may be useful to think of the Link Indicator as representing the "busy condition" of a hypothetical resource. When the Link Indicator is set, the resource is "busy".

When a Transaction finds the resource idle it should not have to wait (on the User Chain). The Transaction would proceed to the Block specified by Operand C and the LINK Block then sets the Link Indicator of the Userchain Entity.

Consider two Transactions arriving at a LINK Block, one after

the other. If, for example, the first Transaction does not enter an UNLINK Block before the second Transaction arrives, the second Transaction would find the Link Indicator on (set), and would be placed on the User Chain. In this example, when the first Transaction enters an UNLINK Block, the second

Transaction is removed from the User Chain. At this time, the Link Indicator remains on (set). Then, when the second Transaction enters an UNLINK Block, and no waiting Transactions are found on the User Chain, the Link Indicator is finally turned off (reset).

User Chains allow you manipulate the queuing mechanisms of

Transactions to a much more detailed level than do Facilities or

Storages. It is possible to implement very complicated scheduling algorithms using LINK and UNLINK Blocks.

User Chains can be used to reduce the amount of computer time wasted on unsuccessful tests associated with GATE,

TEST, TRANSFER BOTH, and TRANSFER ALL Blocks. You can create faster simulations by placing blocked Transactions on User Chains when there is no possibility of a successful condition test. Then, you must introduce each Transaction back into its test Block when an event occurs which might unblock the Transaction.

Special Restrictions

A, B, and C, if specified, must be positive.

C, if specified, must be a Block location in the simulation.

Refuse Mode

A Transaction is never refused entry to a LINK Block.

Related SNAs

CAEntnum - Average Userchain content. The time weighted average number of chained Transactions for Userchain Entnum.

CCEntnum - Total Userchain entries. The cumulative count of all Transactions chained to Userchain Entnum.

CHEntnum - Current Userchain content. The current number of Transactions chained to

Userchain Entnum.

CMEntnum - Maximum Userchain content. The maximum number of Transactions chained to Userchain Entnum. The "high water mark".

CTEntnum - Average Userchain residence time.

The average duration of s Transaction at

Userchain Entnum.

Related Window

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

LOGIC

A LOGIC Block changes the state of a Logicswitch entity.

LOGIC O A

Operands

O - Logic operator. Required. The operator must be S, R, or I.

A - Logicswitch Entity number. Required. The operand must be

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

Example

LOGIC S PowerSwitch

In this example, the Logicswitch Entity named PowerSwitch is left in the true or "set" state.

Action

A LOGIC Block is used to set, reset, or invert the state of a Logicswitch Entity. A Logicswitch Entity has two states, on (set, or 1) and off (reset, or 0). If the logic operator is S or R, the

Logicswitch Entity specified by the A Operand is left in the set or reset state, respectively.

If the logic operator is I, the state of the Logicswitch Entity specified by the A Operand is inverted. This means that if it is found to be set, it will be reset. If it is found to be reset, it will be set.

Logical Operators

A logical operator is required. It may be S, R, or I with the following effect:

S - The logic switch is left in the "set" or on state.

R - The logic switch is left in the "reset" or off state.

I - The logic switch is inverted.

Refuse Mode

A Transaction is never refused entry to a LOGIC Block.

Related SNA

LSEntnum - Logic switch set. LSEntnum returns 1 if Logic Switch Entity Entnum is in the "set" state, 0 otherwise.

Related Window

Logicswitches Window - Online view of Logicswitch Entity dynamics.

LOOP

A LOOP Block modifies a Parameter and controls the destination of the Active Transaction based on the result.

LOOP A,B

Operands

A - Parameter containing count. required. The operand must be Name, PosInteger, ParenthesizedExpression, SNA, or SNA*Parameter.

B - Block number. Next Block if count nonzero after decrement. Optional. The operand must be Null, Name, PosInteger,

ParenthesizedExpression, SNA, or SNA*Parameter.

Example

LOOP Customer_Count,Start_Over

Let us assume in this example that the Start_Over Block precedes the LOOP Block in the simulation. In this example, when a Transaction enters the LOOP Block its Parameter named Customer_Count is decremented by 1. If the result is nonzero, the Transaction proceeds to Block location

Start_Over. This causes the Transaction to continue to loop until the value of the Parameter named Customer_Count is 0.

The Transaction then proceeds to the Next Sequential Block.

Action

When a Transaction enters a LOOP Block, Operand A is evaluated, truncated, and used to find the Transaction Parameter with that number. If there is no such Parameter, an

Error Stop occurs. Otherwise the value of the Parameter is decreased by 1.

If the new value of the Parameter is greater than zero and the B Operand is specified, the Transaction is scheduled for the location specified in the B Operand. Otherwise, the Transaction proceeds to the Next Sequential Block.

Special Restriction

A must be positive.

Refuse Mode

A Transaction is never refused entry to a LOOP Block.

Related SNA

PParameter or *Parameter - Parameter value.

PParameter returns the value of Parameter

Parameter.

Related Windows

Blocks Window - Online view of Block dynamics.

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

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