Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
eleurent committed Dec 8, 2024
1 parent 3e2359d commit 3eab78b
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ For example, the number of lanes can be changed with:
env = gymnasium.make(
"highway-v0",
config={"lanes_count": 2}
config={"lanes_count": 2},
render_mode='rgb_array',
)
env.reset()
plt.imshow(env.render())
plt.show()
```

After environment creation, the configuration can be accessed using the
Expand All @@ -70,24 +74,6 @@ After environment creation, the configuration can be accessed using the
pprint.pprint(env.unwrapped.config)
```

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()
```


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

## Training an agent

Reinforcement Learning agents can be trained using libraries such as [eleurent/rl-agents](https://github.com/eleurent/rl-agents),
Expand Down

0 comments on commit 3eab78b

Please sign in to comment.