next up previous
Next: EXTFEL extracts an event Up: PROCEDURES Previous: DEBLOCK suppresses blocking of

ENDSIMUL ends the simulation at the end of the actual event

Syntax:

    ENDSIMUL;
It is used to stop the simulation run. When it is executed, the actual event execution is completed and the simulation run is terminated.

This procedure can be used in nodes of any type.

Examples:

     Pop := Pop + 1; IF Pop = 5041 THEN ENDSIMUL;
      WRITELN('Polis population is ', Pop); PAUSE;
When this code is executed, the written message is displayed and the operation pauses until a key is pressed. If, when the code is executed, the value of Pop is 5040, after this pause, the simulation run finishes.
Result (A) :: WRITELN('Maximum Obtained ', MaxProfit: 8: 2);
                    WRITELN('Press C to continue; any other to finish ');
                    Ch := READKEY;
                    IF (Ch = 'c') OR (Ch = 'C') 
                    THEN BEGIN ACT(StartSearch, 0); ACT(Result, 14400) END
                    ELSE ENDSIMUL;
When the node Result is activated, the value of MaxProfit is displayed. The message
 Press C to continue; any other to finish
appears, and the computer stops waiting for the pressing of a key. If this is C or c the StartSearch node is activated and the simulation continues. The node Result is scheduled for a new activation 14400 units of time afterwards. If other key is pressed the simulation ends.



domingo c
Mon Mar 20 17:37:52 PST 2000