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

Job 2 activity<br />

Job 1 activity<br />

START.JOB 1<br />

START.JOB 2<br />

END.JOB 1<br />

END.JOB 2<br />

Simulated time<br />

Figure 5-3b. Two Nested Activities<br />

END.JOB 1<br />

START.JOB 1<br />

Simulated time<br />

START.JOB 2<br />

END.JOB 2<br />

Figure 5-3c.Two Activities with a Common Event Time<br />

Table 5.1. Figure 5-3 Event Order<br />

Time Figure 5-3a. Figure 5-3b. Figure 5-3c.<br />

START.JOB 1 START.JOB ⎛START.JOB 1 1 ⎞<br />

⎜START.JOB 2 ⎟ in parallel<br />

⎝<br />

⎠<br />

START.JOB 2 START.JOB 2<br />

END.JOB 1 END.JOB 2 END.JOB 1<br />

END.JOB 2 END.JOB 1 END.JOB 2<br />

5.2.1 Event Declaration<br />

A routine is declared to be an event routine rather than a callable subprogram by use of the word<br />

event rather than routine in the routine definition. The flow of control within an event routine<br />

behaves in the ordinary way, in that control is passed to the start of the event and leaves by a<br />

return statement. Typical event routine declaration statements are:<br />

event ARRIVAL given LOCATION and ALTITUDE<br />

event DEPARTING(DESTINATION)<br />

event ALLOCATION(SUM, PERSON1, PERSON2)<br />

187

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

Saved successfully!

Ooh no, something went wrong!