gym_wrappers#
Source code: tianshou/env/gym_wrappers.py
- class ContinuousToDiscrete(env: Env, action_per_dim: int | list[int])[source]#
Bases:
ActionWrapperGym environment wrapper to take discrete action in a continuous environment.
- Parameters:
env (gym.Env) – gym environment with continuous action space.
action_per_dim – number of discrete actions in each dimension of the action space.
Constructor for the action wrapper.
- class MultiDiscreteToDiscrete(env: Env)[source]#
Bases:
ActionWrapperGym environment wrapper to take discrete action in multidiscrete environment.
- Parameters:
env (gym.Env) – gym environment with multidiscrete action space.
Constructor for the action wrapper.
- class TruncatedAsTerminated(env: Env)[source]#
Bases:
WrapperA wrapper that set
terminated = terminated or truncatedforstep().It’s intended to use with
gym.wrappers.TimeLimit.- Parameters:
env (gym.Env) – gym environment.
Wraps an environment to allow a modular transformation of the
step()andreset()methods.- Args:
env: The environment to wrap