2022-09-13 20:27:34 +01:00
|
|
|
---
|
2023-11-07 13:27:25 +00:00
|
|
|
title: Utility functions
|
2022-09-13 20:27:34 +01:00
|
|
|
---
|
|
|
|
|
2023-11-07 13:27:25 +00:00
|
|
|
# Utility functions
|
|
|
|
|
|
|
|
## Seeding
|
|
|
|
|
|
|
|
```{eval-rst}
|
|
|
|
.. autofunction:: gymnasium.utils.seeding.np_random
|
|
|
|
```
|
|
|
|
|
|
|
|
## Environment Checking
|
|
|
|
|
|
|
|
```{eval-rst}
|
|
|
|
.. autofunction:: gymnasium.utils.env_checker.check_env
|
|
|
|
```
|
2022-09-13 20:27:34 +01:00
|
|
|
|
|
|
|
## Visualization
|
|
|
|
|
|
|
|
```{eval-rst}
|
2022-10-12 15:58:01 +01:00
|
|
|
.. autofunction:: gymnasium.utils.play.play
|
2022-09-13 20:27:34 +01:00
|
|
|
.. autoclass:: gymnasium.utils.play.PlayPlot
|
2022-12-04 22:24:02 +08:00
|
|
|
|
2022-09-13 20:27:34 +01:00
|
|
|
.. automethod:: callback
|
|
|
|
|
2022-10-12 15:58:01 +01:00
|
|
|
.. autoclass:: gymnasium.utils.play.PlayableGame
|
2022-12-04 22:24:02 +08:00
|
|
|
|
2022-10-12 15:58:01 +01:00
|
|
|
.. automethod:: process_event
|
2022-09-13 20:27:34 +01:00
|
|
|
```
|
|
|
|
|
2023-11-07 13:27:25 +00:00
|
|
|
## Environment pickling
|
|
|
|
|
|
|
|
```{eval-rst}
|
|
|
|
.. autoclass:: gymnasium.utils.ezpickle.EzPickle
|
|
|
|
```
|
|
|
|
|
2022-09-13 20:27:34 +01:00
|
|
|
## Save Rendering Videos
|
|
|
|
|
|
|
|
```{eval-rst}
|
|
|
|
.. autofunction:: gymnasium.utils.save_video.save_video
|
2022-10-12 15:58:01 +01:00
|
|
|
.. autofunction:: gymnasium.utils.save_video.capped_cubic_video_schedule
|
2022-09-13 20:27:34 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
## Old to New Step API Compatibility
|
|
|
|
|
|
|
|
```{eval-rst}
|
2022-10-12 15:58:01 +01:00
|
|
|
.. autofunction:: gymnasium.utils.step_api_compatibility.step_api_compatibility
|
2022-09-13 20:27:34 +01:00
|
|
|
.. autofunction:: gymnasium.utils.step_api_compatibility.convert_to_terminated_truncated_step_api
|
|
|
|
.. autofunction:: gymnasium.utils.step_api_compatibility.convert_to_done_step_api
|
|
|
|
```
|
2024-03-27 11:18:44 +00:00
|
|
|
|
|
|
|
## Runtime Performance benchmark
|
|
|
|
Sometimes is neccary to measure your environment's runtime performance, and ensure no performance regressions take place.
|
|
|
|
These tests require manual inspection of its outputs:
|
|
|
|
|
|
|
|
```{eval-rst}
|
|
|
|
.. autofunction:: gymnasium.utils.performance.benchmark_step
|
|
|
|
.. autofunction:: gymnasium.utils.performance.benchmark_init
|
|
|
|
.. autofunction:: gymnasium.utils.performance.benchmark_render
|
|
|
|
```
|