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)
Built Distribution
Close
Hashes for catanatron_gym-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf7c76daefb7fb315ac3af02659d0d5ecd07e681b9074cc96f62ff2e2679455c |
|
MD5 | db8a6659f10821e23ff94eb6987c1f09 |
|
BLAKE2b-256 | 61f6a866f682c7f74dc9b58234f189f15894b9f52abb22494e7a8c01f9e5b80d |