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

Uploaded Source

Built Distribution

plangym-0.0.10-py3-none-any.whl (70.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for plangym-0.0.10.tar.gz
Algorithm Hash digest
SHA256 6ade8af19ace5395f97d2e311b92ed57472998c81c2ee8abfba9e78e602f8cc1
MD5 6a0e35c14baf66b78ffd98d8ffa71c55
BLAKE2b-256 070d542f61fa14e5829436d7e257efa40f8eeecad7b785b42a23d38c0075f6de

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for plangym-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 997b63ec126ccdfa534b6b78296d3d382a47d298f85efde4df2216320da126ce
MD5 a96bd2647951d2062e20f10c6cc3cdd8
BLAKE2b-256 78140ebc1e902abedb682dcd8199fe0698e34b095b5277a08fddfb93c346c40e

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