Cancel
Showing results for 
Search instead for 
Did you mean: 

Simulation time won't stop when shift calendar is used

Creator
Creator

Hi!

 

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).

 

Best Regards
Sofi

5 REPLIES 5
Highlighted

Re: Simulation time won't stop when shift calendar is used

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
The simulation stops automatically, if there are no events left in the eventlist; if you use failures or shiftcalendar, you have events also if you don't have MUs in the model. So you need to set an end in the eventcontroller, tab settings --> field: end
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Simulation time won't stop when shift calendar is used

Creator
Creator

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? 

 

Thanks!

 

 

Re: Simulation time won't stop when shift calendar is used

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
yes, e.g.

eventController.end:=eventController.simTime+0.1;

This stops the experiment after 0.1 seconds.
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Simulation time won't stop when shift calendar is used

Creator
Creator

But if I want to stop the simulation not after 0.1 seconds but when the last MU reaches the Drain? 

Re: Simulation time won't stop when shift calendar is used

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

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!
end;

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net