gymDSM (Didactically Supercharged Mod): a small library that provides didactically enhanced OpenAI Gym environments (e.g., a MountainCar variant whose render color shows the last action).
Project description
gymDSM
gymDSM (Didactically Supercharged Mod): A modified version of OpenAI Gym.
What is gymDSM?
gymDSM is a small Python package that provides didactically enhanced (teaching-friendly) variants of classic OpenAI Gym environments.
MountainCar
At the moment, gymDSM focuses on MountainCar with a small (but important) visual modification: the car’s color reflects the last action taken:
0(push left) → red1(no push) → blue2(push right) → green
The goal is to make it easier to understand what an agent is doing while interacting with the environment.
Installation
The library gymDSM is on the Python Package Index.
To install the library, first install pip and then use the command pip install gymDSM. Alternatively, you can use pip install gymdsm. Remember that pip/PyPI treat distribution names case-insensitively.
This project is intended to work with Gym 0.22. You can install it with the command pip install gym==0.22.
On the other hand, if you want to use render(), you need to use the following installation command:
pip install gymDSM[render]
(The command above installs pygame as an optional dependency.)
Minimal Working Example (MWE)
1) Create the environment using gymDSM.make
This is designed to be easily replaceable with the usual Gym pattern:
import gymDSM as gymDSM
env = gymDSM.make("MountainCar-v0")
obs = env.reset()
done = False
while not done:
action = env.action_space.sample() # random policy
obs, reward, done, info = env.step(action)
env.close()
2) Render (optional)
import gymDSM as gymDSM
import time
env = gymDSM.make("MountainCar-v0")
obs = env.reset()
done = False
while not done:
env.render() # requires pygame
action = env.action_space.sample()
obs, reward, done, info = env.step(action)
time.sleep(0.02)
env.close()
Behavior and supported environments
For now, only the gym's Mountain Car environment is supported.
-
If you call:
env = gymDSM.make("MountainCar-v0")
gymDSM will try to create the gymDSM MountainCar variant (with action-based colors).
-
If
env_idis not supported by gymDSM, or if creating the gymDSM version fails for any reason,gymDSM.make(...)falls back to:gym.make(env_id, ...)
using the standard Gym environment.
License and Acknowledgments
gymDSM is an independent open-source project that originates from a fork of OpenAI Gym. This project is not affiliated with or endorsed by OpenAI. gymDSM is developed for research and educational purposes. It builds upon the foundation laid by the OpenAI Gym library, and we acknowledge and thank the original OpenAI Gym authors and contributors for their pioneering work.
Both gymDSM and the original OpenAI Gym are released under the MIT License. We have retained the original project's MIT licensing for gymDSM, ensuring that any use or distribution of this fork complies with the same terms. Please see the LICENSE file in this repository for the full text of the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gymdsm-1.0.0.tar.gz.
File metadata
- Download URL: gymdsm-1.0.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96a16b1171752db76aa62638a9a5c9f7d6575b92c8be67a7d72ba8c459f82fa6
|
|
| MD5 |
9f5381fe00b1b2c5c603adbdd712b89f
|
|
| BLAKE2b-256 |
59d52881080547a4d343a88255c55c206dde4b82db1e20ba9e655b3a4fc1ccfe
|
File details
Details for the file gymdsm-1.0.0-py3-none-any.whl.
File metadata
- Download URL: gymdsm-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
497fae98a5fc137540f19cbb9d836acc9eae8aad7e35050e719c2a935c5934a2
|
|
| MD5 |
51d85fb333f002bad60bac99b0d225f0
|
|
| BLAKE2b-256 |
644f81de36b43b84ae79fe3e87a124f30da8b72e14e03f1625913f8047b72535
|