Current Sum Processor
- class gym_electric_motor.physical_system_wrappers.current_sum_processor.CurrentSumProcessor(currents, limit='max', physical_system=None)[source]
Adds an
i_sum
state to the systems state vector that adds up currents.- Parameters:
currents (Iterable[string]) – Iterable of the names of the currents to be summed up.
limit ('max'/'sum') – Selection if the limit and nominal values of
i_sum
are calculated by the maximum of the limits / nominal values of the source currents or their summation.physical_system (PhysicalSystem(optional)) – The inner PhysicalSystem of this processor.
- property action_space
The processed action space.
If it is unset, the action space of the inner physical system is returned.
- close()
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
The processed physical system limits.
If it is unset, the inner limits are returned.
- next_generator()
Sets a new reference generator for a new episode.
- 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.
- property random_generator
The random generator that has to be used to draw the random numbers.
- reset()[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)
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)
- property seed_sequence
The base seed sequence that generates the sub generators and sub seeds at every environment reset.
- 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_positions
Returns: dict(int): Dictionary mapping the state names to its positions in the state arrays
- 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.