Skip to content

Commit

Permalink
Deploying to gh-pages from @ 3eab78b 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
eleurent committed Dec 8, 2024
1 parent cb44126 commit 924d158
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 52 deletions.
Binary file modified main/_images/index_1_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified main/_images/index_2_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified main/_images/index_2_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified main/_images/index_2_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified main/_images/index_3_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified main/_images/multi_agent_0_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified main/_images/multi_agent_1_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified main/_images/quickstart_0_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added main/_images/quickstart_1_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions main/multi_agent/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,11 @@ <h2>Change the observation space<a class="headerlink" href="#change-the-observat
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-none notranslate"><div class="highlight"><pre><span></span>(array([[ 1. , 0.89726937, 0. , 0.3125 , 0. ],
[ 1. , 0.10234839, 0.75 , -0.01562341, 0. ],
[ 1. , 0.20264469, 0. , -0.04974489, 0. ],
[ 1. , 0.30728498, 0. , -0.02766261, 0. ],
[ 1. , 0.4156653 , 0.75 , -0.01946728, 0. ]],
<div class="output stream highlight-none notranslate"><div class="highlight"><pre><span></span>(array([[ 1. , 0.8996421 , 0.5 , 0.3125 , 0. ],
[ 1. , 0.10610674, -0.25 , -0.02496706, 0. ],
[ 1. , 0.21663845, -0.5 , -0.01358112, 0. ],
[ 1. , 0.33168566, 0.25 , -0.02108839, 0. ],
[ 1. , 0.42837486, 0. , -0.0485089 , 0. ]],
dtype=float32),)
</pre></div>
</div>
Expand Down
18 changes: 9 additions & 9 deletions main/observations/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -560,23 +560,23 @@ <h3>Example configuration<a class="headerlink" href="#example-configuration" tit
<div class="cell_output docutils container">
<div class="output stream highlight-none notranslate"><div class="highlight"><pre><span></span>[[ 1. 1. 0.08 1. 0. 1.
0. ]
[ 1. 0.21897048 0.04 -0.18845703 0. 1.
[ 1. 0.19339375 -0.08 -0.10856369 0. 1.
0. ]
[ 1. 0.41426247 0. -0.12045569 0. 1.
[ 1. 0.3882512 0.04 -0.14759399 0. 1.
0. ]
[ 1. 0.6127969 -0.08 -0.1973714 0. 1.
[ 1. 0.58959484 -0.04 -0.10062475 0. 1.
0. ]
[ 1. 0.84082603 0. -0.07387763 0. 1.
[ 1. 0.79629916 0.04 -0.12792489 0. 1.
0. ]
[ 1. 1. -0.08 -0.16941962 0. 1.
[ 1. 1. -0.08 -0.09218342 0. 1.
0. ]
[ 1. 1. -0.08 -0.18702331 0. 1.
[ 1. 1. -0.08 -0.16161428 0. 1.
0. ]
[ 1. 1. 0. -0.08220994 0. 1.
[ 1. 1. 0.04 -0.13337924 0. 1.
0. ]
[ 1. 1. -0.08 -0.05029499 0. 1.
[ 1. 1. 0. -0.12700984 0. 1.
0. ]
[ 1. 1. 0.04 -0.19899715 0. 1.
[ 1. 1. 0.04 -0.16464195 0. 1.
0. ]
[ 0. 0. 0. 0. 0. 0.
0. ]
Expand Down
58 changes: 21 additions & 37 deletions main/quickstart/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,14 +338,31 @@ <h3>All the environments<a class="headerlink" href="#all-the-environments" title
<span id="configuration"></span><h2>Configuring an environment<a class="headerlink" href="#configuring-an-environment" title="Link to this heading"></a></h2>
<p>The <a class="reference internal" href="../observations/#id1"><span class="std std-ref">observations</span></a>, <a class="reference internal" href="../actions/#actions"><span class="std std-ref">actions</span></a>, <a class="reference internal" href="../dynamics/#dynamics"><span class="std std-ref">dynamics</span></a> and <a class="reference internal" href="../rewards/#rewards"><span class="std std-ref">rewards</span></a>
of an environment are parametrized by a configuration, defined as a
<code class="xref py py-attr docutils literal notranslate"><span class="pre">config</span></code> dictionary.
After environment creation, the configuration can be accessed using the
<code class="xref py py-attr docutils literal notranslate"><span class="pre">config</span></code> dictionary.</p>
<p>For example, the number of lanes can be changed with:</p>
<div class="jupyter_cell jupyter_container docutils container">
<div class="cell_input code_cell docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">env</span> <span class="o">=</span> <span class="n">gymnasium</span><span class="o">.</span><span class="n">make</span><span class="p">(</span>
<span class="s2">&quot;highway-v0&quot;</span><span class="p">,</span>
<span class="n">config</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;lanes_count&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">},</span>
<span class="n">render_mode</span><span class="o">=</span><span class="s1">&#39;rgb_array&#39;</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">env</span><span class="o">.</span><span class="n">reset</span><span class="p">()</span>
<span class="n">plt</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="n">env</span><span class="o">.</span><span class="n">render</span><span class="p">())</span>
<span class="n">plt</span><span class="o">.</span><span class="n">show</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<img alt="../_images/quickstart_1_0.png" src="../_images/quickstart_1_0.png" />
</div>
</div>
<p>After environment creation, the configuration can be accessed using the
<code class="xref py py-attr docutils literal notranslate"><span class="pre">config</span></code> attribute.</p>
<div class="jupyter_cell jupyter_container docutils container">
<div class="cell_input code_cell docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">pprint</span>

<span class="n">env</span> <span class="o">=</span> <span class="n">gymnasium</span><span class="o">.</span><span class="n">make</span><span class="p">(</span><span class="s2">&quot;highway-v0&quot;</span><span class="p">,</span> <span class="n">render_mode</span><span class="o">=</span><span class="s1">&#39;rgb_array&#39;</span><span class="p">)</span>
<span class="n">pprint</span><span class="o">.</span><span class="n">pprint</span><span class="p">(</span><span class="n">env</span><span class="o">.</span><span class="n">unwrapped</span><span class="o">.</span><span class="n">config</span><span class="p">)</span>
</pre></div>
</div>
Expand All @@ -360,7 +377,7 @@ <h3>All the environments<a class="headerlink" href="#all-the-environments" title
&#39;high_speed_reward&#39;: 0.4,
&#39;initial_lane_id&#39;: None,
&#39;lane_change_reward&#39;: 0,
&#39;lanes_count&#39;: 4,
&#39;lanes_count&#39;: 2,
&#39;manual_control&#39;: False,
&#39;normalize_reward&#39;: True,
&#39;observation&#39;: {&#39;type&#39;: &#39;Kinematics&#39;},
Expand All @@ -383,39 +400,6 @@ <h3>All the environments<a class="headerlink" href="#all-the-environments" title
</div>
</div>
</div>
<p>For example, the number of lanes can be changed with:</p>
<div class="jupyter_cell jupyter_container docutils container">
<div class="cell_input code_cell docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">env</span><span class="o">.</span><span class="n">unwrapped</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">&quot;lanes_count&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="mi">2</span>
<span class="n">env</span><span class="o">.</span><span class="n">reset</span><span class="p">()</span>
<span class="n">plt</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="n">env</span><span class="o">.</span><span class="n">render</span><span class="p">())</span>
<span class="n">plt</span><span class="o">.</span><span class="n">show</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<img alt="../_images/quickstart_2_0.png" src="../_images/quickstart_2_0.png" />
</div>
</div>
<p>or directly at creation time with:</p>
<div class="jupyter_cell jupyter_container docutils container">
<div class="cell_input code_cell docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">env</span> <span class="o">=</span> <span class="n">gymnasium</span><span class="o">.</span><span class="n">make</span><span class="p">(</span>
<span class="s2">&quot;highway-v0&quot;</span><span class="p">,</span>
<span class="n">render_mode</span><span class="o">=</span><span class="s1">&#39;rgb_array&#39;</span><span class="p">,</span>
<span class="n">config</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;lanes_count&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">}</span>
<span class="p">)</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
</div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The environment must be <a class="reference internal" href="../make_your_own/#highway_env.envs.common.abstract.AbstractEnv.reset" title="highway_env.envs.common.abstract.AbstractEnv.reset"><code class="xref py py-meth docutils literal notranslate"><span class="pre">reset()</span></code></a> for the change of configuration
to be effective.</p>
</div>
</section>
<section id="training-an-agent">
<h2>Training an agent<a class="headerlink" href="#training-an-agent" title="Link to this heading"></a></h2>
Expand Down
2 changes: 1 addition & 1 deletion main/searchindex.js

Large diffs are not rendered by default.

0 comments on commit 924d158

Please sign in to comment.