In my simulation model I use a ShiftCalendar, which makes the machines work mon-fri during two shifts, and all other times the machines are set to "Unplanned". When I run my simulation, all MUs reach the drain after a certain amount of time, but the simulation won't stop and the time continues to run until I manually stop it.
How do I make the simulation stop when all MUs has reached the drain? I would prefer not to set a fixed end-time in the EventController, since I want to see what happens with my simulation time when I for an example change the amount of MUs.
(I have the exact same problem when I use "Failure" for one of my machines. The simulation will continue to run until I stop it, even though all MUs are already generated and recieved by the Drain).
If don't want to set a fixed end-time; can I use a method to make the simulation stop when all MUs have reached the Drain?
then you need to detect the last MU and then you set the end of the eventcontroller (the end has to be in the future!).
e.g. for one MU-type:
if @.class.numChildren = 1 then --only one MU of this class in the model
--set the end of the eventcontroller
eventController.end:=eventController.simTime+0.1; --needs to be in the future!