sinergym.utils.wrappers.MultiObsWrapper
- class sinergym.utils.wrappers.MultiObsWrapper(*args: Any, **kwargs: Any)
- __init__(env: Any, n: int = 5, flatten: bool = True) None
Stack of observations.
- Parameters:
env (Any) – Original Gym environment.
n (int, optional) – Number of observations to be stacked. Defaults to 5.
flatten (bool, optional) – Whether or not flat the observation vector. Defaults to True.
Methods
__init__
(env[, n, flatten])Stack of observations.
reset
()Resets the environment.
step
(action)Performs the action in the new environment.
- reset() ndarray
Resets the environment.
- Returns:
Stacked previous observations.
- Return type:
np.ndarray
- step(action: int | ndarray) Tuple[ndarray, float, bool, Dict[str, Any]]
Performs the action in the new environment.
- Parameters:
action (Union[int, np.ndarray]) – Action to be executed in environment.
- Returns:
Tuple with next observation, reward, bool for terminated episode and dict with extra information.
- Return type:
Tuple[np.ndarray, float, bool, Dict[str, Any]]