mosaik.progress — representation of a simulator’s progress in time¶
- class Progress(initial)[source]¶
A progress keeps track of a simulator’s progress and provided coroutines for waiting for the progress to reach or pass a given value.
The implemenation is generic over the type of the time values, provided that they are comparable.
- Parameters:
initial (TieredTime)
- time: TieredTime[source]¶
The current value of the progress.
- set(time)[source]¶
Set the progress to
valueand trigger all waiting coroutines whose wait times have now been passed or reached.- Parameters:
time (TieredTime)
- async has_reached(target, shift=None)[source]¶
Wait until this
Progresshas reached (or passed) the given time. Returns immediately if thisProgresshas already reached (or passed) the given time.- Parameters:
time – the time that needs to be reached (or passed)
target (TieredTime)
shift (TieredDuration | None)
- Returns:
the actual value of the progress when the given time has been reached or passed
- Return type:
- async has_passed(target, shift=None)[source]¶
Wait until this
Progresshas passed the given time. Returns immediately if thisProgresshas already passed the given time.- Parameters:
time – the time that needs to be passed
target (TieredTime)
shift (TieredDuration | None)
- Returns:
the actual value of the progress when the given time has been passed
- Return type: