Wrappers#
The Wrapper
interface is used for extending Jumanji Environment
to add features like auto reset
and vectorised environments. Jumanji provides wrappers to convert a Jumanji Environment
to a
DeepMind or Gym environment.
Jumanji to DeepMind Environment#
We can also convert our Jumanji environments to a DeepMind environment:
1 2 3 4 5 6 7 8 9 |
|
Jumanji To Gym#
We can also convert our Jumanji environments to a Gym environment! Below is an example of how to convert a Jumanji environment into a Gym environment.
1 2 3 4 5 6 7 8 9 |
|
Auto-reset an Environment#
Below is an example of how to extend the functionality of the Snake environment to automatically
reset whenever the environment reaches a terminal state. The Snake game terminates when the snake
hits the wall, using the AutoResetWrapper
the environment will be reset once a terminal state has
been reached.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Last update:
2024-11-01