I wanted to be able to interact with an FMU to update the inputs either in co-simulation or with Model exchange.
From https://github.com/claxerity/FMPy/blob/master/fmpy/examples/custom_input.py, I knew it was possible to do so with doStep for co-simulation, and I found you could also do that for ModelExchange (#84) via step_finished
Now my question is: is there a difference between those two methods? Going with step_finished seems more generic as it works both with Model Exchange and co-simulation.
What would be the advantage(s) of using doStep rather than step_finished?
If you write your own simulation loop you can set the inputs directly (e.g. before calling doStep() in Co-Simulation). If you want to use FMPy's simulation loop you have to use the step_finished callback.
It is more a question than an issue
I wanted to be able to interact with an FMU to update the inputs either in co-simulation or with Model exchange. From https://github.com/claxerity/FMPy/blob/master/fmpy/examples/custom_input.py, I knew it was possible to do so with
doStep
for co-simulation, and I found you could also do that for ModelExchange (#84) viastep_finished
Now my question is: is there a difference between those two methods? Going with
step_finished
seems more generic as it works both with Model Exchange and co-simulation. What would be the advantage(s) of usingdoStep
rather thanstep_finished
?Thanks in advance.