Behavior (Implementation)#

alts.modules.behavior
class EquidistantTimeUniformBehavior(change_interval, lower_value, upper_value, start_time, stop_time)[source]#

Bases: DataBehavior

Description
Changes data behaviour in regular intervals by a uniformly random value between lower_value and upper_value
Parameters:
  • change_interval (float) – Amount of time steps between behaviour changes (default=5.0)

  • lower_value (float) – Lower extent of data value changes, inclusive (default=-1.0)

  • upper_value (float) – Upper extent of data value changes, exclusive (default=1.0)

  • start_time (float) – Start of affected time (default=0.0)

  • stop_time (float) – Stop of affected time (default=600.0)

behavior(self) change_times, change_values[source]#
Description
First calculates how many times the data changes =n.
Then draws n+1 [1] many uniformly random values in [lower_value, upper_value) =change_values.
Finally calculates the equidistant change times based on n+1 =change_times
Returns:

change_times, change_values

Return type:

NDArray[float], NDArray[float]

class RandomTimeBrownBehavior(change_interval, lower_value, upper_value, start_time, stop_time)[source]#

Bases: DataBehavior

Description
Changes data behaviour in random intervals by a uniformly random value between lower_value and upper_value
Parameters:
  • change_interval (float) – Indicator [2] of time steps between behaviour changes (default=5.0)

  • lower_value (float) – Indicator of lower extent of data value changes, inclusive (default=-1.0)

  • upper_value (float) – Indicator of upper extent of data value changes, exclusive (default=1.0)

  • start_time (float) – Start of affected time (default=0.0)

  • stop_time (float) – Stop of affected time (default=600.0)

behavior(self) change_times, change_values[source]#
Description
Calculates how many times the data changes =n.
Calculates an the average between lower_value and upper_Value =offset.
Draws n/4 random values in [-offset, offset) =observation_values.
Interpolates the observation_values through Gaussian Regression with Brownian Motion =interpolated_values.
Draws n*4 random times in [start_time, stop_time) =change_times.
Reads the values from interpolated_values at the change_times and adds the offset =change_values
Returns:

change_times, change_values

Return type:

NDArray[float], NDArray[float]

class RandomTimeUniformBehavior(change_interval, lower_value, upper_value, start_time, stop_time)[source]#

Bases: DataBehavior

Description
Changes data behaviour in random intervals by a uniformly random value between lower_value and upper_value
Parameters:
  • change_interval (float) – Average amount of time steps between behaviour changes (default=5.0)

  • lower_value (float) – Lower extent of data value changes, inclusive (default=-1.0)

  • upper_value (float) – Upper extent of data value changes, exclusive (default=1.0)

  • start_time (float) – Start of affected time (default=0.0)

  • stop_time (float) – Stop of affected time (default=600.0)

behavior(self) change_times, change_values[source]#
Description
First calculates how many times the data changes =n.
Then draws n+1 [3] many uniformly random values in [lower_value, upper_value) =change_values.
Finally draws the n+1 random times in [start_time, stop_time) =change_times
Returns:

change_times, change_values

Return type:

NDArray[float], NDArray[float]