How till75/rlcheckers works
RLCheckers is a reproducible 5×5 checkers reinforcement-learning experiment. Users invoke the CLI to play a seeded random game, evaluate agents, train a Q-table, or run the three-seed gate. Those workflows depend on immutable board, move, and game-state rules; agents provide random, greedy, and Q-table play. Training supports fixed-random-opponent Q-learning and self-play against frozen snapshots, while evaluation runs seeded matchups, computes metrics, and writes artifacts. Edges reflect shown imports, documented behavior, or the CLI excerpt; several implementation details are unsampled, so uncertain wiring is omitted.
Main entry points: state.py Game state · gate.py Three-seed gate · cli.py CLI commands · arena.py Match arena
Components 16
Game rules
- Board encoding
src/rlcheckers/game/board.py - Legal moves
src/rlcheckers/game/moves.py - Game state
src/rlcheckers/game/state.py
Playing agents
- Agent protocol
src/rlcheckers/agents/protocol.py - Random agent
src/rlcheckers/agents/random_agent.py - Greedy agent
src/rlcheckers/agents/greedy_agent.py - Q-table agent
src/rlcheckers/agents/q_agent.py
Training
- Fixed-opponent Q-learning
src/rlcheckers/training/train_q.py - Snapshot self-play
src/rlcheckers/training/self_play.py
Evaluation
- Match arena
src/rlcheckers/evaluation/arena.py - Score metrics
src/rlcheckers/evaluation/metrics.py - Evaluation artifacts
src/rlcheckers/evaluation/artifacts.py - Three-seed gate
src/rlcheckers/evaluation/gate.py
Command interface
- CLI commands
src/rlcheckers/cli.py - Config validation
src/rlcheckers/config.py
Other components
- Experimenter
Connections 28
- Experimenter → CLI commands: runs commands
README.md - CLI commands → Config validation: loads settings
src/rlcheckers/cli.py - CLI commands → Match arena: runs matchups
src/rlcheckers/cli.py - CLI commands → Fixed-opponent Q-learning: starts training
src/rlcheckers/cli.py - CLI commands → Snapshot self-play: dispatches self-play
src/rlcheckers/cli.py - CLI commands → Three-seed gate: runs gate
src/rlcheckers/cli.py - Board encoding → Legal moves: supplies board
src/rlcheckers/game/moves.py - Board encoding → Game state: wrapped by
src/rlcheckers/game/state.py - Legal moves → Game state: applied by
src/rlcheckers/game/state.py - Game state → Agent protocol: agent input
src/rlcheckers/agents/protocol.py - Game state → Random agent: chooses moves from
src/rlcheckers/agents/random_agent.py - Game state → Greedy agent: evaluated by
src/rlcheckers/agents/greedy_agent.py - Game state → Q-table agent: valued by
src/rlcheckers/agents/q_agent.py - Game state → Fixed-opponent Q-learning: training state
src/rlcheckers/training/train_q.py - Game state → Snapshot self-play: training state
src/rlcheckers/training/self_play.py - Fixed-opponent Q-learning → Q-table agent: updates Q-table
src/rlcheckers/training/train_q.py - Snapshot self-play → Q-table agent: freezes snapshots
src/rlcheckers/training/self_play.py - Match arena → Agent protocol: requests moves
src/rlcheckers/evaluation/arena.py - Match arena → Game state: plays games
src/rlcheckers/evaluation/arena.py - Score metrics → Match arena: summarizes results
src/rlcheckers/evaluation/metrics.py - Evaluation artifacts → Match arena: writes matchup data
src/rlcheckers/evaluation/artifacts.py - Evaluation artifacts → Score metrics: writes summaries
src/rlcheckers/evaluation/artifacts.py - Three-seed gate → Snapshot self-play: trains seeds
src/rlcheckers/evaluation/gate.py - Three-seed gate → Match arena: evaluates matchups
src/rlcheckers/evaluation/gate.py - Three-seed gate → Score metrics: aggregates scores
src/rlcheckers/evaluation/gate.py - Three-seed gate → Greedy agent: tests baseline
src/rlcheckers/evaluation/gate.py - Three-seed gate → Random agent: tests baseline
src/rlcheckers/evaluation/gate.py - Three-seed gate → Q-table agent: evaluates learned agent
src/rlcheckers/evaluation/gate.py