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
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
Release history Release notifications | RSS feed
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.9.tar.gz
(52.9 kB
view details)
Built Distribution
plangym-0.0.9-py3-none-any.whl
(70.4 kB
view details)
File details
Details for the file plangym-0.0.9.tar.gz
.
File metadata
- Download URL: plangym-0.0.9.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d97a045a9b5dde22f005f6fe15efa092e7748d08a8667877f2641cdd92a3d7f |
|
MD5 | d3dc34aa80f57c0c0b8dc595e2074805 |
|
BLAKE2b-256 | 210c4cafe91a0975361333940339acaaa683fab5fc423fda3351e0aa812f5838 |
File details
Details for the file plangym-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: plangym-0.0.9-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52a992898c45607143eff555adb02250faaa3ef5066c5006a7cd0b2d556ecd2a |
|
MD5 | e7b7907d18fea83f992b6f01569c068a |
|
BLAKE2b-256 | b2407e77fc9acbb5f793795db7121b456d5e1b0421c44047495c524540686445 |