Constraint Monitor

Usage Guide

ToDo

Constraint Monitor API Documentation

class gym_electric_motor.core.ConstraintMonitor(limit_constraints=(), additional_constraints=(), merge_violations='max')[source]

Bases: object

API for gym_electric_motor.core.ConstraintMonitor.

Note

The original docstring is temporarily suppressed due to formatting issues upstream. Once it’s cleaned, we’ll restore the full text here.

API for gym_electric_motor.core.ConstraintMonitor.

Note

The original docstring is temporarily suppressed due to formatting issues upstream. Once it’s cleaned, we’ll restore the full text here.

check_constraints(state: ndarray)[source]

Function to check and merge all constraints.

Parameters:

state (ndarray(float)) – The current environments state.

Returns:

The total violation degree in [0,1]

Return type:

float

set_modules(ps: PhysicalSystem)[source]

The PhysicalSystem of the environment is passed to save important parameters like the index of the states.

Parameters:

ps (PhysicalSystem) – The PhysicalSystem of the environment.

property constraints

Returns the list of all constraints the ConstraintMonitor observes.