Physical Systems
Physical System Base Class
- class gym_electric_motor.core.PhysicalSystem(action_space, state_space, state_names, tau)[source]
The Physical System module encapsulates the physical model of the system as well as the simulation from one step to the next.
- Parameters:
action_space (gymnasium.Space) – The set of allowed actions on the system.
state_space (gymnasium.Space) – The set of possible systems states.
state_names (ndarray(str)) – The names of the systems states
tau (float) – The systems simulation time interval.
- property action_space
Returns: gymnasium.Space: An Farama Gymnasium Space that describes the possible actions on the system.
- close()[source]
Called, when the environment is closed. Close the System and all of its submodules by closing files, saving logs etc.
- property k
Returns: int: The current systems time step k.
- property limits
Returns: ndarray(float): An array containing the maximum allowed physical values for each state variable.
- property nominal_state
Returns: ndarray(float): An array containing the nominal values for each state variable.
- reset(initial_state=None)[source]
Reset the physical system to an initial state before a new episode starts.
- Returns:
The initial systems state
- Return type:
element of state_space
- simulate(action)[source]
Simulation of the Physical System for one time step with the input action. This method is called in the environment in every step to update the systems state.
- Parameters:
action (element of action_space) – The action to play on the system for the next time step.
- Returns:
The systems state after the action was applied.
- Return type:
element of state_space
- property state_names
Returns: ndarray(str): Array containing the names of the systems states.
- property state_positions
Returns: dict(int): Dictionary mapping the state names to its positions in the state arrays
- property state_space
Returns: gymnasium.Space: An Farama Gymnasium Space that describes the possible states of the system.
- property unwrapped
Returns this instance of the physical system.
If the system is wrapped into multiple PhysicalSystemWrappers this property returns directly the innermost system.