Crash caused by resetmodel in On Run Stop event

Crash caused by resetmodel in On Run Stop event

shigehiro_tsubasa
Observer Observer
21 Views
11 Replies
Message 1 of 12

Crash caused by resetmodel in On Run Stop event

shigehiro_tsubasa
Observer
Observer

[ FlexSim 24.0.4 ]

Hello all.

FlexSim crashes when I call the resetmodel function on the On Run Stop event.

It seems that an exception is generated in the switch shader, so I have updated the graphics driver and Windows Update, but there is no change.

I have tried this on other PCs and the same phenomenon occurs.

Is it impossible to call the resetmodel function from the On Run Stop event?

If this is not a bug, is there an alternative way to reset the model in the On Run Stop event?

resetmodel.fsm

0 Likes
Accepted solutions (1)
22 Views
11 Replies
Replies (11)
Message 2 of 12

shigehiro_tsubasa
Observer
Observer

It does not crash when run in steps, but crashes when run with cleared breakpoints.

0 Likes
Message 3 of 12

moehlmann_fe
Observer
Observer
My guess would be that as part of the reset process the model is stopped, resulting in an infinite loop.

Is there a particular reason why you want to use this logic structure instead of just resetting the model directly?

0 Likes
Message 4 of 12

shigehiro_tsubasa
Observer
Observer

I would like to have it reset and run automatically when it is stopped.

0 Likes
Message 5 of 12

moehlmann_fe
Observer
Observer
Accepted solution

Resetting and running the model again is not really possible inside FlexSim itself because any pending actions (like starting the model again) will be lost on reset. There are two options:

- Use the experimenter to run multiple replications of the same model and/or scenarios that have different parameter values set.

https://docs.flexsim.com/en/24.2/GettingData/AdvancedDataGathering/KeyConceptsExperiments/KeyConcept...

https://docs.flexsim.com/en/24.2/GettingData/AdvancedDataGathering/RunningJobs/RunningJobs.html

- Control FlexSim externally to start and stop runs.

https://answers.flexsim.com/questions/122645/how-to-stop-and-resume-a-flexsim-model-externally.html

https://answers.flexsim.com/questions/149147/controlling-flexsim-externally.html

0 Likes
Message 6 of 12

shigehiro_tsubasa
Observer
Observer

Thank you for your reply.

However, I want to reset and run it from the beginning, not restart. Is this also impossible?

0 Likes
Message 7 of 12

moehlmann_fe
Observer
Observer
I don't see a difference between the two (?)
0 Likes
Message 8 of 12

shigehiro_tsubasa
Observer
Observer

Sorry. I made a mistake.

I mean,isn't what you're saying "resume"?

I want to "reset and run from the beginning".

0 Likes
Message 9 of 12

moehlmann_fe
Observer
Observer
Some of the links say "resume" yes. But those links are mostly meant to lead you to necessary resources for learning how to control FlexSim externally in general. Resetting the model should also be possible that way.

Though the experimenter would be the preferred option since its build in and easier to use and also has the benefit of any charts and statistics tables automatically being saved to a database so you can view them later.

0 Likes
Message 10 of 12

shigehiro_tsubasa
Observer
Observer

Thanks, I see that I cannot run the model again from OnRunStop.

0 Likes
Message 11 of 12

joerg_vogel_HsH
Mentor
Mentor

@T_Hige, you can execute an external program that emulates the mouse pointer to start your model again. Some of them use a script which you can let delay an action.

0 Likes
Message 12 of 12

shigehiro_tsubasa
Observer
Observer

@Joerg Vogel
Good idea. Thank you.

0 Likes