Closed kyllingstad closed 2 months ago
The fix is trivial: Just add the line
get_variables(duration::zero());
at the end of slave_simulator::impl::setup()
.
I'll do this while working on #756, as I'm making changes to slave_simulator
and writing a unittest for it there anyway.
Potential fix for https://github.com/open-simulation-platform/libcosim/issues/609 I reckon
Potential fix for #609 I reckon
I tried to run the quarter-car case with the new code in #765, and it seems unfortunately not. The line I added there to fix this issue only transfers subsimulator variables to the master so they're available there; it doesn't push them out to the subsimulators again.
Let us say that we have an FMU instance with an output variable
x
which has a default initial value of1.0
. Furthermore, assume we have an object of typestd::shared_ptr<slave>
namedinstance
which refers to this instance. Now, consider the following:The assertion in the last line should pass, but it will fail.
The reason is that we don't populate the output variable cache in
slave_simulator
in itssetup()
method. We should, because at the end of that method call, the (FMI 2.0) FMU instance will be in initialisation mode, where output variables are gettable.