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

ent classes, on their break ties attributes, if these are specified, or on a first-in, first-out basis if<br />

no break ties attributes have been specified.<br />

Table 5-2. Time Conversion Functions<br />

Name<br />

Argument<br />

Function<br />

Mode<br />

Function<br />

Values<br />

Examples<br />

weekday.f<br />

REAL time<br />

expression<br />

integer 1 - 7<br />

day of current week<br />

weekday.f(5.32)<br />

= 6<br />

hour.f<br />

REAL time<br />

expression<br />

integer 0 - 23<br />

hour of current day<br />

hour.f(5.32) = 7<br />

minute.f<br />

REAL time<br />

expression<br />

integer 0 - 59<br />

minute of current<br />

hour<br />

minute.f(5.32)<br />

= 40<br />

Corresponding to the schedule statement is a cancel statement, which removes a specified process<br />

or event notice from its future events set, before it has been selected for execution. This negates<br />

the action of the schedule statement that filed the event notice. It is written:<br />

cancel this process/event<br />

and<br />

cancel this event called variable<br />

As usual, the first form is interpreted as:<br />

cancel this event called event<br />

The words the or the above can be substituted for this when necessary. The event notice removed<br />

is not automatically destroyed. If required, it may be explicitly destroyed, as may any temporary<br />

entity. An attempt to cancel an event that has not been scheduled, and is therefore not filed<br />

in the future event set, terminates the program with an error message.<br />

5.3.2 Assigning Event and Process Attributes<br />

If an event or process notice is declared to have user-defined attributes, values may be assigned to<br />

these in two ways: through standard attribute (entity) references in assignment statements, and also<br />

within a schedule statement specifying the notice. Recall that a statement such as:<br />

schedule an event given expression list at time expression<br />

uses the time expression to set time.a(event) attribute. It will also assign the values given in<br />

the expression list to successive attributes of the event notice, starting with the first user-defined<br />

attribute. If fewer expressions are listed than there are attributes, the remaining attributes are ini-<br />

197

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

Saved successfully!

Ooh no, something went wrong!