Skip to main content

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

Project description

Plan gym

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

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

Furthermore, it provides functionality for stepping the environments in parallel, and it is compatible with passing the parameters as vectors of steps and actions.

Getting started

Stepping a batch of states and actions

from plangym import AtariEnvironment
env = AtariEnvironment(name="MsPacman-v0",
                       clone_seeds=True, autoreset=True)
state, obs = 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, infos = data

Using parallel steps

from plangym import AtariEnvironment, ParallelEnvironment
env = ParallelEnvironment(env_class=AtariEnvironment,
                          name="MsPacman-v0",
                          clone_seeds=True, autoreset=True,
                          blocking=False)

state, obs = 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, infos = data

Installation

bash pip3 install plangym

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.0.14.tar.gz (66.2 kB view details)

Uploaded Source

Built Distribution

plangym-0.0.14-py3-none-any.whl (86.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: plangym-0.0.14.tar.gz
  • Upload date:
  • Size: 66.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for plangym-0.0.14.tar.gz
Algorithm Hash digest
SHA256 d869e498c351b23f14842ea92e892d5d53bbd11123917f32e9a0c7c8394aaf53
MD5 7a93c2d03643d88b5a43726414bd61c6
BLAKE2b-256 05467f64e65817f52786153fd1f9e165ded76d735dc704896220d1c821b8f99f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plangym-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 86.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for plangym-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 48a0dbd9dbcebf56f5f01fb64451f5e12fc94c3eb65dafed2eb39b74242aec99
MD5 2cb915b0d3b26b39454e399d4018c43d
BLAKE2b-256 22f8457f7d0f94e7bd72d6a4cc0d3358ce741ce70f118ab5a3d4f422468ae484

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