Skip to main content

Catan OpenAI Gym

Project description

catanatron_gym

For reinforcement learning purposes, we provide an Open AI Gym to play 1v1 Catan against a random bot environment. To use:

pip install catanatron_gym

Make your training loop, ensuring to respect env.get_valid_actions().

env = gym.make("catanatron_gym:catanatron-v0")
observation = env.reset()
for _ in range(1000):
  action = random.choice(env.get_valid_actions()) # your agent here (this takes random actions)

  observation, reward, done, info = env.step(action)
  if done:
      observation = env.reset()
env.close()

You can access env.game.state and build your own "observation" (features) vector as well.

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

catanatron_gym-1.0.1.tar.gz (34.4 kB view hashes)

Uploaded Source

Built Distribution

catanatron_gym-1.0.1-py3-none-any.whl (47.5 kB view hashes)

Uploaded Python 3

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