Skip to content
Snippets Groups Projects

Handle different start and end times of components

Merged Martin Lange requested to merge start-times into main
All threads resolved!
2 files
+ 15
1
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -437,6 +437,8 @@ class TimeComponent(ITimeComponent, Component, ABC):
@property
def time(self):
"""The component's current simulation time."""
if self._time is None and self.status in (ComponentStatus.CREATED or ComponentStatus.INITIALIZED):
"""A time of None is ok before the connect phase"""
if not isinstance(self._time, datetime):
with ErrorLogger(self.logger):
raise ValueError("Time must be of type datetime")
Loading