Advanced Modelling FeaturesInterrupts
The Model Trace |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Let us now take a look at the trace output of this example to see how interrupting a process's execution works. We start at simulation time 29.2158 where the van carrier finishes loading Truck#6 and starts service on Truck#7. Note that the end of service (the hold()) is scheduled to happen at 35.4954. At simulation time 31.6672 though, the first urgent truck (Truck#17) arrives and interrupts VanCarrier#1. The van carrier then inserts the truck it is currently serving (Truck#7) back into the truck queue and immediately starts service on the urgent Truck#17 until simulation time 36.3058. In the meantime, two more trucks arrive and wait in line. When the van carrier has finished service for the urgent truck it resumes servicing Truck#7 whose service got interrupted. This shows that we implemented the service order correctly.
You may download the full source code of this example if you want to try it out yourself. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
http://desmoj.sourceforge.net/tutorial/advanced/interrupt5.html |