Skip to main content

Open AI Gym to play 1v1 Catan against a random bot

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().

import random
import gym

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()

For action documentation see here.

For observation documentation see here.

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

catanatron_gym-3.0.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file catanatron_gym-3.0.1.tar.gz.

File metadata

  • Download URL: catanatron_gym-3.0.1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for catanatron_gym-3.0.1.tar.gz
Algorithm Hash digest
SHA256 a1fcfaec804c7cb87b878645beaf5dba6eae2be28f599b57b6ed3a4af53b59f9
MD5 3b7890bf4463ea089fc636469199f346
BLAKE2b-256 1758c96c0c7a60e125584ace5f6f59f309f56ddb2c02d0495babc2e4efabd7ec

See more details on using hashes here.

File details

Details for the file catanatron_gym-3.0.1-py3-none-any.whl.

File metadata

  • Download URL: catanatron_gym-3.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for catanatron_gym-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 490e89279a5350d407c425bcf6948514782078cf73614fa6f8868b2fe47e1345
MD5 d8d627ddc3bd03f850ff2b076b00c97f
BLAKE2b-256 8fc88b4f94b564111cdbac975a1b0880c838e867dfe3810b1e955a9fbb3d7e33

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page