Skip to content

Commit 6a2eaeb

Browse files
authored
Merge pull request #46 from RWTH-EBC/45_resetCalling
Correctly use reset function
2 parents eb77426 + fd838b6 commit 6a2eaeb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ebcpy/simulationapi/fmu.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ def _single_simulation(self, kwargs):
211211
self.check_unsupported_variables(variables=list(parameters.keys()),
212212
type_of_var="parameters")
213213
try:
214+
# reset the FMU instance instead of creating a new one
215+
fmu_instance.reset()
216+
# Simulate
214217
res = fmpy.simulate_fmu(
215218
filename=unzip_dir,
216219
start_time=self.sim_setup.start_time,
@@ -230,7 +233,6 @@ def _single_simulation(self, kwargs):
230233
fmu_instance=fmu_instance,
231234
fmi_type=self._fmi_type,
232235
)
233-
fmu_instance.reset()
234236

235237
except Exception as error:
236238
self.logger.error(f"[SIMULATION ERROR] Error occurred while running FMU: \n {error}")

0 commit comments

Comments
 (0)