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).

Module Contents

Classes

ActionRandomNoiseDisturber

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

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

The mean of the noise normal distribution.

Type:

float

std

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.

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