Gymnasium Interface
pip install -e .[gym]import random
import gymnasium
import catanatron.gym
env = gymnasium.make("catanatron/Catanatron-v0")
observation, info = env.reset()
for _ in range(1000):
# your agent here (this takes random actions)
action = random.choice(info["valid_actions"])
observation, reward, terminated, truncated, info = env.step(action)
done = terminated or truncated
if done:
observation, info = env.reset()
env.close()Stable-Baselines3 Example
Configuration
Last updated