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

Re-simulate interactive simulations (enhancement proposal) #8303

Closed
max-privato opened this issue Dec 12, 2021 · 8 comments · Fixed by #11670
Closed

Re-simulate interactive simulations (enhancement proposal) #8303

max-privato opened this issue Dec 12, 2021 · 8 comments · Fixed by #11670
Assignees
Milestone

Comments

@max-privato
Copy link

Description

I see that interactive simulations do not allow re-simulating from OMEdit.

I don't understand the difficulties of allowing this. Maybe because all parameters are structural for interactive simulations?

Re-simulating may be useful for interactive simulations because if the simulation interacts with the external world through Modelica_DeviceDrivers (interaction with the user through keyboard or joystick, with the computers via serial or UDP communication, etc), each simulation is different from another. And this without having to change any model parameter.

In case allowing re-simulation also for interactive simulations is easy to implement, I would be glad to have it.

Steps to Reproduce

Expected Behavior

This is an enhancement suggestion, not a bug report. What I expect is to be able to re-simulate interactive simulations from OMEdit

Screenshots

Version and OS

OM 1.18.0, Win10 64 bit

  • OpenModelica Version: [e.g. omc --version or Help->About OMEdit from OMEdit]
  • OS: [e.g. Windows 10, 64 bit]
  • Versions of used Modelica libraries if applicable

Additional Context

@casella
Copy link
Contributor

casella commented Dec 13, 2021

@adeas31 is off, he'll have a look next year.

@max-privato
Copy link
Author

max-privato commented Apr 4, 2022

Any news on this?
Probably it would require just removing a couple of rows of code, the rows that intercept pressing the re-simulate button when doing interactive simulations, and block everything.

If this is true, it is very fast to fix it.
Thank you!

@casella
Copy link
Contributor

casella commented Apr 11, 2022

@adeas31 is this an easy fix? Thanks!

@max-privato
Copy link
Author

Has anyone had a look at this?
I use this feature every day, many times per day, and I must continuously recompile the same model (without any modification) just to run it...

@casella
Copy link
Contributor

casella commented May 19, 2022

@adeas31 can you please have a look once the 1.19.0 release is done? Thanks!

@adeas31
Copy link
Member

adeas31 commented May 29, 2023

How do you want re-simulation to work in this case? Since interactive simulation keeps the process running so if we want to do re-simulation then we need to run another instance of the simulation executable which can cause issues because of sharing the same resources (e.g., reading/writing to the same files). So maybe we can allow re-simulation only when the user stops the interactive simulation.

@ceraolo
Copy link

ceraolo commented May 29, 2023

yes, I mean restarting a simuation after a stop.

As I mentioned in the ticket description, this makes sense since a lot of things can make the new run different from the previous when we use Modelica_DeviceDrivers, and therefore our modelica interferes with the external world.
In addition re-simulating after a (non-structural) parameter change wil also be very useful as for ordinary simulations.

Now, instead we have to create the new executable again and again, which is annoying, especially when you have several other constraints coming from the presence of interacting hardware.

@adeas31 adeas31 added this to the UniPI DFD - September 2023 milestone Jun 16, 2023
@casella casella modified the milestones: UniPI DFD - October 2023, 1.23.0 Sep 18, 2023
adeas31 added a commit to adeas31/OpenModelica that referenced this issue Dec 1, 2023
@adeas31
Copy link
Member

adeas31 commented Dec 1, 2023

PR #11670 should allow re-simulation of interactive simulations. The only annoying thing is that whenever you try to re-simulate then the already plotted curves are removed. That is because there is no way to preserve the state of the server. We start the interactive simulation again on re-simulate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants