Skip to main content

Plangym is an interface to use gymnasium for planning problems. It extends the standard interface to allow setting and recovering the environment states.

Project description

Welcome to Plangym

Documentation Status Code coverage PyPI package Code style: black license: MIT

Plangym is an open source Python library for developing and comparing planning algorithms by providing a standard API to communicate between algorithms and environments, as well as a standard set of environments compliant with that API.

Given that OpenAI's gym has become the de-facto standard in the research community, plangym's API is designed to be as similar as possible to gym's API while allowing to modify the environment state.

Furthermore, it provides additional functionality for stepping the environments in parallel, delayed environment initialization for dealing with environments that are difficult to serialize, compatibility with gym.Wrappers, and more.

Supported environments

Plangym currently supports all the following environments:

  • OpenAI gym classic control environments
  • OpenAI gym Box2D environments
  • OpenAI gym Atari 2600 environments
  • Deepmind's dm_control environments
  • Stable-retro environments

Getting started

Stepping an environment

import plangym
env = plangym.make(name="CartPole-v0")
state, obs, info = env.reset()

state = state.copy()
action = env.action_space.sample()

data = env.step(state=state, action=action)
new_state, observ, reward, end, truncated, info = data

Stepping a batch of states and actions

import plangym
env = plangym.make(name="CartPole-v0")
state, obs, info = env.reset()

states = [state.copy() for _ in range(10)]
actions = [env.action_space.sample() for _ in range(10)]

data = env.step_batch(states=states, actions=actions)
new_states, observs, rewards, ends, truncateds, infos = data

Using parallel steps

import plangym
env = plangym.make(name="MsPacman-v0", n_workers=2)

state, obs, info = env.reset()

states = [state.copy() for _ in range(10)]
actions = [env.action_space.sample() for _ in range(10)]

data =  env.step_batch(states=states, actions=actions)
new_states, observs, rewards, ends, truncateds, infos = data

Installation

TODO: Meanwhile take a look at how we set up the repository in .github/workflows/push.yaml.

License

Plangym is released under the MIT license.

Contributing

Contributions are very welcome! Please check the contributing guidelines before opening a pull request.

If you have any suggestions for improvement, or you want to report a bug please open an issue.

Installing nes-py

Step 1: Install necessary development tools and libraries

sudo apt-get update sudo apt-get install build-essential clang sudo apt-get install libstdc++-10-dev

Step 2: Verify the compiler and include paths

Ensure you are using g++ instead of clang++ if clang++ is not properly configured

export CXX=g++ export CC=gcc

Rebuild the project

rye install nes-py --git=https://github.com/FragileTech/nes-py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plangym-0.1.26.tar.gz (61.6 MB view details)

Uploaded Source

Built Distribution

plangym-0.1.26-py3-none-any.whl (65.1 kB view details)

Uploaded Python 3

File details

Details for the file plangym-0.1.26.tar.gz.

File metadata

  • Download URL: plangym-0.1.26.tar.gz
  • Upload date:
  • Size: 61.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for plangym-0.1.26.tar.gz
Algorithm Hash digest
SHA256 3e154ac83b709c64046c6692359e70e853605ea12db4a362d6ca7f311d131e44
MD5 9640866cc9a23fa291307b5bec84a946
BLAKE2b-256 521ec79d8d60650cfc0af3d1ab6e6f1d5e92a7fe4eb8fbab987a2d737a046570

See more details on using hashes here.

File details

Details for the file plangym-0.1.26-py3-none-any.whl.

File metadata

  • Download URL: plangym-0.1.26-py3-none-any.whl
  • Upload date:
  • Size: 65.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for plangym-0.1.26-py3-none-any.whl
Algorithm Hash digest
SHA256 d740c98b107c5b18fcaa7c28cb6733cac7db91bbd138fc789239f7cd7b81a053
MD5 119cbc3f9e6d5ea3667f15b855e0cdf6
BLAKE2b-256 e012a6a5cd6b06cc8636d778753d300cb64c9709d724d0ca54c38aaf875ead45

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page