<liclass="toctree-l1 current has-children"><aclass="reference internal"href="../">Wrappers</a><inputchecked=""class="toctree-checkbox"id="toctree-checkbox-2"name="toctree-checkbox-2"role="switch"type="checkbox"/><labelfor="toctree-checkbox-2"><divclass="visually-hidden">Toggle child pages in navigation</div><iclass="icon"><svg><usehref="#svg-arrow-right"></use></svg></i></label><ulclass="current">
<liclass="toctree-l2 current current-page"><aclass="current reference internal"href="#">Misc Wrappers</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../../../environments/classic_control/mountain_car_continuous/">Mountain Car Continuous</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="../../../environments/third_party_environments/#third-party-environments-using-gym">Third-Party Environments using Gym</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../../../tutorials/gymnasium_basics/environment_creation/">Make your own custom environment</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../../../tutorials/gymnasium_basics/vector_envs_tutorial/">Training A2C with Vector Envs and Domain Randomization</a></li>
</ul>
</li>
<liclass="toctree-l1 has-children"><aclass="reference internal"href="../../../tutorials/training_agents/">Training Agents</a><inputclass="toctree-checkbox"id="toctree-checkbox-10"name="toctree-checkbox-10"role="switch"type="checkbox"/><labelfor="toctree-checkbox-10"><divclass="visually-hidden">Toggle child pages in navigation</div><iclass="icon"><svg><usehref="#svg-arrow-right"></use></svg></i></label><ul>
<liclass="toctree-l2"><aclass="reference internal"href="../../../tutorials/training_agents/reinforce_invpend_gym_v26/">Training using REINFORCE for Mujoco</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="../../../tutorials/training_agents/blackjack_tutorial/">Solving Blackjack with Q-Learning</a></li>
<liclass="toctree-l1"><aclass="reference external"href="https://github.com/Farama-Foundation/Gymnasium/blob/main/docs/README.md">Contribute to the Docs</a></li>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">gymnasium.wrappers.</span></span><spanclass="sig-name descname"><spanclass="pre">AtariPreprocessing</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">env</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="../../env/#gymnasium.Env"title="gymnasium.core.Env"><spanclass="pre">Env</span></a></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">noop_max</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">int</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">30</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">frame_skip</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">int</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">4</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">screen_size</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">int</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">84</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">terminal_on_life_loss</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">bool</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">False</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">grayscale_obs</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">bool</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">True</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">grayscale_newaxis</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">bool</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">False</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">scale_obs</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">bool</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">False</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#gymnasium.wrappers.AtariPreprocessing"title="Permalink to this definition">#</a></dt>
<dd><p>Atari 2600 preprocessing wrapper.</p>
<p>This class follows the guidelines in Machado et al. (2018),
“Revisiting the Arcade Learning Environment: Evaluation Protocols and Open Problems for General Agents”.</p>
<p>Specifically, the following preprocess stages applies to the atari environment:</p>
<ulclass="simple">
<li><p>Noop Reset: Obtains the initial state by taking a random number of no-ops on reset, default max 30 no-ops.</p></li>
<li><p>Frame skipping: The number of frames skipped between steps, 4 by default</p></li>
<li><p>Max-pooling: Pools over the most recent two observations from the frame skips</p></li>
<li><dlclass="simple">
<dt>Termination signal when a life is lost: When the agent losses a life during the environment, then the environment is terminated.</dt><dd><p>Turned off by default. Not recommended by Machado et al. (2018).</p>
</dd>
</dl>
</li>
<li><p>Resize to a square image: Resizes the atari environment original observation shape from 210x180 to 84x84 by default</p></li>
<li><p>Grayscale observation: If the observation is colour or greyscale, by default, greyscale.</p></li>
<li><p>Scale observation: If to scale the observation between [0, 1) or [0, 255), by default, not scaled.</p></li>
<li><p><strong>env</strong> (<aclass="reference internal"href="../../env/#gymnasium.Env"title="gymnasium.Env"><em>Env</em></a>) – The environment to apply the preprocessing</p></li>
<li><p><strong>noop_max</strong> (<em>int</em>) – For No-op reset, the max number no-ops actions are taken at reset, to turn off, set to 0.</p></li>
<li><p><strong>frame_skip</strong> (<em>int</em>) – The number of frames between new observation the agents observations effecting the frequency at which the agent experiences the game.</p></li>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">gymnasium.wrappers.</span></span><spanclass="sig-name descname"><spanclass="pre">AutoResetWrapper</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">env</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="../../env/#gymnasium.Env"title="gymnasium.core.Env"><spanclass="pre">Env</span></a></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#gymnasium.wrappers.AutoResetWrapper"title="Permalink to this definition">#</a></dt>
<dd><p>A class for providing an automatic reset functionality for gymnasium environments when calling <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">self.step()</span></code>.</p>
<p>When calling step causes <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">Env.step()</span></code> to return <cite>terminated=True</cite> or <cite>truncated=True</cite>, <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">Env.reset()</span></code> is called,
and the return format of <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">self.step()</span></code> is as follows: <codeclass="docutils literal notranslate"><spanclass="pre">(new_obs,</span><spanclass="pre">final_reward,</span><spanclass="pre">final_terminated,</span><spanclass="pre">final_truncated,</span><spanclass="pre">info)</span></code>
with new step API and <codeclass="docutils literal notranslate"><spanclass="pre">(new_obs,</span><spanclass="pre">final_reward,</span><spanclass="pre">final_done,</span><spanclass="pre">info)</span></code> with the old step API.</p>
<blockquote>
<div><ulclass="simple">
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">new_obs</span></code> is the first observation after calling <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">self.env.reset()</span></code></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">final_reward</span></code> is the reward after calling <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">self.env.step()</span></code>, prior to calling <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">self.env.reset()</span></code>.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">final_terminated</span></code> is the terminated value before calling <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">self.env.reset()</span></code>.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">final_truncated</span></code> is the truncated value before calling <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">self.env.reset()</span></code>. Both <cite>final_terminated</cite> and <cite>final_truncated</cite> cannot be False.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">info</span></code> is a dict containing all the keys from the info dict returned by the call to <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">self.env.reset()</span></code>,
with an additional key “final_observation” containing the observation returned by the last call to <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">self.env.step()</span></code>
and “final_info” containing the info dict returned by the last call to <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">self.env.step()</span></code>.</p></li>
</ul>
</div></blockquote>
<dlclass="simple">
<dt>Warning: When using this wrapper to collect rollouts, note that when <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">Env.step()</span></code> returns <cite>terminated</cite> or <cite>truncated</cite>, a</dt><dd><p>new observation from after calling <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">Env.reset()</span></code> is returned by <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">Env.step()</span></code> alongside the
final reward, terminated and truncated state from the previous episode.
If you need the final state from the previous episode, you need to retrieve it via the
“final_observation” key in the info dict.
Make sure you know what you’re doing if you use this wrapper!</p>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">gymnasium.wrappers.</span></span><spanclass="sig-name descname"><spanclass="pre">EnvCompatibility</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">old_env</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">LegacyEnv</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">render_mode</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">str</span><spanclass="w"></span><spanclass="p"><spanclass="pre">|</span></span><spanclass="w"></span><spanclass="pre">None</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#gymnasium.wrappers.EnvCompatibility"title="Permalink to this definition">#</a></dt>
<li><p><strong>old_env</strong> (<em>LegacyEnv</em>) – the env to wrap, implemented with the old API</p></li>
<li><p><strong>render_mode</strong> (<em>str</em>) – the render mode to use when rendering the environment, passed automatically to env.render</p></li>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">gymnasium.wrappers.</span></span><spanclass="sig-name descname"><spanclass="pre">StepAPICompatibility</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">env</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="../../env/#gymnasium.Env"title="gymnasium.core.Env"><spanclass="pre">Env</span></a></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">output_truncation_bool</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">bool</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">True</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#gymnasium.wrappers.StepAPICompatibility"title="Permalink to this definition">#</a></dt>
<dd><p>A wrapper which can transform an environment from new step API to old and vice-versa.</p>
<p>Old step API refers to step() method returning (observation, reward, done, info)
New step API refers to step() method returning (observation, reward, terminated, truncated, info)
<li><p><strong>env</strong> (<em>gym.Env</em>) – the env to wrap. Can be in old or new API</p></li>
<li><p><strong>output_truncation_bool</strong> (<em>bool</em>) – Whether the wrapper’s step method outputs two booleans (new API) or one boolean (old API)</p></li>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">gymnasium.wrappers.</span></span><spanclass="sig-name descname"><spanclass="pre">PassiveEnvChecker</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">env</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#gymnasium.wrappers.PassiveEnvChecker"title="Permalink to this definition">#</a></dt>
<dd><p>A passive environment checker wrapper that surrounds the step, reset and render functions to check they follow the gymnasium API.</p>
<p>Initialises the wrapper with the environments, run the observation and action space tests.</p>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">gymnasium.wrappers.</span></span><spanclass="sig-name descname"><spanclass="pre">HumanRendering</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">env</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#gymnasium.wrappers.HumanRendering"title="Permalink to this definition">#</a></dt>
<dd><p>Performs human rendering for an environment that only supports “rgb_array”rendering.</p>
<p>This wrapper is particularly useful when you have implemented an environment that can produce
RGB images but haven’t implemented any code to render the images to the screen.
If you want to use this wrapper with your environments, remember to specify <codeclass="docutils literal notranslate"><spanclass="pre">"render_fps"</span></code>
in the metadata of your environment.</p>
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">render_mode</span></code> of the wrapped environment must be either <codeclass="docutils literal notranslate"><spanclass="pre">'rgb_array'</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">'rgb_array_list'</span></code>.</p>
<spanclass="gp">>>></span><spanclass="n">obs</span><spanclass="p">,</span><spanclass="n">_</span><spanclass="o">=</span><spanclass="n">wrapped</span><spanclass="o">.</span><spanclass="n">reset</span><spanclass="p">()</span><spanclass="c1"># This will start rendering to the screen</span>
<p>The wrapper can also be applied directly when the environment is instantiated, simply by passing
<codeclass="docutils literal notranslate"><spanclass="pre">render_mode="human"</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">make</span></code>. The wrapper will only be applied if the environment does not
implement human-rendering natively (i.e. <codeclass="docutils literal notranslate"><spanclass="pre">render_mode</span></code> does not contain <codeclass="docutils literal notranslate"><spanclass="pre">"human"</span></code>).</p>
<spanclass="gp">>>></span><spanclass="n">obs</span><spanclass="p">,</span><spanclass="n">_</span><spanclass="o">=</span><spanclass="n">env</span><spanclass="o">.</span><spanclass="n">reset</span><spanclass="p">()</span><spanclass="c1"># This will start rendering to the screen</span>
<p>Warning: If the base environment uses <codeclass="docutils literal notranslate"><spanclass="pre">render_mode="rgb_array_list"</span></code>, its (i.e. the <em>base environment’s</em>) render method
<spanclass="gp">>>></span><spanclass="n">env</span><spanclass="o">.</span><spanclass="n">render</span><spanclass="p">()</span><spanclass="c1"># env.render() will always return an empty list!</span>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">gymnasium.wrappers.</span></span><spanclass="sig-name descname"><spanclass="pre">OrderEnforcing</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">env</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="../../env/#gymnasium.Env"title="gymnasium.core.Env"><spanclass="pre">Env</span></a></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">disable_render_order_enforcing</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">bool</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">False</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#gymnasium.wrappers.OrderEnforcing"title="Permalink to this definition">#</a></dt>
<dd><p>A wrapper that will produce an error if <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">step()</span></code> is called before an initial <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">reset()</span></code>.</p>
<spanclass="gr">gymnasium.error.ResetNeeded</span>: <spanclass="n">Cannot call `env.render()` before calling `env.reset()`, if this is a intended action, set `disable_render_order_enforcing=True` on the OrderEnforcer wrapper.</span>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">gymnasium.wrappers.</span></span><spanclass="sig-name descname"><spanclass="pre">RecordEpisodeStatistics</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">env</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="../../env/#gymnasium.Env"title="gymnasium.core.Env"><spanclass="pre">Env</span></a></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">deque_size</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">int</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">100</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#gymnasium.wrappers.RecordEpisodeStatistics"title="Permalink to this definition">#</a></dt>
<li><p><strong>return_queue</strong>– The cumulative rewards of the last <codeclass="docutils literal notranslate"><spanclass="pre">deque_size</span></code>-many episodes</p></li>
<li><p><strong>length_queue</strong>– The lengths of the last <codeclass="docutils literal notranslate"><spanclass="pre">deque_size</span></code>-many episodes</p></li>
<li><p><strong>env</strong> (<aclass="reference internal"href="../../env/#gymnasium.Env"title="gymnasium.Env"><em>Env</em></a>) – The environment to apply the wrapper</p></li>
<li><p><strong>deque_size</strong>– The size of the buffers <codeclass="xref py py-attr docutils literal notranslate"><spanclass="pre">return_queue</span></code> and <codeclass="xref py py-attr docutils literal notranslate"><spanclass="pre">length_queue</span></code></p></li>
<dd><p>This wrapper records videos of rollouts.</p>
<p>Usually, you only want to record episodes intermittently, say every hundredth episode.
To do this, you can specify <strong>either</strong><codeclass="docutils literal notranslate"><spanclass="pre">episode_trigger</span></code><strong>or</strong><codeclass="docutils literal notranslate"><spanclass="pre">step_trigger</span></code> (not both).
They should be functions returning a boolean that indicates whether a recording should be started at the
current episode or step, respectively.
If neither <codeclass="xref py py-attr docutils literal notranslate"><spanclass="pre">episode_trigger</span></code> nor <codeclass="docutils literal notranslate"><spanclass="pre">step_trigger</span></code> is passed, a default <codeclass="docutils literal notranslate"><spanclass="pre">episode_trigger</span></code> will be employed.
By default, the recording will be stopped once a <cite>terminated</cite> or <cite>truncated</cite> signal has been emitted by the environment. However, you can
also create recordings of fixed length (possibly spanning several episodes) by passing a strictly positive value for
<li><p><strong>env</strong>– The environment that will be wrapped</p></li>
<li><p><strong>video_folder</strong> (<em>str</em>) – The folder where the recordings will be stored</p></li>
<li><p><strong>episode_trigger</strong>– Function that accepts an integer and returns <codeclass="docutils literal notranslate"><spanclass="pre">True</span></code> iff a recording should be started at this episode</p></li>
<li><p><strong>step_trigger</strong>– Function that accepts an integer and returns <codeclass="docutils literal notranslate"><spanclass="pre">True</span></code> iff a recording should be started at this step</p></li>
<li><p><strong>video_length</strong> (<em>int</em>) – The length of recorded episodes. If 0, entire episodes are recorded.
Otherwise, snippets of the specified length are captured</p></li>
<li><p><strong>name_prefix</strong> (<em>str</em>) – Will be prepended to the filename of the recordings</p></li>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">gymnasium.wrappers.</span></span><spanclass="sig-name descname"><spanclass="pre">RenderCollection</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">env</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="../../env/#gymnasium.Env"title="gymnasium.core.Env"><spanclass="pre">Env</span></a></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">pop_frames</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">bool</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">True</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">reset_clean</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">bool</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">True</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#gymnasium.wrappers.RenderCollection"title="Permalink to this definition">#</a></dt>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">gymnasium.wrappers.</span></span><spanclass="sig-name descname"><spanclass="pre">TimeLimit</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">env</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="../../env/#gymnasium.Env"title="gymnasium.core.Env"><spanclass="pre">Env</span></a></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">max_episode_steps</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">int</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#gymnasium.wrappers.TimeLimit"title="Permalink to this definition">#</a></dt>
<li><p><strong>max_episode_steps</strong>– An optional max episode steps (if <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">env.spec.max_episode_steps</span></code> is used)</p></li>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">gymnasium.wrappers.</span></span><spanclass="sig-name descname"><spanclass="pre">VectorListInfo</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">env</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#gymnasium.wrappers.VectorListInfo"title="Permalink to this definition">#</a></dt>
<dd><p>Converts infos of vectorized environments from dict to List[dict].</p>
<p>This wrapper converts the info format of a
vector environment from a dictionary to a list of dictionaries.
This wrapper is intended to be used around vectorized
environments. If using other wrappers that perform
operation on info like <cite>RecordEpisodeStatistics</cite> this
<divclass="doctest highlight-default notranslate"><divclass="highlight"><pre><span></span><spanclass="gp">>>></span><spanclass="c1"># As dict:</span>
<spanclass="gp">... </span><spanclass="s2">"final_observation"</span><spanclass="p">:</span><spanclass="s2">"<array of length num-envs>"</span><spanclass="p">,</span>
<spanclass="gp">... </span><spanclass="s2">"_final_observation"</span><spanclass="p">:</span><spanclass="s2">"<boolean array of length num-envs>"</span><spanclass="p">,</span>
<spanclass="gp">... </span><spanclass="s2">"final_info"</span><spanclass="p">:</span><spanclass="s2">"<array of length num-envs>"</span><spanclass="p">,</span>
<spanclass="gp">... </span><spanclass="s2">"_final_info"</span><spanclass="p">:</span><spanclass="s2">"<boolean array of length num-envs>"</span><spanclass="p">,</span>
<spanclass="gp">... </span><spanclass="s2">"r"</span><spanclass="p">:</span><spanclass="s2">"<array of cumulative reward>"</span><spanclass="p">,</span>
<spanclass="gp">... </span><spanclass="s2">"l"</span><spanclass="p">:</span><spanclass="s2">"<array of episode length>"</span><spanclass="p">,</span>
<spanclass="gp">... </span><spanclass="s2">"t"</span><spanclass="p">:</span><spanclass="s2">"<array of elapsed time since beginning of episode>"</span>
<spanclass="gp">... </span><spanclass="s2">"episode"</span><spanclass="p">:</span><spanclass="p">{</span><spanclass="s2">"r"</span><spanclass="p">:</span><spanclass="s2">"<cumulative reward>"</span><spanclass="p">,</span><spanclass="s2">"l"</span><spanclass="p">:</span><spanclass="s2">"<episode length>"</span><spanclass="p">,</span><spanclass="s2">"t"</span><spanclass="p">:</span><spanclass="s2">"<elapsed time since beginning of episode>"</span><spanclass="p">},</span>
<ddclass="field-odd"><p><strong>env</strong> (<aclass="reference internal"href="../../env/#gymnasium.Env"title="gymnasium.Env"><em>Env</em></a>) – The environment to apply the wrapper</p>