Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recreate RL interface #2

Open
WillieCubed opened this issue Jan 5, 2021 · 0 comments
Open

Recreate RL interface #2

WillieCubed opened this issue Jan 5, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@WillieCubed
Copy link
Member

Overview

The baselines currently rely on a low-level socket to handle communication and send commands. As more complex RL models are developed using this library, such communication with the game client should be abstracted into an interface like one popularized by OpenAI's Gym.

Implementation

The PolycraftEnv should support the following functions:

  • reset
    • Prepares the client for a new experiment
  • step
    • Sends an action to the client and receives an observation
  • close
    • Shuts down the client

Additionally, the game should be initialized when the constructor is called. The environment should support the following workflow:

from polycraft_env import setup_env

env = setup_env()
observation = env.reset()
for episode in range(10):
    action = 'SENSE_ALL'
    observation, reward, done, info = env.step(action)
env.close()

And for convenience it should support context manager functionality:

from polycraft_env import setup_env

with setup_env() as env:
    for episode in range(10):
        action = 'SENSE_ALL'
        observation, reward, done, info = env.step(action)
@WillieCubed WillieCubed added the enhancement New feature or request label Jan 5, 2021
@WillieCubed WillieCubed self-assigned this Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant