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 value and 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 Progress has reached (or passed) the given time. Returns immediately if this Progress has already reached (or passed) the given time.

Parameters:
Returns:

the actual value of the progress when the given time has been reached or passed

Return type:

TieredTime

async has_passed(target, shift=None)[source]

Wait until this Progress has passed the given time. Returns immediately if this Progress has already passed the given time.

Parameters:
Returns:

the actual value of the progress when the given time has been passed

Return type:

TieredTime