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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: catanatron_gym-1.0.1.tar.gz
  • Upload date:
  • Size: 34.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for catanatron_gym-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9da65e3ed444190f3f0b4b9e81406494b8aa4d454f86244d9a139701d58cee24
MD5 f1a27110dab23762bf31adaec70d2fa2
BLAKE2b-256 b3be2f9d1b82491a334f57e407ba269e75838fe74f5b3bb936a353afbbca1478

See more details on using hashes here.

File details

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

File metadata

  • Download URL: catanatron_gym-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 47.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for catanatron_gym-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bf7c76daefb7fb315ac3af02659d0d5ecd07e681b9074cc96f62ff2e2679455c
MD5 db8a6659f10821e23ff94eb6987c1f09
BLAKE2b-256 61f6a866f682c7f74dc9b58234f189f15894b9f52abb22494e7a8c01f9e5b80d

See more details on using hashes here.

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