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.

<strong>SIMSCRIPT</strong> <strong>II.5</strong> <strong>Programming</strong> <strong>Language</strong><br />

These event routine definitions are similar to routine definitions; values appear to be received as<br />

input arguments, described in any of the normal forms. Events cannot have yielding arguments<br />

because they are not called directly from other subprograms and, hence, have no place to which<br />

these values may be returned. The way in which argument values are transmitted to event and process<br />

routines will be discussed later. The general form of an event routine definition is:<br />

event name ( optional input argument list )<br />

5.2.2 Event Notices<br />

There may be a number of different event types or event classes in a program. For each class there<br />

may be many instances at different times. Associated with each instance of each class is an event<br />

notice, used to maintain information about the event. An event notice is a temporary entity that has<br />

five special predefined attributes. One of these attributes, time.a, contains the simulation time at<br />

which the event is to occur. An event notice is filed in a future events set, ranked on this attribute.<br />

The <strong>SIMSCRIPT</strong> <strong>II.5</strong> timing routine is responsible for successively removing event notices from<br />

the future events set, updating the apparent simulation time and initiating the execution of the appropriate<br />

event routine. Another attribute, eunit.a, concerns the way in which the event is scheduled,<br />

for instance, whether it is scheduled from data external to the program. External events need<br />

not, for the present, be considered specially. They are discussed in a later section. The remaining<br />

attributes are those required for membership in the future events set; as the name of this set is ev.s,<br />

the attribute names p.ev.s, s.ev.s, and m.ev.s, represent the predecessor, successor, and<br />

membership attributes.<br />

Event notices may, like any other temporary entity, have additional user-defined attributes. These<br />

may be either variables or functions, and may denote ownership or membership of other sets. Event<br />

notices, however, must be declared separately from nonevent notice entities. The event notice<br />

statement is used in the preamble to declare an event and any user-defined attributes. The statement:<br />

event notices<br />

when placed before a group of every statements, denotes that event notices rather than temporary<br />

or permanent entity declarations follow. The special attributes required by an event notice are defined<br />

automatically. They must not be redefined, and they must not be equivalenced (see Chapter<br />

6 for a discussion of equivalencing). For this reason, the explicit placement of event notice attributes<br />

is restricted, usually within the first five entity words. This depends on the implementation,<br />

and the appropriate user manual should be consulted.<br />

Commonly, event notices have only the specially defined attributes and no additional attributes or<br />

set pointers. They are used only to trigger events within simulated time. When this is the case, the<br />

phrase:<br />

event notice name list<br />

188

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

Saved successfully!

Ooh no, something went wrong!