stable_learning_control.disturbers.env_attributes_disturber

Contains a small gymnasium wrapper that can be used to disturb a physics parameter of a gymnasium environment.

Classes

EnvAttributesDisturber

A gymnasium wrapper that can be used to disturb a physics parameter of a

Module Contents

class stable_learning_control.disturbers.env_attributes_disturber.EnvAttributesDisturber(env, attributes, values)[source]

Bases: gymnasium.Wrapper

A gymnasium wrapper that can be used to disturb a physics parameter of a gymnasium environment.

disturbance_label

A label for the disturbance that can be used for logging or plotting. Used in the eval_robustness utility.

Type:

str

Initialise the EnvAttributesDisturber object.

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

  • attributes (list) – A list of attributes to disturb.

  • values (list) – A list of values to set the parameters to.

Raises:
  • ValueError – The number of parameters and values must be the same.

  • AttributeError – The parameter does not exist in the environment.

attributes[source]
values[source]