Cancel
Showing results for 
Search instead for 
Did you mean: 

problem with shift calender

Builder
Builder

hello everyone,

i am new to this communityand i want your kind  help regarding use of shift calender.The  source in my model produces different parts in sequence.when i dont use the shift calender i get a end report showing the simulation data and time automatically after all the parts are finished in sequence.but when i use shift calender i dont get end report and the simulation doesnt stop automatically after all the parts in sequence are finished.The simulation keep running even if there is no parts in the source.please help me out in this situation.i want to get the end report and finish the smiulation automatically after all parts in sequence are finished.

Thanks!!!!!

2 REPLIES

Re: problem with shift calender

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Plant Simulation stops the experiment, if no event is in the event-list or at the time you set in the EventController in the field end.

If you use a ShiftCalender, than there are everytime new events in the event-list and so the simulation doesn't stop.

You could set the end of the eventcontroller, if the last part  enters the drain. To detect the last part, you can use the inheritance of the MUs (<class>.numChildren). If the sum of numChildren of all MUs is 1, then this is the last part in the model. Then you can set the end of the eventcontroller and the experiment stops:

 

is
do
 --the sum of all MU-children is one --> the last part
 if .MUs.Entity.numChildren = 1 then
  --the last
  eventController.end:=eventController.simTime+0.001;
 end;
end;

 

 

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

Re: problem with shift calender

Builder
Builder

Thanks a lot.it worked Smiley Happy