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

gpss_manual

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

SNA*Parameter.

Examples

SELECT SNF Not_Full,Bin1,Bin3

In this example, the entity number of the first Storage Entity that has room whose entity numbers fall between Bin1 and Bin3 will be stored in the Transaction Parameter named

Not_Full. If the Parameter does not exist, it will be created. It is always wise to test prior to entry into a SELECT Block that a successful selection is possible. If it is not possible, a 0 would be put in the Parameter and in this case, entry into an ENTER

Block would cause an Error Stop since no entity can have an entity number of 0. You can also use an alternate exit if no entity is found to meet the desired criteria.

If the range of entities to be searched have been defined with alphanumeric names as above, you must first use EQU Statements to assign contiguous numbers to the range of names. The EQU Statements must occur prior to the original entity definitions.

10 Bin1 EQU 1

20 Bin2 EQU 2

30 Bin3 EQU 3

40 Bin1 STORAGE 11

50 Bin2 STORAGE 1000

60 Bin3 STORAGE 150

.

.

100 SELECT SNF,3,Bin1,Bin3,,,No_Room

Here, we have taken the example above and given an alternate destination to Transactions that find all Storage Entities to be full. If you do not test first for a successful selection using a TEST Block and a BOOLEAN VARIABLE, you should have an alternate destination should the selection be unsuccessful.

SELECT E Empty1,Queue1,Queue9,0,Q

In this example, the SELECT Block operates in Conditional

Mode. Each Queue Entity with entity number between those of

Queue1 and Queue9, inclusively, is tested. The first Queue

Entity whose current content is 0 is selected. EMPTY1 is the name of the Parameter of the entering Transaction to receive the entity number of the first "empty" Queue Entity in the specified range.

Action

When the SELECT Block is entered, the entity specified by

Operand B is tested. If the entity does not exist and does not require a separate Command for its definition, a new entity is created. Thereafter, each entity in the range indicated by operands B and C is tested. An SNA is built automatically for each entity. The SNA class used to build the SNA is taken from Operand E or is specified by the logical operator.

A SELECT Block operates in either Logical Mode or in

Conditional Mode, depending on whether a logical operator or a conditional operator is used.

When a logical operator is used (defined below), operands A, B, and C are used. The condition specified by the logical operator is tested for the entities whose numbers fall between

B and C. The entity number of the first entity found in that condition is placed in the Parameter of the entering Transaction whose number is given by Operand A. The entity type is implied by the logical operator. If no entity is found, 0 is placed in the Parameter of the Active Transaction. If the Parameter does not exist, it is created.

When a conditional operator is used, operands A, B, C, E, and usually D are used. Operands A, B, C, are used to specify the target Parameter, and the range of entity numbers, as above. But now the conditional operator specifies the relationship between operands D and E that must hold for the entity to be selected. Both are evaluated numerically.

In Conditional Mode, the SNA class is combined with the entity specifier in order to build an SNA. The entity type implied by each SNA class is given in Section 3.4. The complete SNA is built from this class and the number of the entity being tested. Each such SNA is evaluated for each entity and compared to the reference value in Operand D. Operand D is evaluated with respect to the entering Transaction and is the reference value for comparison to Operand E, which specifies the class of SNA

(and therefore the entity type) to be evaluated. The conditional operator specifies the relation that Operand E, evaluated at each entity, must bear to Operand D, evaluated on behalf of the entering Transaction, in order for the entity to be selected.

If MIN or MAX is used as the conditional operator, Operand D is ignored.

In either mode, the F Operand may be used to direct the

entering Transaction to a new Block in the event that no entity can be selected. If F is not used, the entering Transaction will always proceed to the next sequential Block. If F is used, and no entity is selected, the Active Transaction proceeds to the

Block specified by F, with its Parameter, specified by Operand

A, unchanged.

Logical Operators

Either a conditional operator or a logical operator is required.

The logical operator may be FNV, FV, I, LS, LR, NI, NU, SE,

SF, SNE, SNF, SNV, SV, or U. When the logical operator is true, the entity being tested is selected. The conditions are defined as follows:

FNV - The Facility Entity must be unavailable in order to be selected.

FV - The Facility Entity must be available in order to be selected.

I - The Facility Entity must be currently interrupted (preempted) in order to be selected.

LS - The Logicswitch Entity must be set in order to be selected.

LR - The Logicswitch Entity must be reset in order to be selected.

NI - The Facility Entity must NOT be currently interrupted (preempted) in order to be selected.

NU - The Facility Entity must not be in use in order to be selected.

SE - The Storage Entity must be empty in order to be selected.

SF - The Storage Entity must be full in order to be selected.

SNE - The Storage Entity must NOT be empty in order to be selected.

SNF - The Storage Entity must NOT be full in order to be selected.

SNV - The Storage Entity must NOT be available in order to be selected.

SV - The Storage Entity must be available in order to be selected.

U - The Facility Entity must be in use in order to be selected.

Conditional Operators

Either a conditional operator or a logical operator is required.

The conditional operator may be E, G, GE, L, LE, MAX, MIN, or

NE. The conditions are defined as follows:

E - The value of the automatic SNA must be equal to the reference value specified by

Operand D for the entity to be selected.

G - The value of the automatic SNA must be greater than the reference value specified by Operand D for the entity to be selected.

GE - The value of the automatic SNA must be greater than or equal to the reference value specified by Operand D for the entity to be selected.

L - The value of the automatic SNA must be less than the reference value specified by Operand D for the entity to be selected.

LE - The value of the automatic SNA must be less than or equal to the reference value specified by Operand D for the entity to be selected.

MAX - The value of the automatic SNA must be equal to the greatest of all such SNAs, for the entity to be selected.

MIN - The value of the automatic SNA must be equal to the least of all such SNAs, for the entity to be selected.

NE - The value of the automatic SNA must be unequal to the reference value specified by Operand E for the entity to be selected.

Special Restrictions

Either a conditional operator or a logical operator is required.

Evaluated entity numbers must be positive integers.

D and E are required if O is a conditional operator. Other than MIN or MAX.

When evaluated, C must be greater than or equal to B.

Refuse Mode

A Transaction is never refused entry to a SELECT Block.

Related Windows

Facilities Window - Online view of Facility Entity dynamics.

Logicswitches Window - Online view of

Logicswitch Entity dynamics.

Storages Window - Online view of Storage

Entity dynamics.

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

SPLIT

A SPLIT Block creates Transactions in the same Assembly Set as the Active Transaction.

SPLIT A,B,C

Operands

A - Count. Number of related Transactions to be created. Required. The operand must be Name, PosInteger, ParenthesizedExpression, SNA, or SNA*Parameter.

B - Block number. Destination for new Transactions. Optional.

The operand must be Null, Name, PosInteger,

ParenthesizedExpression, SNA, or SNA*Parameter.

C - Parameter number. Parameter to receive serial number. Optional. The operand must be Null, Name, PosInteger, ParenthesizedExpression, SNA, or SNA*Parameter.

Examples

SPLIT 1

This is the simplest way to use the SPLIT Block. A new copy of the parent Transaction is created which will follow the parent

Transaction to the next Block. The new Transaction has the same priority, Parameter values, and Mark Time as the parent.

SPLIT 3,P20,20

In this example, each time the SPLIT Block is entered, 3 new

Transactions are created. Each Transaction has the same priority, Mark Time, and Parameter values as the parent

Transaction, with the exception of Parameter number 20.

Each offspring Transaction will have a serial number in its

Parameter number 20 based on the value in Parameter number 20 of the parent Transaction. The parent’s Parameter value 20 is first incremented by 1 (in case it is 0), and then the serial number of each offspring is calculated following that value sequentially.

The destination Block found in Operand B is evaluated with respect to each newly created Transaction. If Parameter 20 of the parent Transaction contains a Block number, say, n, then the first offspring will go to Block n+2, the second to n+3 and the third to n+4.

The parent Transaction will proceed to the Next Sequential Block following the SPLIT Block.

The above example is unique because Parameter 20 is used in both the B and C operands. Therefore, the serial number is used to determine the destination Block location.

The B and C operands can be used for separate purposes, B containing a single destination of the offspring Transactions and C, a serial number which might be used to direct the individual Transactions at some location further on in the simulation.

SPLIT 3,Pro,17

In this example, each time the split Block is entered, 3 new Transactions are created. The parent Transaction goes to the Next Sequential Block, the offspring to a Block labeled Pro.

Parameter 17 will receive the serialization. If the parent Transaction’s Parameter is not predefined, it will be created and initialized to 0. In this example, the parent Transaction with a value of 0 in the Parameter 17, (the Parameter to be used for serialization) will, after passing through the SPLIT Block, have a 1 in Parameter 17 and the offspring will have 2, 3, and 4 in

Parameter 17.

Action

A SPLIT Block creates new Transactions which share the attributes of their parent. Each offspring Transaction has the same priority and Mark Time of the parent, and is in the same

Assembly Set. If the Trace Indicator is set in the parent

Transaction, it is turned on in the offspring Transaction.

The new Transactions may be sent to an alternate destination, by using a Block number for Operand B. The new Block number is evaluated for each new Transaction.

The optional C Operand specifies the Parameter number of the newly created Transactions to receive a serial number. The numbering starts at the value of the corresponding Parameter in the parent Transaction, plus 1. For example, if 3 copies are to be created with a serial number in Parameter 120, and the entering Transaction has 15 in its Parameter 120, then the new

Transactions will have 16, 17, and 18, respectively, in their

Parameters numbered 120. If the parent Transaction has no such Parameter, it is created and the numbering starts at 1.

By using both B and C operands it is possible to send each new Transaction to a different destination as shown in the second example above.

The parent Transaction and all the offspring Transactions all belong to the same set of Transactions called an Assembly Set. All Transactions belong to exactly one Assembly Set, which can be changed by entry into an ADOPT Block.

Members of the same Assembly Set are said to be "related". The relationships of Transactions may be tested and used in

ASSEMBLE, GATHER, MATCH, and GATE Blocks for synchronization and other purposes.

Special Restriction

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

Refuse Mode

A Transaction is never refused entry to a SPLIT Block.

Related Blocks

ADOPT - Set the Assembly Set of the Active Transaction.

ASSEMBLE - Wait for and destroy Assembly

Set members.

GATHER - Wait for Assembly Set members.

MATCH - Wait for Assembly Set member.

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.

SUNAVAIL

A SUNAVAIL Block ensures that a Storage Entity is in the unavailable state.

SUNAVAIL A

Operand

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

Name, PosInteger, ParenthesizedExpression, SNA,

SNA*Parameter.

Example

SUNAVAIL MotorPool

In this simple example, the Storage Entity named MotorPool is made unavailable when a Transaction enters this Block.

Action

An SUNAVAIL Block ensures that a Storage Entity is unavailable. This means that all Transactions requesting storage will be placed on the Delay Chain of the Storage Entity.

No Transaction is permitted to enter any ENTER Block if the

Storage Entity is in the unavailable state.

If the Storage Entity is already in the unavailable state, the SUNAVAIL Block has no effect.

Special Restriction

Operand A must be the name or number of a predefined Storage Entity.

Refuse Mode

A Transaction is never refused entry to a SUNAVAIL Block.

Related Command

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

STORAGE Command must exist in the model, or must be sent to the Simulation Object interactively, before a Transaction can enter the SUNAVAIL 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.

TABULATE

A TABULATE Block triggers the collection of a data item in a Table Entity.

TABULATE A,B

Operands

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

SNA*Parameter.

B - Weighting factor. Optional. The operand must be Null, Name, Number, ParenthesizedExpression, SNA, or

SNA*Parameter.

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