question

Ale avatar image
0 Likes"
Ale asked Ale commented

Stop the model when last piece is out of the system

I currently have 2 different models and one stops automatically when the last piece is out of the system and the other keeps running indefinitely even when the last piece has being completed. I been trying to figure out what's the difference but I don't see one.

What can I do so the model that keeps running indefinitely stops when the last piece is completed? It affects the statistics collector utilization when it does this

FlexSim 17.2.3
simulation time
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Ben Wilson avatar image
2 Likes"
Ben Wilson answered Ale commented

Hi @Ale,

A model will keep running as long as it has events scheduled, or until it is stopped manually or programmatically (using the stop() command).

For your model that keeps running, most likely there is something like a repeating time table that will continue to create events forever. If you're curious to know what events are still coming up that enable the model to keep running, run your model until after it should have finished, then open the Event List to view events that are scheduled in your model. Open the Event List from the main menu, under Debug.

Since the model has some sort of event that will continue running indefinitely, you need to decide on some event that you can listen for yourself, and stop() the model when your completion-conditions are met.

For instance, if you know that 100 parts need to be processed, after which your simulation is complete, you could use an OnEntry trigger on the Sink. Once the Sink's input reaches 100, call stop() to stop the model.

Often it will be a more complicated set of conditions, but either way, you keep track of what conditions have been met, compare it to what conditions need to be to indicate completion, then stop() the model when appropriate. You may need to save state flags on labels or with a Global Table to determine when all the conditions have been met. It is very much dependent on how you built the model and what the constraints are as to how exactly you will track when the model is complete.

Perhaps other voices will chime in with additional ideas.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Ale avatar image Ale commented ·

@Ben Wilson yes, that was the issue the time table, for now I don't need so it works. In case I Need the time table in the future I will keep in mind your suggestions. Thank you!

0 Likes 0 ·