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

gpss_manual

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

ADOPT

ADOPT Blocks are used to change the Assembly Set of the Active Transaction.

ADOPT A

Operand

A - Assembly Set. Required. The operand must be Name,

PosInteger, ParenthesizedExpression, SNA, or SNA*Parameter.

Example

ADOPT 2000

The numerical Assembly Set value of the Active Transaction is given the value 2000. In effect, the Active Transaction becomes a member of Assembly Set 2000.

Action

When a Transaction enters an ADOPT Block, Operand A is evaluated numerically, and truncated. If the result is less than or equal to zero, an Error Stop occurs. Otherwise, the result is assigned to the Assembly Set value of the Active Transaction.

Every Transaction is assigned to an Assembly Set when it is created. For Transactions created in GENERATE Blocks, the initial assignment uses the same number for the Assembly Set as was used for the Transaction Number. For Transactions created in SPLIT Blocks, the offspring Transactions are placed in the same Assembly Set as their parent Transaction.

Assembly Sets are used to combine related Transactions in ASSEMBLE and GATHER Blocks. The ADOPT Block provides for easy control of Assembly Set assignments.

Special Restriction

A must be positive.

Refuse Mode

A Transaction is never refused entry to an ADOPT Block.

Related Blocks

ASSEMBLE - Wait for and destroy Assembly

Set members.

GATHER - Wait for Assembly Set members.

MATCH - Wait for Assembly Set member.

SPLIT - Create Transaction(s) in the same

Assembly Set.

Related SNAs

A1 - Assembly Set. Return the Assembly Set of the Active Transaction.

MBEntnum - Match at Block. MBEntnum returns a 1 if there is a Transaction at Block Entnum which is in the same Assembly Set as the Active Transaction. MBEntnum returns a 0 otherwise.

Related Window

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

ADVANCE

An ADVANCE Block delays the progress of a Transaction for a specified amount of simulated time.

ADVANCE A,B

Operands

A - The mean time increment. Required. The operand must be

Name, Number, String, ParenthesizedExpression, SNA or

SNA*Parameter.

B - The time half-range or, if a function, the function modifier. Optional. The operand must be Null, Name, Number, String,

ParenthesizedExpression, SNA, or SNA*Parameter.

Example

ADVANCE 101.6,50.3

This example creates a Block which chooses a random number between 51.3 and 151.9, inclusively (i.e. 101.6 plus or minus

50.3), and delays the entering Transaction that amount of simulated time.

Action

An ADVANCE Block calculates a time increment and places the entering Transaction on the Future Events Chain (FEC) for that amount of simulated time.

The time increment can be calculated in several ways. If only the A Operand is specified, it is evaluated and used as the time increment. If the A and B operands are present, and B does not specify a function, both A and B are evaluated numerically and a random number between A-B and A+B, inclusively, is used as the time increment. You can select which random number generator number is to be used as the source of the random number. This is set in the "Random" page of the Model

Settings Notebook.

CHOOSE View / Settings / Model

then select the Random page. Then fill in the desired random

number stream entity number in the entry box marked

"ADVANCE". The installation default is to use Random Number Stream number 1.

If B is an FN class SNA, called a Function Modifier, the evaluating B is multiplied by the result of evaluating the A Operand; the product is used as the time increment.

If zero is calculated as the time increment (ADVANCE 0), the entering Transaction is placed on the Current Events Chain in front of priority peers. Such a Block then behaves as a null

operation. A further discussion of the Current Events Chain can be found in Chapter 9.

Special Restriction

If a negative number is calculated as the time increment, an Error Stop occurs.

Refuse Mode

Normally, Transactions are not refused entry to an ADVANCE

Block. However, since preempted Transactions are not permitted to exist on the Future Events Chain, a preempted

Transaction will not be permitted to enter an ADVANCE Block if the time increment is positive (nonzero).

When a Transaction is refused entry, its Delay Indicator is set and remains so until the Transaction enters a "Simultaneous" Mode TRANSFER Block. To coordinate the state of multiple entities, it is better to use a TEST Block and BOOLEAN

VARIABLE instead of a TRANSFER SIM Block.

Related Windows

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.

ALTER

An ALTER Block changes the priority or a Parameter of selected members of a Transaction Group.

ALTER O A,B,C,D,E,F,G Operands

O - Conditional operator. Relationship of E to F for the

alteration to occur. These choices are explained below.

Optional. The operator must be Null, E, G, GE, L, LE, MAX,

MIN, or NE.

A - Transaction Group. Group whose members will be tested for alteration. Required. The operand must be Name,

PosInteger, ParenthesizedExpression, SNA, or

SNA*Parameter.

B - Limit. The maximum number of Transactions to be altered.

The default is ALL. Optional. The operand must be Null, Name,

PosInteger, ParenthesizedExpression, SNA, or

SNA*Parameter.

C - Altered attribute. The member Transaction Parameter to be

altered, or PR to alter the member Transaction priority. The operand must be PR, Name, PosInteger,

ParenthesizedExpression, SNA, or SNA*Parameter.

D - Replacement value. The value which will replace attribute C. Required. The operand must be Name, Number, String,

ParenthesizedExpression, SNA, or SNA*Parameter.

E - Test value. PR or Parameter number. The member

Transaction Parameter which determines whether each Group member Transaction should be altered, or PR to use the Transaction priority for the determination. It is evaluated with respect to the Transaction Group member. Optional. The operand must be PR, Null, Name, PosInteger, ParenthesizedExpression, SNA, or SNA*Parameter.

F - Reference value. The value against which the E Operand is

compared. It is evaluated with respect to the Active Transaction. Optional. The operand must be Null, Name,

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

G - Alternate Block number. The alternate destination for the Active Transaction. Optional. The operand must be Null, Name,

PosInteger, ParenthesizedExpression, SNA, or SNA*Parameter.

Examples

ALTER Inventory,ALL,Price,49.95

In this simple example, all Transactions in the Transaction

Group named Inventory have their Parameter named Price set equal to 49.95.

ALTER NE Bin7,10,Price,49.95,PartNum,99.95,Out

In this example, when a Transaction enters the ALTER Block, Transaction Group named Bin7 is scanned for Transactions which do not have a value of 99.95 in their Parameter named

PartNum. The first 10 Transactions which meet the test have the value of their Parameter named Price set to 49.95. If 10

Transactions cannot be found which pass the test, the entering

Transaction attempts to enter the Block labeled Out.

Otherwise, it proceeds to the Next Sequential Block.

Action

An ALTER Block selects Transactions from a Transaction

Group and alters one of the attributes of each of these

Transactions. When a Transaction Group member is altered, its Transaction attribute specified by the C Operand is given the value specified by the D Operand. Altered Transactions are not displaced from their context. However, the Transaction entering the ALTER Block may be redirected according to the G Operand.

If you do not use a conditional operator, or operands E or F, all Transactions up to the limit (Operand B) are altered. In this case, no priority or Parameter test is made to determine whether or not to alter the attribute of the member Transaction.

If you use operands E, F, or a conditional operator, each Group member must pass a test before it is altered. Operand E 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. All Transactions which are tested and have the maximum or minimum attribute are altered. In this case, you must not use Operand F.

You may use a conditional operator to specify the relationship between the Transaction attribute (Operand E) and the reference value (Operand F) which will initiate the alteration of the Transaction. The default for the conditional operator is E for equality. If you use no conditional operator, but you use operand E and Operand F, the values must be equal for the member Transaction attribute to be altered.

You may compare the Group member attribute to Operand F, with or without a conditional operator. In this case, the conditional operator must not be MIN or MAX. Operand E always refers to the Group member under test. However, if any other operand is a Transaction related SNA, it is evaluated with respect to the entering Transaction.

The B Operand cuts off the Group scan when it equals the number of Transactions that have been altered. The default is ALL. If there is no attribute test, that is, if E is not specified,

Transactions are altered until the alteration count equals B or until the entire Group has been tested.

The G Operand indicates an alternate destination Block to be taken by the entering Transaction when a special condition

occurs. The G Operand is used for the next Block under the following conditions:

No Transaction is altered.

The count of altered Transactions specified by

B cannot be reached.

If the G Operand is not used, the entering Transaction always goes 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 altered. The conditions are defined as follows:

E - The member Transaction attribute specified by Operand E must be equal to the reference value specified by Operand F for the member

Transaction to be altered.

G - The member Transaction attribute specified by Operand E must be greater than the reference value specified by Operand F for the member Transaction to be altered.

GE - The member Transaction attribute specified by Operand E must be greater than or equal to the reference value specified by Operand F for the member Transaction to be altered.

L - The member Transaction attribute specified by Operand E must be less than the reference value specified by Operand F for the member Transaction to be altered.

LE - The member Transaction attribute specified by Operand E must be less than or equal to the reference value specified by

Operand F for the member Transaction to be altered.

MAX - The member Transaction attribute specified by Operand E must be equal to the largest such attribute of all Transactions in the Group for the member Transaction to be altered.

MIN - The member Transaction attribute specified by Operand E must be equal to the smallest such attribute of all Transactions in the Group for the member Transaction to be altered.

NE - The member Transaction attribute

specified by Operand E must be unequal to the reference value specified by Operand F for the member Transaction to be altered.

If no conditional operator is used, E is assumed.

Special Restrictions

If Operand E is used, then you must use

Operand F or else you must use the conditional operator MIN or MAX.

If Operand F is used, you must use Operand E, and not MIN or MAX.

If MIN or MAX is used for the conditional operator, Operand E must be used and Operand

F must not be used.

Refuse Mode

A Transaction is never refused entry to an ALTER Block.

Related Blocks

Transactions are added to Transaction Groups, and numbers are added to Numeric Groups by JOIN Blocks. Transactions in Groups can be referenced by ALTER, EXAMINE, REMOVE, and SCAN Blocks. Numbers in Numeric Groups can be referenced by EXAMINE and REMOVE 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.

ASSEMBLE

Wait for and destroy related

Transactions.

ASSEMBLE A

Operand

A - Transaction count. Required. The operand must be Name,

PosInteger, ParenthesizedExpression, SNA, or

SNA*Parameter.

Example

ASSEMBLE 2

This is the simplest way to use the ASSEMBLE Block. The first Transaction of an Assembly Set (see Section 9.3) is caused to wait when it enters an ASSEMBLE Block. When another Transaction in the same Assembly Set enters the Block, it is destroyed and the waiting Transaction is allowed to continue.

Action

When a Transaction enters an ASSEMBLE Block, the Match Chain of the Block is searched for a waiting Transaction of the same Assembly Set. If there are no other members of the same Assembly Set present, the A Operand is evaluated, truncated, decremented by one, and saved in a storage location in the Transaction. If this number is zero, the Transaction immediately attempts to enter the Next Sequential

Block. Otherwise the Transaction is placed on a queue attached to the ASSEMBLE Block called the Match Chain to await the arrival of other members of its Assembly Set.

When a Transaction enters an ASSEMBLE Block, if a waiting

Transaction is found, the entering Transaction is destroyed and the Transaction count that was saved in the chained

Transaction is reduced by one. When this count becomes 0, the waiting Transaction is removed from the Match Chain. If this Transaction has not been preempted at any Facility, it attempts to enter the Next Sequential Block. When it does so, it is scheduled behind active Transactions of the same priority.

Preempted Transactions which complete an assembly at an ASSEMBLE Block are not permitted to leave the Block until all

preemptions have been cleared. More discussion of the preemption mechanism can be found in Section 9.4.

Preempted Transactions which have been removed from the

Match Chain do not participate in later assemblies even though they remain in the ASSEMBLE Block.

ASSEMBLE Blocks differ from GATHER Blocks in that succeeding Transactions are destroyed at an ASSEMBLE.

Special Restriction

Transactions which are currently preempted are not permitted to leave ASSEMBLE Blocks.

Refuse Mode

A Transaction is never refused entry to an ASSEMBLE Block.

Related Blocks

ADOPT - Set the Assembly Set of the Active Transaction.

GATHER - Wait for members of an Assembly Set.

MATCH - Wait for Assembly Set member.

SPLIT - Create Transactions in the same Assembly Set.

Related SNAs

A1 - Assembly Set. Return the Assembly Set of the Active Transaction.

MBEntnum - Match at Block. MBEntnum returns a 1 if there is a Transaction at Block Entnum which is in the same Assembly Set as the Active Transaction. MBEntnum returns a 0 otherwise.

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.

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