18.10.2014 Views

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

basic time unit is interpreted as microseconds, the phrase reads as, "in one and one-half microseconds<br />

from now."<br />

Many simulations represent activities in real time, where the time units commonly used are minutes,<br />

hours, and days. Some standard conversion factors allow <strong>SIMSCRIPT</strong> <strong>II.5</strong> to recognize these time<br />

units. The standard units of time.v are presumed to mean days (e.g., 1.47 is one and forty-seven<br />

one-hundredths days). The phrases:<br />

in arithmetic expression days<br />

in arithmetic expression minutes<br />

in arithmetic expression hours<br />

are understood to mean that the named event is to occur at time.v plus the specified number of<br />

days, hours, or minutes. The word units can be used instead of days, and the word after substituted<br />

for in. Conversions are made by taking the units of time.v as days and using two, real<br />

mode, conversion variables, hours.v and minutes.v, initialized by the <strong>SIMSCRIPT</strong> <strong>II.5</strong> system<br />

to 24 and 60, respectively. These values may be changed at any time to reflect a different measurement<br />

of simulated time.<br />

If time is to be simulated in units of days, hours, and minutes, it can be convenient to reconvert absolute<br />

values of time.v to these units. Three system functions described in table 5-2 provide this<br />

capability. A simulation time of zero is assumed to correspond to the start of the first hour within<br />

the first day of a week.<br />

These functions may be useful in displaying results of a simulation, tracing simulation activity, or<br />

in imposing realistic constraints on the execution of events in simulated time. Two examples illustrate<br />

these uses:<br />

1. A check to allow arrival events to occur only on weekdays or a Saturday:<br />

if WEEKDAY.F(time.v) greater than 6,<br />

reschedule this ARRIVAL at TRUNC.F(time.v)+1<br />

always<br />

2. A process trace statement put at the head of a process routine:<br />

write WEEKDAY.F(time.v), HOUR.F(time.v) and MINUTE.F(time.v) as<br />

"MACHINING ACTIVITY STARTS ON DAY", I 2,<br />

"AT TIME", I 2, ":", I 2, /<br />

A third kind of event scheduling uses the word now (or next, its synonym) in statements such as:<br />

schedule an ARRIVAL now<br />

Processes or events scheduled with a now phrase occur as soon as control passes back to the timing<br />

routine. They precede any scheduled processes or events that may have the same scheduled time.<br />

If two or more are scheduled to occur now, they are ranked on their priority if they are of differ-<br />

196

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

Saved successfully!

Ooh no, something went wrong!