18.10.2014 Views

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Discrete Simulation Concepts<br />

ized, they must compete with the externally triggered event notices on a first-come, first-served<br />

basis.<br />

Since an event or process routine can be activated in either of two ways, and each of these ways<br />

provides a different source of data for the routine, a logical expression is provided for use within<br />

such a routine to determine how this instance of the routine was initiated. The expression compares<br />

the keyword process or event with either of the property words internal or external and<br />

yields a true or false result. The form of the expression is:<br />

and<br />

process is propertyorprocess is not property<br />

event is propertyorevent is not property<br />

as in the statements:<br />

and<br />

if process is internal,<br />

read NAME and DESTINATION as B 20, (2) I 10<br />

always<br />

if event is external and data is ended,<br />

stop<br />

otherwise<br />

5.3.9 Triggering Processes and Events Externally<br />

Events are triggered externally by event data records appearing in chronological order on each of<br />

the external input devices. Such a data record contains the name of an event or process, the time at<br />

which it is to occur, and, optionally, data to be read by the event or process routine. The event data<br />

records are read one at a time, their information recognized and deciphered, and event or process<br />

notices created for the events or processes indicated. This paragraph deals with two issues: the operations<br />

performed by <strong>SIMSCRIPT</strong> <strong>II.5</strong> when external process records are read and the format of<br />

the external data records.<br />

When a start simulation statement is recognized, the first task performed by the timing mechanism<br />

is to read information about the first event on each of the external units. When an external<br />

data record is read, the event class is recognized and the event time computed from data on the record.<br />

An event or process notice is created, and the scheduled event time and the number of the unit from<br />

which the data record was read are stored in the time.a and eunit.a attributes of the notice. If<br />

the event notice has been declared with user-defined attributes, it conforms to the preamble declaration.<br />

However, none of the user-defined attributes is assigned values. The notice is then filed in<br />

the future events set corresponding to its class. Internally and externally generated notices are filed<br />

together. They are distinguished by the eunit.a attribute. A coded value of eunit.a, usually<br />

zero, denotes that a notice has been internally scheduled.<br />

209

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!