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

gpss_manual

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

MARK

A MARK Block places an absolute clock time stamp into the Active Transaction or into its Parameter.

MARK A

Operand

A - Parameter number. Parameter to receive value of system clock. Optional. The operand must be Null, Name, PosInteger,

ParenthesizedExpression, SNA, or SNA*Parameter.

Examples

MARK Beginning

In this example, when a Transaction enters the MARK Block, its Transaction named Beginning is given a value equal to the value of the absolute system clock, AC1.

MARK

In this example, when a Transaction enters the MARK Block, its Mark Time is set equal to the value of the absolute system clock.

Action

When a Transaction enters a MARK Block and Operand A was not specified, its Mark Time is set equal to the absolute system clock.

If Operand A was specified, it is evaluated numerically, and truncated. The Parameter of the Active Transaction with that number is found and given a value equal to the value of the absolute system clock. If the Parameter does not exist, it is created.

The Active Transaction then proceeds to the Next Sequential Block (NSB).

The time stamps set up by a MARK Block can be retrieved by

M1 and MP class SNAs. M1 returns the "transit time", which is the absolute system clock minus the Transaction’s Mark Time.

SNAs in the class MP return a value equal to the absolute system clock minus the value of a Transaction Parameter.

Special Restriction

A, if specified, must be positive.

Related SNAs

MPEntnum - Transit time, Parameter. Current absolute system clock value minus value in Parameter Entnum.

M1 - Transit time. M1 returns the absolute clock minus the "mark" time of the Transaction.

Refuse Mode

A Transaction is never refused entry to a MARK 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.

MATCH

A pair of MATCH Blocks cause Transactions to wait for each other.

MATCH A

Operand

A - Block name or number. Conjugate MATCH Block to be

tested for a matching (same Assembly Set) Transaction. Required. The operand must be Name, PosInteger,

ParenthesizedExpression, SNA, or SNA*Parameter.

Example

A_Is_Done MATCH B_Is_Done

B_Is_Done MATCH A_Is_Done

This example shows two conjugate MATCH Blocks. They would normally be placed apart in the simulation, and one would eventually receive a Transaction in the same Assembly

Set. If each MATCH Block were placed after a set of Blocks representing some process, the pair of related Transactions would proceed past the MATCH Blocks only when both

Transactions had completed their respective processes.

Action

When a Transaction enters a MATCH Block, Operand A is evaluated numerically, truncated, and the conjugate MATCH Block is found. If there is no such Block, an Error Stop occurs.

If the conjugate MATCH Block contains a Transaction (on its

Match Chain) of the same Assembly Set as the Active Transaction, the related Transaction is removed from the Match Chain. If it is not currently preempted at any Facility Entity, it is placed on the Current Events Chain behind its priority peers. Similarly, if the Active Transaction is not currently preempted at any Facility it is placed on the CEC, but ahead of its peers.

If either matching Transaction is currently preempted at a Facility, it is not permitted to leave its MATCH Block until all preemptions have been cleared on its behalf.

If, when the Active Transaction enters the MATCH Block, no matching Transaction is found, it comes to rest on the Match Chain of the MATCH Block.

Special Restrictions

Operand A must be the location of a MATCH Block in the simulation.

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

Refuse Mode

A Transaction is never refused entry to a MATCH 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.

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.

MSAVEVALUE

An MSAVEVALUE Block updates an element of a Matrix Entity.

MSAVEVALUE A,B,C,D Operands

A - Matrix Entity name or number, with optional + or -.

Required. the operand must be Name, PosInteger,

ParenthesizedExpression, SNA, or SNA*Parameter, followed by +, -, or Null.

B - Row number. Required. The operand must be Name,

PosInteger, ParenthesizedExpression, SNA or

SNA*Parameter.

C - Column number. Required. The operand must be Name,

PosInteger, ParenthesizedExpression, SNA or

SNA*Parameter.

D - Value to be stored, added, or subtracted. Required. The operand must be Name, Number, String,

ParenthesizedExpression, SNA, or SNA*Parameter.

Examples

MSAVEVALUE Sales+,Part23,Cust77,6.234

When a Transaction enters the MSAVEVALUE Block in this example, the element, of the Matrix Entity named Sales, with row equal to the value of Part23 and the column equal to the value of Cust77 is increased by 6.234. Normally, the row and column names would have appeared earlier in EQU

Statements.

MSAVEVALUE Parts,Part23,Description,"Zippo lighter"

In this example, a string is assigned to a Matrix element. The Matrix Entity must be defined elsewhere in the Model, or interactively, by a MATRIX Command that defines the Parts Matrix Entity.

Action

When a Transaction enters a MSAVEVALUE Block, Operand A is evaluated numerically and the Matrix Entity with that number or name is found. If no such Matrix Entity is found, an Error

Stop occurs. Matrix Entities must be defined in MATRIX

Commands.

Operands B and C are evaluated numerically to find the proper element in the Matrix Entity. If such an element does not exist, an Error Stop occurs.

Operand D is evaluated and used in the update operation. If Operand A has a + suffix, the operation will be addition to the numerical equivalent of Operand D; if -, it will be subtraction. If

Operand A has no suffix, the matrix entity element will be assigned a new value equal to D.

A matrix is defined in a MATRIX Command. It can have up to 6 dimensions. However, only the first two dimensions can be accessed in an MSAVEVALUE Block. In this case, all missing coordinates are presumed to be equal to 1.

PLUS Procedures can access all elements of any matrix. If you need to use matrices of more than 2 dimensions, you will have to create one or more PLUS Procedures to access them.

Matrices defined in a MATRIX Command have global scope and are known to all PLUS Procedures. In addition, temporary matrices with local scope can be created for the duration of a PLUS Procedure invocation. This is discussed further in

Chapter 8.

Refuse Mode

A Transaction is never refused entry to an MSAVEVALUE

Block.

Special Restriction

MSAVEVALUE Blocks can only access the first cross section of a higher dimensional matrix.

Indices of the third and higher dimensions are given the value 1. PLUS assignment statements can be used to access and modify all elements.

Related SNA

MXEntnum(m,n) - Matrix element value. The value in row m, column n of matrix Entnum is returned. The row and column values can only be

Name, PosInteger, or P class SNA

Related Windows

Expressions Window - Online view of values of expressions.

Matrix Window - Online view of the dynamics of a Matrix cross-section.

Plot Window - Online view of a plot of up to 8 expressions.

OPEN

An OPEN Block initializes a Data Stream.

OPEN A,B,C

Operands

A - Data Stream descriptor. Required. The operand must be

Name, PosInteger, String, ParenthesizedExpression, SNA or

SNA*Parameter.

B - Data Stream number. Optional. The operand must be Null,

Name, PosInteger, ParenthesizedExpression, SNA or SNA*Parameter. Default is 1.

C - Alternate Destination Block name or number. Optional. The operand must be Null, Name, PosInteger, ParenthesizedExpression, SNA, or SNA*Parameter.

Example

OPEN ("MYFILE.TXT"),2,Error_Block

In this example, the OPEN Block creates type of Data Stream known as an I/O Stream, and gives it number 2 for identification. If an error occurs during the OPEN, an error code is stored internally and the Active Transaction proceeds to the Block labeled Error_Block.

Action

An OPEN Block causes a Data Stream to be created, and sets the Current Line Position to 1.

A Data Stream is a sequence of text lines used by a GPSS

World simulation. Each Data Stream is identified by a unique number. There are 3 types of Data Stream:

1.Input/Output (I/O) Streams,

2.In-Memory Streams, and

3.Pipe Streams.

Operand A is evaluated as a string. If it is a null string, an

In-Memory Stream is created. If it is a pipe name, such as

"\pipe\mypipe", a Pipe Stream is created. Otherwise an I/O Stream is created, and Operand A is presumed to be a file specification. If a path is not included in the file specification, it is assumed that the Project’s Report directory is to be used.

Projects are discussed in Chapter 1 of this manual.

If Operand B is used, it is evaluated numerically and used as the Data Stream number, for later reference by READ, WRITE, and CLOSE Blocks. The default is 1.

If Operand C is used, any error occurring during the OPEN causes the Active Transaction to proceed to the Block with that number.

In any case, if an error is detected, the error code is stored internally. A CLOSE Block can be used to retrieve the Error Code.

Chapter 4 (4.16) contains a full discussion of Data Streams, including the Error Code descriptions..

Blocking Condition

The simulation is blocked while the Data Stream is initialized.

Refuse Mode

A Transaction is never refused entry to a CLOSE Block.

Related Blocks

CLOSE - Shut down a Data Stream.

READ - Retrieve a text line from a Data Stream.

WRITE - Send a text line to a Data Stream.

SEEK - Set the Current Line Position of a Data

Stream.

PLUS

A PLUS Block evaluates an expression and, optionally, places the result into a Parameter.

PLUS A,B

Operands

A - Expression. Required. The operand must be Name,

Number, String, ParenthesizedExpression, SNA or

SNA*Parameter.

B - Parameter number. Parameter to receive result. Optional. The operand must be Null, Name, PosInteger,

ParenthesizedExpression, SNA, or SNA*Parameter.

Example

PLUS (normal(2,100,2)+100.26),Result_Parm

Action

When a Transaction enters a PLUS Block, Operand A is evaluated normally.

If Operand B is specified, it is evaluated numerically, truncated, and used to identify a Parameter of the Active Transaction. If no such Parameter exists, it is created. Then, the result from the evaluation of Operand A is placed into it.

PLUS Procedures without an explicit return value return integer

0.

Refuse Mode

A Transaction is never refused entry to a PLUS Block.

Related Windows

Expressions Window - Online view of values of expressions.

Plot Window - Online view of a plot of up to 8 expressions.

PREEMPT

A PREEMPT Block displaces a Transaction from ownership of a Facility Entity.

PREEMPT A,B,C,D,E Operands

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

Name, PosInteger, ParenthesizedExpression, SNA or

SNA*Parameter.

B - Priority Mode. PR, for Priority Mode, or Interrupt Mode, if omitted. Optional. The operand must be PR or Null.

C - Block name or number. New destination for Transaction presently owning the Facility. Optional. The operand must be

Null, Name, PosInteger, ParenthesizedExpression, SNA, or

SNA*Parameter.

D - Parameter number. Parameter of preempted 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.

E - REmove Mode. Removes preempted Transaction from

contention for the Facility. Optional. The operand must be RE, or Null. If RE, you must specify a destination in Operand C.

Examples

PREEMPT Teller1

This is the simplest way to use the PREEMPT Block. When a

Transaction enters this PREEMPT Block, it is given ownership

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