Spaces:
Running
Running
A newer version of the Gradio SDK is available:
5.42.0
Scripts Folder
This directory contains various top-level scripts for running, training, and evaluating games.
Contents
simulate.py
- Allows one to play one or more matches of an OpenSpiel game with various agent types (human, random_bot, llm, or trained agents).
- Uses a config dict to specify the environment, agent types, number of rounds, and so on.
- The
config
object is loaded fromconfigs.py
or can be replaced by a custom config in code. - Usage example:
python simulate.py --game tic_tac_toe --rounds 5 --player-types human random_bot
configs.py
- Contains predefined config dictionaries that specify the scenario. For instance,
default_simulation_config()
sets up tic-tac-toe with 5 rounds, a seed of 42, and 2 players. - One can create more advanced configs (like
advanced_config()
) for different games or scenarios.
train.py
- Stub for training an RL agent.
evaluate.py
- For systematically evaluating a trained agent across multiple episodes, seeds, or opponent types. Produces final metrics and logs.
run_experiment.py
- Orchestrates multi-run experiments, hyperparameter sweeps, or repeated simulations with different seeds.
Typical Usage
- To play or test the environment with a mix of agents, run:
python simulate.py \ --game tic_tac_toe \ --rounds 3 \ --player-types human random_bot