Skip to content

Commit

Permalink
Small docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
eleurent committed Dec 8, 2024
1 parent f4a4989 commit 3e2359d
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ environments/racetrack
The {ref}`observations <observations>`, {ref}`actions <actions>`, {ref}`dynamics <dynamics>` and {ref}`rewards <rewards>`
of an environment are parametrized by a configuration, defined as a
{py:attr}`~highway_env.envs.common.abstract.AbstractEnv.config` dictionary.

For example, the number of lanes can be changed with:


```{eval-rst}
.. jupyter-execute::
env = gymnasium.make(
"highway-v0",
config={"lanes_count": 2}
)
```

After environment creation, the configuration can be accessed using the
{py:attr}`~highway_env.envs.common.abstract.AbstractEnv.config` attribute.

Expand All @@ -54,32 +67,21 @@ After environment creation, the configuration can be accessed using the
import pprint
env = gymnasium.make("highway-v0", render_mode='rgb_array')
pprint.pprint(env.unwrapped.config)
```

For example, the number of lanes can be changed with:
The config can also be changed after creation


```{eval-rst}
.. jupyter-execute::
env = gymnasium.make("highway-v0", render_mode='rgb_array')
env.unwrapped.config["lanes_count"] = 2
env.reset()
plt.imshow(env.render())
plt.show()
```

or directly at creation time with:

```{eval-rst}
.. jupyter-execute::
env = gymnasium.make(
"highway-v0",
render_mode='rgb_array',
config={"lanes_count": 2}
)
```

```{note}
The environment must be {py:meth}`~highway_env.envs.common.abstract.AbstractEnv.reset` for the change of configuration
Expand Down

0 comments on commit 3e2359d

Please sign in to comment.