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

gpss_manual

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

Example

TABULATE Sales

When a Transaction enters this TABULATE Block, the Table

Entity named Sales is found. Sales must have been defined in a TABLE Command. Then the statistics associated with the table are updated with no weighting.

Action

When a Transaction enters a TABULATE Block, Operand A is evaluated and used to find a Table Entity. If there is no such entity an Error Stop occurs.

The Table Entity is then updated according to the operands in the TABLE Statement. If the B Operand is used, it is evaluated and used as a weighting factor. Otherwise the factor is taken to be 1.

A further discussion of the statistics gathered by table entities may be found in Section 4.10 and Chapter12.

Special Restrictions

A must be positive.

B, if specified, must be positive.

A must be the name or number of a predefined TABLE entity.

Refuse Mode

A Transaction is never refused entry to a TABULATE Block.

Related Command

A Table Entity must be defined in a TABLE Command before it can be updated by a TABULATE Block. The TABLE Command must exist in the model, or must be sent to the Simulation Object interactively, before a Transaction can enter the

TABULATE Block. Any attempt to do so before the Table Entity is defined, cases an Error Stop.

A Table Entity can be redefined by an interactive TABLE Command.

Related SNAs

TBEntnum - Non weighted average of entries in

Table Entity Entnum.

TCEntnum - Count of non weighted table entries in Table Entity Entnum.

TDEntnum - Standard deviation of non weighted table entries in Table Entity Entnum.

Related Window

Table Window - Online view of Table Entity dynamics.

TERMINATE

A TERMINATE Block removes the Active Transaction from the simulation and optionally reduces the Termination Count.

TERMINATE A

Operand

A - Termination Count decrement. Default is 0. Optional. The operand must be Null, Name, PosInteger,

ParenthesizedExpression, SNA, or SNA*Parameter.

Example

TERMINATE 1

In this example, when a Transaction enters the TERMINATE

Block it is removed from the simulation. Also, the Termination Count of the simulation, which is set by a START Command is decremented by 1.

Action

When a Transaction enters a TERMINATE Block, Operand A is evaluated, truncated, and used to decrement the Termination

Count of the simulation. If Operand A was not specified, the

Termination Count is not changed.

The Active Transaction is then removed from the simulation, and a new Active Transaction is chosen.

The Termination Count of the simulation is set by a prior

START Command. When the termination count reaches 0, the simulation ends, and unless suppressed by Operand B of the START Command, the optional standard report is written.

Special Restriction

A, if specified, must be positive.

Refuse Mode

A Transaction is never refused entry to a TERMINATE Block.

Related SNA

TG1 - Termination Count of the simulation. This value is initialized by a START Command and indicates completion of the simulation when it becomes less than or equal to 0.

TEST

A TEST Block compares values, normally SNAs, and controls the destination of the Active Transaction based on the result of the comparison.

TEST O A,B,C

Operands

O - Relational operator. Relationship of Operand A to Operand

B for a successful test. Required. The operator must be E, G,

GE, L, LE, or NE.

A - Test value. Required. The operand must be Name,

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

B - Reference value. Required. The operand must be Name,

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

C - Destination Block number. Optional. The operand must be

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

Action

A TEST Block operates in either "Refuse Mode" or "Alternate

Exit Mode". In either case, operands A and B are evaluated numerically, and compared.

If Operand C is not used, the TEST Block operates in Refuse

Mode. When a Transaction attempts to enter a Refuse Mode TEST Block, and the test is unsuccessful, the Transaction is blocked, i.e. not allowed to enter the TEST Block, until the test is repeated and is successful. When the test is successful, the Active Transaction enters the TEST Block and then proceeds to the Next Sequential Block.

Blocked Transactions are placed on the Retry Chains of all entities involved in the comparison. When the state of any of these entities changes, the blocked Transaction is reactivated, the test specified by the TEST block is retried, and if successful, the Transaction is permitted to enter the TEST

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 C is used, the TEST Block operates in Alternate

Exit Mode. When a Transaction attempts to enter such a TEST Block, and the test is unsuccessful, the Transaction enters the

TEST Block, is scheduled for the alternate destination Block specified by the C 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 TEST Block and then proceeds to the Next Sequential Block.

Example

TEST G C1,70000

In this example of a "Refuse Mode" TEST Block, the Active Transaction enters the TEST Block if the relative system clock

value is greater than 70000. Otherwise, the Transaction is blocked until the test is true.

TEST G Q$Teller1_Line,Q$Teller2_Line,Teller1

In this example of an "Alternate Exit Mode" TEST Block, the

Active Transaction always enters the TEST Block. If the content of the queue entity named Teller1_Line is greater than the content of the queue entity named Teller2_Line the

Transaction proceeds to the NSB. Otherwise, the Active Transaction is scheduled to enter the Block at the location named TELLER1.

Relational Operator

The relational operator is required. It may be E, G, GE, L, LE, or NE.

The successful tests are defined as follows:

E - The value of Operand A must be equal to the value of Operand B.

G - The value of Operand A must be greater than the value of Operand B.

GE - The value of Operand A must be greater than or equal to the value of Operand B.

L - The value of Operand A must be less than the value of Operand B.

LE - The value of Operand A must be less than or equal to the value of Operand B.

NE - The value of Operand A must be unequal to the value of Operand B.

Special Restrictions

C must be the location of a Block in the simulation.

TEST Blocks are extremely powerful, however, unsuccessful testing can cause large amounts of computer time to be used. You may need to arrange your simulation to reduce the frequency of unsuccessful tests. This can be done by placing Transactions with no chance of a successful test on a User Chain using LINK and UNLINK Blocks.

Refuse Mode

A TEST Block operating in Refuse Mode will refuse entry to a

Transaction when the test fails. The refused Transaction will be blocked until the test is successful.

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 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.

TRACE

A TRACE Block turns on the Trace Indicator of the Active Transaction.

TRACE

Operands

None.

Example

TRACE

In this example, the Trace Indicator of the Active Transaction will be set and stay on until an UNTRACE Block is entered.

Action

When a Transaction enters a TRACE Block, its Trace Indicator is turned on. This causes a trace message to be sent to all

Journal Windows every time the Transaction enters a new

Block.

Refuse Mode

A Transaction is never refused entry to a TRACE Block.

Related Windows

· Journal Window - Record session events.

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.

TRANSFER

A TRANSFER Block causes the Active Transaction to jump to a new Block location.

TRANSFER A,B,C,D Operands

A - Transfer Block mode. Described below. Optional. The operand must be BOTH, ALL, PICK, FN, P, SBR, SIM, fraction,

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

B - Block number or location. Parameter name or number when in P Mode. Optional. The operand must be Null, Name,

PosInteger, ParenthesizedExpression, SNA, or

SNA*Parameter.

C - Block number or location. Increment value in FN or P

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

ParenthesizedExpression, SNA, or SNA*Parameter.

D - Block number increment for ALL Mode. Default is 1. Optional. The operand must be Null, Name, PosInteger,

ParenthesizedExpression, SNA, or SNA*Parameter.

Action

A TRANSFER Block may operate in one of 9 "modes", each with different properties. When a Transaction enters a

TRANSFER Block, Operand A is used to determine the mode of operation of the Block. The meaning of operands B and C depend on the mode. When you do not specify an operand which corresponds to a Block location, the next sequential

Block after the TRANSFER Block is used.

Unconditional Mode

When the A Operand is omitted, the TRANSFER Block operates in "Unconditional Mode". In Unconditional Mode, the Active Transaction always jumps to the location specified by the B Operand.

TRANSFER ,New_Place

When a Transaction enters this TRANSFER Block, it is immediately scheduled for the Block at location New_Place.

Fractional Mode

When the A Operand is not a keyword, the TRANSFER Block operates in "Fractional Mode". In Fractional Mode, the Active Transaction jumps to the location specified by the C Operand with a probability given by Operand A. If Operand A is a nonnegative integer, it is interpreted as parts-per-thousand and converted to a fractional probability. The alternate destination is specified in Operand B, or the NSB if Operand B is omitted.

TRANSFER .75,,New_Place

When a Transaction enters this TRANSFER Block, it is proceeds to the location named NEW_PLACE with a probability of .75. The remaining times it proceeds to the Next Sequential Block. 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 Edit / Settings

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

number stream entity number in the entry box marked

"TRANSFER". The installation default is to use random number stream number 1.

Both Mode

When the A Operand is BOTH, the TRANSFER Block operates in "Both Mode". In Both Mode, the Block specified by Operand

B is tested. If it refuses to admit the Active Transaction, the

Block specified in Operand C is tested. The first Block to admit the Transaction will be the new destination. If neither Block admits the Transaction, it stays in the TRANSFER Block until it can enter one or the other.

TRANSFER BOTH,First_Place,Second_Place

When a Transaction enters this TRANSFER Block, the Block at location First_Place is tested. If the Transaction can enter, it does so. If not, the Block at location Second_Place is tested. The Transaction enters if it can. Otherwise, it remains in the TRANSFER Block until it can leave.

All Mode

When the A Operand is ALL, the TRANSFER Block operates in "All Mode". In "All" Mode, the Block specified by Operand B is tested. If this Block refuses to admit the Active Transaction,

Blocks are tested in succession until the Block specified by Operand C is passed, unless one of the Blocks tested admits the Transaction prior to reaching the Block specified in Operand C. The location of each succeeding test Block is calculated by adding Operand D to the previous test Block location. If Operand D is not used, every Block between those specified by B and C, inclusive, are tested. If Operand C is not used, only one Block is tested. No Block with a location higher than Operand C is tested. The first Block to admit the

Transaction will be the new destination. If no Block admits the Transaction, it stays in the TRANSFER Block until it can enter one.

TRANSFER ALL,First_Place,Last_Place,2

When a Transaction enters this TRANSFER Block, the Block at location First_Place is tested. If the Transaction can enter, it does so. If not, the Blocks at every second higher location are tested. The Transaction enters if it can. If all tested Blocks refuse, the testing ends with the Block at location Last_Place, or with the Block just before it, depending on the separation of

First_Place and Last_Place. If no Block accepts, the

Transaction remains in the TRANSFER Block until it can leave.

Pick Mode

When the A Operand is PICK, the TRANSFER Block operates in "Pick" Mode. In Pick Mode, a destination is chosen randomly.

TRANSFER PICK,First_Place,Last_Place

When a Transaction enters this TRANSFER Block, a location is chosen randomly which is numerically between First_Place and

Last_Place, inclusively. The chosen location is the next destination for the Active Transaction. 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 Edit / Settings

Then select the Random page. Then fill in the desired

random number stream entity number in the entry box marked

"TRANSFER". The installation default is to use random number stream number 1.

Function Mode

When the A Operand is FN, the TRANSFER Block operates in "Function Mode". In Function Mode, the destination is chosen by evaluating a function entity, specified in B, and adding an optional increment specified in C.

TRANSFER FN,Func1,5

When a Transaction enters this TRANSFER Block, the function entity named FUNC1 is evaluated, and added to 5, to determine the location of the destination.

Parameter Mode

When the A Operand is P, the TRANSFER Block operates in

"Parameter Mode". In Parameter Mode, the Active Transaction jumps to a location calculated from the sum of a Parameter value and Operand C. If C is not specified, the Parameter value is the location of the new destination.

TRANSFER P,Placemarker,1

When a Transaction enters this TRANSFER Block, it is immediately scheduled for the Block immediately after the location specified in the Transaction Parameter named

Placemarker.

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