Time Source (Implementation)#
alts.modules.data_process.time_Source
- class IterationTimeSource(start_time, time_step)[source]#
Bases:
TimeSource
DescriptionThisTimeSource
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)
- start_time: float = 0#
- step(self, iteration) time [source]#
- DescriptionSets 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#
- DescriptionReturns 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#