Skip to main content

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) → red
  • 1 (no push) → blue
  • 2 (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_id is 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.

Metadata

Release files for gymDSM 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gymDSM 1.0.0
File Size Uploaded
gymdsm-1.0.0.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gymDSM 1.0.0
File Interpreter ABI Platform
gymdsm-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.1 kB

Release files / gymdsm-1.0.0.tar.gz

Download URL gymdsm-1.0.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
96a16b1171752db76aa62638a9a5c9f7d6575b92c8be67a7d72ba8c459f82fa6
BLAKE2b-256 checksum
How to use checksums
59d52881080547a4d343a88255c55c206dde4b82db1e20ba9e655b3a4fc1ccfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / gymdsm-1.0.0-py3-none-any.whl

Download URL gymdsm-1.0.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
497fae98a5fc137540f19cbb9d836acc9eae8aad7e35050e719c2a935c5934a2
BLAKE2b-256 checksum
How to use checksums
644f81de36b43b84ae79fe3e87a124f30da8b72e14e03f1625913f8047b72535
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page