Physical System Wrapper
Physical System Wrapper Base Class
- class gym_electric_motor.physical_system_wrappers.PhysicalSystemWrapper(physical_system=None)[source]
A PhysicalSystemWrapper is a wrapper around the PhysicalSystem of a gem-environment.
It may be used to modify its states and actions. In contrast to gym-wrappers which are put around the whole environment, modified states by the PhysicalSystemWrappers can be referenced, rewarded and visualized by the other components of the environment.
- Parameters:
physical_system (PhysicalSystem) – (Optional) The inner physical system can be passed to directly call the set_physical_system-method after the initialization.
- property action_space
The processed action space.
If it is unset, the action space of the inner physical system is returned.
- property k
Returns: int: The current systems time step k.
- property limits
The processed physical system limits.
If it is unset, the inner limits are returned.
- property nominal_state
The processed physical system nominal state.
If it is unset, the inner nominal state is returned.
- property physical_system
The next inner physical_system or the next inner physical_system_wrapper.
- reset(**kwargs)[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
- seed(seed=None)[source]
The function to set the seed.
This function is called by within the global seed call of the environment. The environment passes the sub-seed to this component that is generated based on the source-seed of the env.
- Parameters:
seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every episode start. Default: None (a new SeedSequence is generated).
- Returns:
A list containing all seeds within this RandomComponent. In general, this list has length 1. If the RandomComponent holds further RandomComponent instances, the list has to contain also these entropies. The entropy of this instance has to be placed always at first place.
- Return type:
List(int)
- set_physical_system(physical_system)[source]
Sets the inner physical system of this PhysicalSystemWrapper.
- Parameters:
physical_system (PhysicalSystem) – The inner physical system or Physical System Wrapper.
- 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
The processed physical system state names.
If it is unset, the state names of the inner physical system are returned.
- property state_space
The processed state space.
If it is unset, the state space of the inner physical system is returned.
- property unwrapped
The innermost physical system within all Physical System Wrappers.