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

gpss_manual

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

After the target Block routine is performed, the Active

Transaction is normally scheduled for the Block following the

EXECUTE Block. However, if the target Block schedules an alternate destination for the Active Transaction, that Block, and not the EXECUTE Block’s next sequential Block, is scheduled.

Special Restrictions

A must be a Block location in the simulation.

An EXECUTE Block cannot act on another

EXECUTE Block.

Refuse Mode

An EXECUTE Block never refuses entry to a Transaction.

Related Window

Blocks Window - Online view of Block dynamics.

FAVAIL

A FAVAIL Block ensures that a Facility Entity is in the available state.

FAVAIL A

Operand

A - Facility number. Required. The operand must be Name,

PosInteger, ParenthesizedExpression, SNA, or

SNA*Parameter.

Example

FAVAIL Teller1

This Block, when entered by an Active Transaction, will ensure that the Facility Entity named Teller1 is in the available state.

Action

A FAVAIL Block ensures that a Facility Entity is in the available state. If the Facility Entity was previously idle, the FAVAIL

Block tries to give ownership to a waiting Transaction. This is discussed in more detail in Chapter 9.

If the Facility Entity was previously available, FAVAIL has no effect.

FAVAIL cancels the affects of FUNAVAIL on the Facility Entity, but does not affect displaced Transactions.

Refuse Mode

A Transaction is never refused entry to a FAVAIL Block.

Related Block

FUNAVAIL - Place Facility Entity in the unavailable state.

Related SNAs

The SNAs associated with Facilities are:

FEntnum - Facility busy. If Facility Entity

Entnum is currently busy, FEntnum returns 1. Otherwise FEntnum returns 0.

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

FIEntnum - Facility Entnum interrupted. If Facility Entity Entnum is currently preempted,

FIEntnum returns 1. Otherwise FIEntnum returns

0.

FREntnum - Facility utilization. The fraction of time Facility Entity 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 Entity Entnum is owned by a capturing Transaction.

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

Related Window

Facilities Window - Online view of Facility Entity dynamics.

FUNAVAIL

FUNAVAIL Blocks are used to make a Facility Entity unavailable for ownership by Transactions.

FUNAVAIL A,B,C,D,E,F,G,H Operands

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

Name, PosInteger, ParenthesizedExpression, SNA or

SNA*Parameter.

B - REmove or COntinue Mode for owning Transaction. Optional. The operand must be RE, CO, or Null.

C - Block number. New Block for Transaction owning the Facility Entity. Optional. The operand must be Null, Name,

PosInteger, ParenthesizedExpression, SNA, or SNA*Parameter.

D - Parameter number. Parameter to receive residual time if

owning Transaction is removed from FEC. Optional. The operand must be Null, Name, PosInteger,

ParenthesizedExpression, SNA or SNA*Parameter.

E - REmove or COntinue Mode for preempted Transactions. Optional. The operand must be RE, CO or Null.

F - Block number. New Block for Transactions preempted at the Facility Entity. Optional. The operand must be Null, Name,

PosInteger, ParenthesizedExpression, SNA or SNA*Parameter.

G - REmove or COntinue Mode for Transactions pending or

delayed at the Facility Entity. Optional. The operand must be RE, CO or Null.

H - Block number. New Block for Transactions pending or delayed at the Facility Entity. Optional. The operand must be

Null, Name, PosInteger, ParenthesizedExpression, SNA or

SNA*Parameter.

Examples

FUNAVAIL Teller1

This is the simplest way to use the FUNAVAIL Block. The

Facility Entity named Teller1 is "frozen" during the unavailable period. Several types of Transactions other than the Active

Transaction are affected. If an owning Transaction is in an

ADVANCE Block, it will be rescheduled on the FEC automatically when the Facility again becomes available. The time remaining in the ADVANCE Block (i.e. the "residual time") is calculated and saved automatically when the Transaction is removed from the FEC. The residual time becomes the time increment when the Transaction is rescheduled on the FEC.

Other Transactions delayed or pending at TELLER1 will not be able to move during the unavailable period.

FUNAVAIL TELLER,RE,TLR2,300,RE,MGR,CO

In this example, the Facility Entity TELLER is made unavailable. This means that newly arriving Transactions will be delayed. The Transactions at or preempted at the Facility TELLER are dealt with according to operands B-H. If the Transaction which owns Facility TELLER is on the FEC, it is dequeued and the residual time is saved in its Parameter number 300. The owning Transaction is displaced and sent to the Block named TLR2. Transactions currently preempted at Facility TELLER are removed from contention and sent to Block named MGR. Since Operand G is CO, Transactions currently delayed at Facility TELLER are allowed to own the Facility, even though it’s in the unavailable state.

Action

The complexity of the FUNAVAIL Block is due to the three classes of Transactions which must be dealt with:

1.the owning Transaction (operands B-D),

2.preempted Transactions on the Interrupt Chain (operands

E-F), and

3.delayed Transactions on the Delay Chain or Pending Chain (operands G-H).

A FUNAVAIL Block allows you to put a Facility "out of action" and to control the fate of Transactions waiting for, using, or

preempted at the Facility Entity. Transactions arriving during the unavailable period will be delayed and not be granted ownership. A FUNAVAIL Block has no effect if the Facility is already unavailable.

When the REmove option is used, the Transactions are removed from contention for the Facility If the REmove option is used for pending and delayed Transactions, i. e. if G is RE, then H must be used to redirect the Transactions.

When the COntinue option is used, the Transactions on the specific Facility chain may continue to own the Facility, even during the unavailable period. In this case, Facility utilization statistics are adjusted to include this time.

When an alternate destination Block is used, the Transactions are displaced from their current context and redirected to the new Block. Delayed and pending Transactions, which are controlled by operands G and H, cannot be redirected without also using the REmove option. The owning Transaction, controlled by operands B through D, and preempted

Transactions, controlled by operands E and F, can remain in contention for the Facility and yet be displaced to a new destination. This is done by specifying an alternate destination without using the corresponding RE option.

When RE is not used in Operand B, any owning Transaction becomes preempted at this Facility. Such Transactions cannot leave ASSEMBLE, GATHER, or MATCH Blocks or enter (nonzero) ADVANCE Blocks until all preemptions are cleared.

When a Transaction is displaced by using the C, F, or H

Operand, it is given a new Block destination and is dequeued from:

FEC

PENDING (waiting to preempt) CHAINS

DELAY (waiting to seize) CHAINS

USER CHAINS

RETRY CHAINS and not dequeued from:

CEC

INTERRUPT (preempted) CHAINS of other Facilities

GROUP CHAINS

When a Transaction is displaced from its present context anywhere in the model, by using an alternate destination, it is removed from any Blocking conditions but preemptions are not

cleared. Such a displaced Transaction is scheduled to enter the Block specified in Operand C of the FUNAVAIL Block.

When an owning Transaction RELEASEs or RETURNs a

Facility, the next owner is chosen from the head of the Pending

Chain, the Interrupt Chain, or the Delay Chain, in that order.

TheOwning Transaction

Operands B-D are used to control the owning Transaction.

If B is CO, the owning Transaction is not removed from ownership. It may, however, be given a new destination with the C Operand.

If B is RE, the owning Transaction is removed from contention for the Facility. This means that the Transaction may continue to circulate in the simulation without restrictions due to a preemption at this Facility (there may be outstanding preemptions at other Facilities, however). It also means that the owning Transaction must not attempt to RETURN or RELEASE the Facility. The C Operand must be used to redirect the course of such a Transaction.

If B is Null, the owning Transaction is preempted and placed on the Interrupt Chain of the Facility. If it was taken from the FEC and the C Operand is not used, it will be automatically restored to the FEC using the automatically saved residual time when the Facility again becomes available.

The C Operand may be used regardless of Operand B. It causes the owning Transaction to be displaced, and gives it a new destination Block. If you choose to return the Transaction to the FEC, having used the C Operand, you must explicitly route the Transaction to an ADVANCE Block. The D Operand causes the residual time to be saved in a Parameter of the owning Transaction. The residual time value is then available for explicit rescheduling when you use the Parameter value as Operand A of an ADVANCE Block.

Preempted Transactions

Operands E and F are provided to control the fates of Transactions currently preempted at this Facility.

If E is CO, preempted Transactions are not removed from contention for the Facility, and may own the Facility during any unavailable period. Preempted Transactions may be given a new destination with the F Operand.

If E is RE, preempted Transactions are removed from contention for the Facility. This means that the Transaction may continue to circulate in the simulation without restrictions due to a preemption at this Facility (there may be outstanding preemptions at other Facilities, however). It also means that preempted Transactions must not attempt to RETURN or

RELEASE the Facility. Optionally, the F Operand is available to

redirect the course of such a Transaction.

If E is Null, preempted Transactions are left on the Interrupt

Chain of the Facility, and cannot be granted ownership of the

Facility during the unavailable period.

The F Operand may be used regardless of Operand E. It causes preempted Transactions to be displaced, and gives them a new destination Block. Preempted Transactions may not exist on the FEC, so no residual time options are relevant.

If E is Null, the preemption is not cleared for displaced

Transactions.

Pending Interrupt Mode Transactions

Operands G and H are provided to control the fates of

Transactions on the Pending Chain (i.e. pending Interrupt Mode PREEMPTs) or the Delay Chain.

If G is CO, delayed Transactions are not removed from contention for the Facility, and may own the Facility during any unavailable period.

If G is RE, delayed Transactions are removed from contention for the Facility and allowed to circulate in the simulation. These Transactions must not attempt to RETURN or RELEASE the

Facility. The H Operand must be used to redirect the course of such Transactions.

If G is Null, delayed Transactions are left on the Delay Chain or the Pending Chain of the Facility, and cannot be granted ownership of the Facility during the unavailable period. The use of Operand H is invalid when G is Null.

Special Restrictions

If B is RE, C must be used.

If H is used, G must be RE.

If G is RE, H must be used.

Refuse Mode

A Transaction is never refused entry to a FUNAVAIL Block.

Related Block

FAVAIL - Place Facility in the available state.

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 Windows

Facilities Window - Online view of Facility Entity dynamics.

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.

GATE

A GATE Block alters Transaction flow based on the state of an entity.

GATE O A,B

Operands

O - Conditional operator. Condition required of entity to be

tested for successful test. Required. The operator must be

FNV, FV, I, LS, LR, M, NI, NM, NU, SE, SF, SNE, SNF, SNV,

SV, or U.

A - Entity name or number to be tested. The entity type is implied by the conditional operator. Required. The operand must be Name, PosInteger, ParenthesizedExpression, SNA, or

SNA*Parameter.

B - Destination Block number when test is unsuccessful. Optional. The operand must be Null, Name, PosInteger,

ParenthesizedExpression, SNA, SNA*Parameter.

Examples

GATE SNF MotorPool

In this example of a "Refuse Mode" GATE Block, the Active Transaction enters the GATE Block if the Storage Entity named

MotorPool is not full (i. e. if at least 1 unit of storage is available). If the Storage is full, the Active Transaction is blocked until 1 or more storage units become available.

GATE SNE MotorPool,CupboardIsBare

In this example of an "Alternate Exit Mode" GATE Block, the Active Transaction always enters the GATE Block. If the Storage Entity named MotorPool is not empty (i. e. if at least 1 unit of storage is in use) the Transaction proceeds to the NSB. If the Storage is empty (unsuccessful test), the Active

Transaction is scheduled to enter the Block at the location named CupboardIsBare.

Action

A GATE Block operates in either "Refuse Mode" or "Alternate Exit Mode".

If Operand B is not used, the GATE Block operates in Refuse

Mode. When a Transaction attempts to enter a Refuse Mode GATE Block, and the test is unsuccessful, the Transaction is blocked until the test is repeated and is successful. If the test is successful, the Active Transaction enters the GATE Block and then proceeds to the Next Sequential Block.

Blocked Transactions are placed on the Retry Chain of the tested entity. When the state of any of the entity changes, the blocked Transaction is reactivated, the test specified by the GATE block is retried, and if successful, the Transaction is permitted to enter the GATE Block. However, the integration of

User Variables does not cause blocked Transactions to be reactivated. You should use the thresholds in an INTEGRATE

Command if you need to be notified about the level of one or more continuous variables. This is discussed further in Chapter

1, in the Section entitled Continuous Variables.

If Operand B is used, the GATE Block operates in Alternate

Exit Mode. When a Transaction attempts to enter such a GATE

Block, and the test is unsuccessful, the Transaction enters the

GATE Block, is scheduled for the alternate destination Block specified by the B Operand, and is placed on the Current

Events Chain in front of its priority peers. If the test is successful, the Active Transaction enters the GATE Block and then proceeds to the Next Sequential Block.

Conditional Operators

The conditional operator is required. It may be FNV, FV, I, LS,

LR, M, NI, NM, NU, SE , SF, SNE, SNF, SNV, SV, or U. When the condition is true, the Transaction enters the GATE Block and proceeds to the Next Sequential Block. The conditions are defined as follows:

· FNV - The Facility specified implicitly by Operand A must be unavailable for a successful test.

FV - The Facility specified implicitly by Operand A must be available for a successful test.

I - The Facility specified implicitly by Operand A must be currently interrupted for a successful test.

LS - The Logicswitch entity specified implicitly by Operand A must be in the "set" state for a successful test.

LR - The Logicswitch entity specified implicitly by Operand A must be in the "reset" state for a successful test.

M - The Match Block specified implicitly by Operand A must have a related (to the Active

Transaction) Transaction waiting for a Match Condition.

NI - The Facility specified implicitly by Operand A must be not interrupted for a successful test.

NM - The Match Block specified implicitly by

Operand A must not have a related (to the Active Transaction) Transaction waiting for a Match Condition.

NU - The Facility specified implicitly by Operand

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