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

Uploaded Source

Built Distribution

plangym-0.0.15-py3-none-any.whl (59.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: plangym-0.0.15.tar.gz
  • Upload date:
  • Size: 48.6 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.15.tar.gz
Algorithm Hash digest
SHA256 7950907966542e3bdd18ac88ba8d38512b48f61d5eec2fb3e2c05ae95eb76ab0
MD5 afdfb061baa466085a5abf59e827d4b5
BLAKE2b-256 616bba655ddf0c8ea61b5a07f4ce0b4015b3c59b55f3bfd7b291b76ba87575bf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plangym-0.0.15-py3-none-any.whl
  • Upload date:
  • Size: 59.3 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.15-py3-none-any.whl
Algorithm Hash digest
SHA256 3b3902724ae3942120502c975b21a626d95ab582580a1b82bd74a7398390b488
MD5 1c8d609150b86170405f01111da46c81
BLAKE2b-256 a29994eee467b661d10d9e166ef06d30c6f9e3b0474a3f39696c5531d371b0f4

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