From 138d1a31970994da03ee66b0ec117ab5edd861a6 Mon Sep 17 00:00:00 2001 From: David Blum Date: Wed, 9 Jun 2021 08:03:54 -0700 Subject: [PATCH] Add event check and update for ME2 --- src/pyfmi/fmi_algorithm_drivers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pyfmi/fmi_algorithm_drivers.py b/src/pyfmi/fmi_algorithm_drivers.py index d7e2d0e2..6b0bc3b6 100644 --- a/src/pyfmi/fmi_algorithm_drivers.py +++ b/src/pyfmi/fmi_algorithm_drivers.py @@ -351,7 +351,9 @@ def __init__(self, event_info = self.model.get_event_info() if event_info.upcomingTimeEvent and event_info.nextEventTime == model.time: self.model.event_update() - + elif isinstance(self.model, fmi.FMUModelME2): + self.model.event_update() + if abs(start_time - model.time) > 1e-14: logging.warning('The simulation start time (%f) and the current time in the model (%f) is different. Is the simulation start time correctly set?'%(start_time, model.time))