Clipping Stages
Clipping Stage
- class gem_controllers.stages.clipping_stages.clipping_stage.ClippingStage[source]
This is the base class for all clipping stages.
- __call__(state: ndarray, reference: ndarray) ndarray [source]
Clips a reference to the limits.
- Parameters
state (np.ndarray) – The state of the environment.
reference (np.ndarray) – The reference of the state.
- Returns
The reference of a controller stage clipped to the limit.
- Return type
clipped_reference(np.ndarray)
- property clipped: ndarray
Flag, if the references have been clipped
- property clipping_difference: ndarray
Difference between the reference and the clipped reference
- tune(env: ElectricMotorEnvironment, env_id: str, margin: float = 0.0, **kwargs)[source]
Set the limits for the clipped states.
- Parameters
env (gym_electric_motor.ElectricMotorEnvironment) – The environment to be controlled.
env_id (str) – The id of the environment.
margin (float) – Percentage, how far the value should be clipped below the limit.