stable_learning_control.disturbers.action_random_noise_disturber

Contains a small gymnasium wrapper that can be used to disturb the action of a gymnasium environment with normally distributed random noise (i.e. mean and std).

Classes

ActionRandomNoiseDisturber

A gymnasium wrapper that can be used to disturb the action of a gymnasium

Module Contents

class stable_learning_control.disturbers.action_random_noise_disturber.ActionRandomNoiseDisturber(env, mean, std)[source]

Bases: gymnasium.ActionWrapper

A gymnasium wrapper that can be used to disturb the action of a gymnasium environment with normally distributed random noise.

mean[source]

The mean of the noise normal distribution.

Type:

float

std[source]

The standard deviation of the noise normal distribution.

Type:

float

Initialise the ActionRandomNoiseDisturber object.

Parameters:
  • env (gym.Env) – The gymnasium environment.

  • mean (float) – The mean of the noise normal distribution.

  • std (float) – The standard deviation of the noise normal distribution.

mean[source]
std[source]
action(action)[source]

Add normally distributed random noise to the action.

Parameters:

action (np.ndarray) – The action.

Returns:

The action with added noise.

Return type:

np.ndarray