Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

[WIP] Feature/step open ai gym#110

Draft
radka-j wants to merge 20 commits intomasterfrom
feature/step-openAI-gym
Draft

[WIP] Feature/step open ai gym#110
radka-j wants to merge 20 commits intomasterfrom
feature/step-openAI-gym

Conversation

@radka-j
Copy link
Contributor

@radka-j radka-j commented Apr 10, 2020

Integrate PyDodo with OpenAI gym.

Closes alan-turing-institute/nats#151

radka-j and others added 20 commits February 27, 2020 16:50
Directory structure following layout defined in:
https://medium.com/@apoddar573/making-your-own-custom-environment-in-gym-c3b65ff8cdaa

PyDodo/
├── ...
├── pydodo
│   ├── ...
├── README.md
├── birdhouse
│   ├── __init__.py
│   └── envs
│       ├── __init__.py
│       └── birdhouse.py
├── requirements.txt
└── setup.py

Adding query to test for pydodo interaction in:
    new file:   birdhouse/envs/birdhouse.py

+import pydodo as dodo
+            print(dodo.all_positions().values)

This shows that one can sample an action and query pydodo as well

Example code:

>>> import gym
>>> import birdhouse
>>> env = gym.make('birdhouse-v0')
>>> for _ in range(100):
...     env.step(env.action_space.sample())
...

REF:
    - http://gym.openai.com/docs/#environments
    - https://medium.com/@apoddar573/making-your-own-custom-environment-in-gym-c3b65ff8cdaa

	new file:   birdhouse/__init__.py
	new file:   birdhouse/envs/__init__.py
	new file:   birdhouse/envs/birdhouse.py
	modified:   setup.py
Minor modification to suppress warning:
    dodo/PyDodo/pydodo/utils.py:35

Warning Message:
    SyntaxWarning: assertion is always true, perhaps remove parentheses?
      assert (

	modified:   pydodo/utils.py
	modified:   birdhouse/__init__.py
	modified:   birdhouse/envs/__init__.py
SimughEnv originally defined in:

    PyDodo/pydodo/env.py

BirdhouseEnv originally defined in:

    nats-birdhouse:nats/issue/79/openai

Example code to run episodes:

$ pip install -e PyDodo && python
>>> import gym
>>> import birdhouse
>>> env = gym.make('birdhouse-v1')
>>> for _ in range(10):
...     env.step(env.action_space.sample())
...

    modified:   birdhouse/envs/birdhouse.py
	modified:   birdhouse/envs/birdhouse.py
Incorporate a simple step through with rule based steps.

Do not reset simulation.
	modified:   PyDodo/birdhouse/envs/birdhouse.py
	modified:   PyDodo/setup.py
environment now implemented in birdhouse, which makes this a duplicate
get config from the master not develop branch (this was a short term hack
this is an example use of the gym env that is now implemented in the Simurgh example notebook
reflect change in env name
@radka-j radka-j changed the title Feature/step open ai gym [WIP] Feature/step open ai gym Apr 10, 2020
@radka-j radka-j marked this pull request as draft July 14, 2021 15:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants