Time Source (Implementation)#

alts.modules.data_process.time_Source
class IterationTimeSource(start_time, time_step)[source]#

Bases: TimeSource

Description
This TimeSource iterates through time starting at 0 in steps of 1. Time here can be positively offset.
Parameters:
  • start_time (float) – Initial time (default = 0)

  • time_step (float) – Steps of increment of time (default = 1)

post_init(self) None[source]#
Description
Sets all counters to 0.
start_time: float = 0#
step(self, iteration) time[source]#
Description
Sets time to the given iteration.
Example: step(1) -> self.time == 1 + offset, step(3) -> self.time == 3 + offset
Parameters:

iteration (int) – Time will be set to have done this many steps

Returns:

New time

Return type:

float

property time: float#
Description
Returns the current time of the TimeSource
Time is set to be the current iteration times the size of the step each iteration increments by plus a given time offset.
time = iteration * time_step + offset
Returns:

Current time

Return type:

float

time_step: float = 1#