You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you want to simulate an fmu instance, you can specify what shall happen to the fmu instance in terms of setup, reset, instantiate, freeInstance, terminate, e.g. whether a new instance shall be created or an existing instance or the one you called the simulate-function with shall be used. However, these settings don't have an effect, instead the settings of fmu.executionConfig are taken.
Specifically, when prepareSolveFMU is called, these values are not included (not explicitly, not as kwargs), this calls function prepareSolveFMU in L210, and this calls prepareSolveFMU in L26 where instantiate and co. get their default values from the executionConfig.
My proposal is to simply add the named five keyword arguments in the prepareSolveFMU-call in fmi.jl. An alternative may be to remove them toplevel (for simulate) and handle it via executionConfig (which is a possible current workaround).
MWE:
using FMI, DifferentialEquations
using FMIZoo
fmu = loadFMU("BouncingBall1D", "Dymola", "2023x"; type = :ME)
tspan = (getDefaultStartTime(fmu), getDefaultStopTime(fmu))
saveat = collect(tspan[1]:0.01:tspan[2])
inst = fmi2Instantiate!(fmu)
fmi2SetupExperiment(inst)
fmi2EnterInitializationMode(inst)
fmi2ExitInitializationMode(inst)
using FMI.FMIBase: handleEvents
handleEvents(inst)
fmu.instances
length(fmu.instances) == 1
sol = simulateME(inst, tspan; saveat=saveat, setup = false, reset = false, instantiate = false, terminate = false, freeInstance = false)
length(fmu.instances) == 1 #<should be equal, but is not
#<-there is presumably more to test (like status etc) to check that the other commands took their effect.
The text was updated successfully, but these errors were encountered:
When you want to simulate an fmu instance, you can specify what shall happen to the fmu instance in terms of setup, reset, instantiate, freeInstance, terminate, e.g. whether a new instance shall be created or an existing instance or the one you called the simulate-function with shall be used. However, these settings don't have an effect, instead the settings of fmu.executionConfig are taken.
Specifically, when prepareSolveFMU is called, these values are not included (not explicitly, not as kwargs), this calls function prepareSolveFMU in L210, and this calls prepareSolveFMU in L26 where instantiate and co. get their default values from the executionConfig.
My proposal is to simply add the named five keyword arguments in the prepareSolveFMU-call in fmi.jl. An alternative may be to remove them toplevel (for simulate) and handle it via executionConfig (which is a possible current workaround).
MWE:
The text was updated successfully, but these errors were encountered: