question

Kuilin S avatar image
0 Likes"
Kuilin S asked Kuilin S commented

How to make the model automatically restart when it finishes running?

Hello everyone,

Now I want my simulation restart as soon as the "stop()" is triggered. Also, I set the "stop times" for the model. I want to restart it when it stops. It means that when my model stops, I want it to reset and then run automatically. Is there any functions or methods to accomplish this command? Please help me.stop.pngstop-times.png

FlexSim 22.0.4
loopresetrestart
stop.png (4.5 KiB)
stop-times.png (13.9 KiB)
· 2
5 |100000

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

Ralf Gruber avatar image Ralf Gruber ♦ commented ·
Kuilin,

what is the actual purpose for you to repeat the same run over and over? Maybe a closer explanation will allow people here to help you better.

0 Likes 0 ·
Kuilin S avatar image Kuilin S Ralf Gruber ♦ commented ·
My purpose for it is to automatically rerun my model if a logic error exists.
0 Likes 0 ·

1 Answer

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Jason Lightfoot commented

Doing multiple model runs automatically would generally be done by using the experimenter. Apart from setting a fixed stop time for the replications you can also use the command 'endreplication()' to stop a run by some other condition.

· 3
5 |100000

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

Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·

Yes - use the experimenter for analysis.

If you wanted to show the model running on a repeated loop, then resetmodel() and go() can also be used if triggered from an independent event - like a delayed message.

1 Like 1 ·
Joerg Vogel avatar image Joerg Vogel commented ·
But a stop() is final. The model is not running anymore.
0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Joerg Vogel commented ·
Yes - so you can do resetmodel() and go() in the same trigger as the stop() - but that makes the stop() pointless.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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