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

gpss_manual

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

Example

DEPART WaitingLine

In this example the content of the Queue Entity named

WaitingLine is reduced by one and the associated statistics accumulators are updated.

Action

When a Transaction enters a DEPART Block, Operand A is evaluated, truncated, and used to find the Queue Entity with that number. The Queue Entity is created if necessary. If a

Queue Entity is created, the attempt to decrement the content of the Queue Entity will cause an Error Stop. Manual

Simulation can be used to alter the Queue Entity content interactively.

Operand B specifies the value to be used to decrease the content of the Queue Entity. If B was specified, Operand B is evaluated numerically, truncated, and used as the result. If B was not specified, the value of 1 is used.

Finally, the statistics accumulated on behalf of the Queue Entity are updated. If Qtable Entities have been defined for this same Queue Entity, they are also updated.

Special Restrictions

A and B must be positive, if specified.

If the content of the Queue Entity is about to become negative, an Error Stop occurs.

Refuse Mode

A Transaction is never refused entry to a DEPART Block.

Related SNAs

QEntnum - Current content of queue entity. The current count value of Queue Entity Entnum.

QAEntnum - Average queue content. The time weighted average count for Queue Entity

Entnum.

QCEntnum - Total queue entries. The sum of all queue entry counts for Queue Entity Entnum.

QMEntnum - Maximum queue content. The maximum count (high water mark) of Queue

Entity Entnum.

QTEntnum - Average queue residence time.

The time weighted average of the count for Queue Entity Entnum.

QXEntnum - Average queue residence time excluding zero entries. The time weighted average of the count for Queue Entity Entnum not counting entries with a zero residence time.

QZEntnum - Queue zero entry count. The number of entries of Queue Entity Entnum with a zero residence time.

Related Window

Queues Window - Online view of Queue Entity dynamics.

DISPLACE

A DISPLACE Block moves any Transaction.

DISPLACE A,B,C,D

Operands

A - Transaction number. Required. The operand must be

Name, PosInteger, ParenthesizedExpression, SNA or

SNA*Parameter.

B - Displaced Transaction destination. Block name or number. Required. The operand must be Name, PosInteger,

ParenthesizedExpression, SNA, or SNA*Parameter.

C - Parameter number. Parameter of displaced Transaction to

receive residual time if preempted Transaction is removed from

FEC. Optional. The operand must be Null, Name, PosInteger,

ParenthesizedExpression, SNA, or SNA*Parameter.

D - Alternate destination for the Active Transaction. Block name or number. Optional. The operand must be Null, Name,

PosInteger, ParenthesizedExpression, SNA, or SNA*Parameter.

Example

DISPLACE X$Culprit,Compensate,Residual,NotCaught

In this example, the DISPLACE Block moves the Transaction whose number is kept in the Savevalue named Culprit. If the target Transaction exists, it is sent to the Block labeled

Compensate as its Next Sequential Block. If it was residing on the Future Events Chain, any time left until its reentry into the simulation is calculated and stored in the Parameter named

Residual of the displaced Transaction. If the Transaction was on the FEC and no such Parameter exists, it is created. If the target Transaction does not exist, the Active Transaction moves to the alternate destination Block labeled NotCaught, after entering the DISPLACE Block.

Action

A DISPLACE Block moves any Transaction in the simulation to any Block. The displaced Transaction is removed from Transaction chains, as discussed below, and is scheduled to enter the destination Block.

When a Transaction enters a DISPLACE Block, Operand A is evaluated numerically, truncated, and used to find the Transaction to be displaced. If that Transaction does not exist, processing ceases, and the Active Transaction is sent to the

Alternate Destination specified by Operand D, if any.

If the Transaction exists, it is given the new Block destination specified by Operand B.

If the displaced Transaction is on the FEC, it is removed from it and the residual time duration is calculated as the time which the Transaction is scheduled to come off the FEC minus the current time. If the C Operand is used, the residual time is saved in a Transaction Parameter. If no such Parameter exists and Operand C is used, a new Parameter is created.

When a Transaction is displaced, it is given a new Block destination and is dequeued from:

FEC

PENDING (INTERRUPT-MODE PREEMPT) CHAINS

DELAY (MAJOR PRIORITY) CHAINS

USER CHAINS

RETRY CHAINS

and not dequeued from:

CEC

INTERRUPT (PREEMPTED) CHAINS

GROUP CHAINS

When a Transaction is displaced, preemptions at Facilities are not cleared.

Refuse Mode

A Transaction is never refused entry to a DISPLACE Block.

Related SNA

XN1 - Transaction number of the Active

Transaction.

Related Windows

Blocks Window - Online view of Block 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.

Related Library Procedures

QueryXNExist - determine the existence of a Transaction.

QueryXNParameter - retrieve the value of a Transaction Parameter.

QueryXNAssemblySet - retrieve the Assembly Set of a Transaction.

QueryXNPriority - retrieve the priority of a Transaction.

QueryXNM1 - retrieve the Mark Time of a Transaction.

ENTER

When a Transaction attempts to enter an ENTER Block, it either takes or waits for a specified number of storage units.

ENTER A,B

Operands

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

SNA*Parameter.

B - Number of units by which to decrease the available storage capacity. Default value is 1. Optional. The operand must be

Null, Name, PosInteger, ParenthesizedExpression, SNA, or

SNA*Parameter.

Example

ENTER Toolkit,2

In this example the Active Transaction demands 2 storage units from the storage units available at the Storage Entity named Toolkit. If there are not enough storage units remaining in the Storage Entity, the Transaction comes to rest on the Delay Chain of the Storage Entity.

Action

When a Transaction enters an ENTER Block, Operand A is evaluated and used to find the Storage Entity with that number. If the Storage Entity does not exist, an Error Stop occurs.

Storage entities must be defined by a STORAGE Command.

If the Storage Entity exists, Operand B is used to determine the storage demand. If B was specified, Operand B is evaluated, truncated, and used as the result. If B was not specified, the value of 1 is used.

If the Storage Entity is in the available state, and if there are enough storage units to satisfy the demand, the Transaction is allowed to enter the ENTER Block and the demand is granted by reducing the current storage units by the amount of the demand. Otherwise, the Transaction comes to rest on the

Delay Chain of the Storage Entity in priority order.

When storage units are freed by a LEAVE Block, a

"first-fit-with-skip" discipline is used to choose the next

Transaction(s) to be allowed entry into the ENTER Block. Any such entry is permitted before the Active Transaction leaves the LEAVE Block. This prevents "line-bucking".

When a Transaction enters an ENTER or LEAVE Block, the statistics accumulated on behalf of the Storage Entity are updated.

Special Restrictions

A must be positive.

B must be nonnegative.

A request for more storage than exists will result in an Error Stop. (e.g. a B Operand that is larger than the defined size of the STORAGE named in Operand A.)

Refuse Mode

The Active Transaction is refused entry to the

ENTER Block if its storage demand cannot be met.

The Active Transaction is refused entry to the ENTER Block if the Storage 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. A BOOLEAN VARIABLE can more efficiently control the coordination of the state of a number of resources when used in a TEST Block.

Related Command

A Storage Entity must be defined in a STORAGE Command before it can be updated by an ENTER Block. The STORAGE Command must exist in the model, or must be sent to the

Simulation Object interactively, before a Transaction can enter the ENTER 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.

EXAMINE

An EXAMINE Block may be used to test for membership in a Numeric Group or a Transaction Group.

EXAMINE A,B,C

Operands

A - Group number. Group whose members will be examined.

Required. The operand must be Name, PosInteger,

ParenthesizedExpression, SNA, or SNA*Parameter.

B - Numeric Mode only. The value to be tested for membership in the Numeric Group. Optional. The operand must be Null,

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

C - Block number. Alternate destination for Active Transaction if no membership is found. Required. The operand must be

Name, PosInteger, ParenthesizedExpression, SNA, or

SNA*Parameter.

Examples

EXAMINE ValidColors,P$Color,NotCorrectColor

In this simple example, if the Numeric Group named ValidColors does not include the value contained in the Transaction Parameter named Color, the Active Transaction proceeds to the Block location NotCorrectColor. If the value is a Numeric Group member, the Active Transaction proceeds to the Next Sequential Block (NSB).

EXAMINE ValidXNs,,NotValidXN

In this example, if the Active Transaction is not a member of the Transaction Group named ValidXNs, the Active

Transaction proceeds to the Block location NotValidXN. If the Transaction is a Transaction Group member, it proceeds to the Next Sequential Block (NSB).

Action

An EXAMINE Block operates in either "Numeric Mode" or

"Transaction Mode". If the B Operand is used, the EXAMINE

Block operates in Numeric Mode. In this case the value of

Operand B is tested for membership in the Numeric Group. If the B Operand is not used, the EXAMINE operates in

Transaction Mode. Then, It is the Active Transaction which is tested for membership in a Transaction Group.

When a Transaction enters an EXAMINE Block, Operand A is evaluated and the appropriate Group entity is found. If there is no such Group, one is created.

If the B Operand is used, it is evaluated numerically and the result is tested for membership in the Numeric Group. If

Operand B is not used, the Active Transaction is tested for membership in the Transaction Group specified by the A

Operand.

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

Numeric Groups.

If the membership test fails, Operand C is evaluated, truncated, and used as the destination Block number for the Active Transaction. If the membership test is successful, the Active Transaction proceeds to the Next Sequential Block (NSB).

Special Restrictions

A and C must be positive.

C must be a Block location in the simulation.

Refuse Mode

A Transaction is never refused entry to an EXAMINE Block.

Related Blocks

Transactions and numbers are added to Groups by JOIN

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.

EXECUTE

The EXECUTE Block can cause any Block routine in the simulation to be done on behalf of the Active Transaction.

EXECUTE A

Operand

A - Block number. The name or number of the Block to be

"performed". required. The operand must be Name,

PosInteger, ParenthesizedExpression, SNA, or SNA*Parameter.

Example

EXECUTE P$ActiveBlock

This EXECUTE Block will cause the Block, whose number is in the Parameter named ActiveBlock, to be executed with respect to the Active Transaction.

Action

When a Transaction enters an EXECUTE Block, the A Operand is evaluated and is used to find the Block with that number or name. Then the Block routine associated with the target Block is done on behalf of the Active Transaction.

If the Active Transaction is refused entry to the target Block, it remains in the EXECUTE Block.

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