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

process TASK<br />

write IDENT(TASK), time.v as<br />

/, "TASK: ", T 10, "STARTED AT: " D(4,2),/<br />

activate a COMPLETION giving IDENT(TASK) in 2 days<br />

return<br />

end<br />

The important points to remember about process and event activation are:<br />

1. Time.v is set to the time.a attribute at activation<br />

2. A global variable with the same name as the event or process is given the value of the event<br />

or process notice pointer. The attributes may be accessed through this variable.<br />

3. In the case of events only, the event notice is destroyed unless a saving phrase is used, and<br />

4. When the return statement is executed, control passes to the timing routine to select the<br />

next process.<br />

5.3.3 Process Interactions<br />

Up to now, processes have not appeared to differ greatly from events. However, it has been stated<br />

that processes may represent an activity that has a duration in simulated time. Such an activity, in<br />

its simplest form, has two delimiting events. The start event of the activity is represented by the<br />

initiation of the process routine. The terminating event must take place after some lapse of simulated<br />

time. In the simple case, this lapse of time can be estimated. In an event-based simulation, a<br />

terminating event would be scheduled at this interval in the future. Within a process routine or a<br />

subroutine called from a process routine, however, either of two statements may be used to halt the<br />

process execution for a given lapse of simulation time. These statements are:<br />

and<br />

work time-expression<br />

wait time-expression<br />

The effect of these statements is to file the process notice associated with the process back in the<br />

future events set, after adjusting the time.a attribute to indicate the future time at which execution<br />

of the process routine should resume. When simulation time has advanced so that the process notice<br />

becomes again eligible for execution, this execution is resumed at the statement following the work<br />

or wait. Other events and activities may, of course, be executed during the time lapse. The two<br />

statements differ only in the status attributed to the process during the passing of simulation time.<br />

This status is recorded in a special attribute of the process notice, where it may be interrogated by<br />

any other executing routine. These statements allow for the representation of determined passages<br />

of simulation time during an activity. The time to spend in a waiting or working state must be<br />

known when the statement is executed. The time to carry out a specified machining task on an au-<br />

200

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

Saved successfully!

Ooh no, something went wrong!