Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulate until allows single steps to be taken after end time is passed and "stopped" flag is not reversed if simulate_until ends by timeout #654

Closed
msteinsto opened this issue Sep 7, 2021 · 0 comments
Labels
invalid This doesn't seem right

Comments

@msteinsto
Copy link
Contributor

Current do-loop implementation of simulate_until() allows single steps to be taken after end time is exceeded if the optional end time is provided. It would probably be more intuitive that the simulation will only step if the end time is not exceeded. The step function can be used if a single simulation step is the intended behavior.

Furthermore, the stopped_ flag is not reset if the simulate_until() function is ended by timeout. is_running() is determined by the inverse of the stopped_ flag. The simulation then ends up in a state where it is effectively paused as it is no longer stepping while the indicated state accessed by is_running() will return true. is_running() is documented as "Is the simulation loop currently running" which it will not be if the simulate_until() while loop is ended by time_out() returning true. stop_simulation() is documented as "Stops the co-simulation temporarily" which should probably be called after the simulate_until() function has successfully completed all steps. stop_simulation() sets the stopped_ flag to true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants