-
Notifications
You must be signed in to change notification settings - Fork 11
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
Feature/779 state serialization #780
base: dev/state-persistence
Are you sure you want to change the base?
Feature/779 state serialization #780
Conversation
…or serialization test
…tion # Conflicts: # include/cosim/observer/observer.hpp
@kyllingstad, @restenb the PR is ready for your reviews :) |
* Added an option to file_observer_config to set fixed precision value. * Fixed build failure
I think we need to parse the following
so that users can check if they can export states from the FMUs they are running. I think FMUs not implementing these functions can throw exception or abruptly terminate? |
Not sure what the behavior would be, but it makes sense to include this check in any case. An FMU that does not set these flags should not be possible to use with state saving. |
I found the consumers of I think this is bug in conan when upstream dependencies are added as shared library (related to conan-io/conan#13302) . Not sure if this is resolved in the newer version, but I am linking |
entry.second->observe(currentStep, currentTime); | ||
entry.second->reset(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I experienced an issue with time-series-observer when the state was restored.
The observer was not able to fetch correct time-series values via get_step_numbers
and get_real_samples
when the state was restored back in simulation time. This was due to the earlier simulation data in buffer timeSamples_
was cleared (adjustIfFull
). Because of this, the data needed in the restored state was not available anymore and the observer was no longer able to retrieve the correct time series data unless the simulation progresses until the time matches those in "max(timeSamples_
)".
Since the data will be "re-generated" anyways after the restore, I suggest just to clear the buffers (both timeSamples_
and step_numbers
) to avoid this issue.
closes #779
<<
and>>
to (de)seserializecosim::serialization::node
object tostd::o/istream
Addedstate_serilization_test.cpp
which is based onsave_state_test.cpp
for testing.save_state_test.cpp
for testing export and import of states to/from filesprint_ptree
for replacing the previous<<
operator for pretty-printingcosim::serialization::node
.canGetAndSetFMUstate
andcanSerializeFMUstate
cosim capabilities frommodelDescrpition.xml
and store them tocosim::model_description
time_series_observer.cpp
to clear internal buffers when state is restored (see the comment below).TODOs