How lackio-el-14/proyecto-inteligencia-artifical---juego-snake works
This is a Snake-game reinforcement-learning project: users train a Double DQN agent across four level definitions, evaluate saved weights, and inspect play in a pygame viewer. The game environment owns movement, collisions, rewards, and episode outcomes; state construction supplies BFS-based sensors to learned and baseline policies. Training also records metrics and periodically evaluates the learner. Separate capabilities include baseline comparisons and plotting training, evaluation, and ablation results. Edges reflect the shown imports and calls or README documentation; unsampled level and plotting details are represented cautiously.
Main entry points: train.py Training workflow · viewer.py Interactive viewer · evaluate.py Greedy evaluation · snake_env.py Snake environment
Components 14
Game and state
- Configuration
config.py - Level definitions
levels/level_1.json - Snake environment
snake_env.py - BFS state sensors
state.py
Policies and learning
- Double DQN agent
agent.py - Replay memory
agent.py - Baseline policies
baselines.py
Training and evaluation
- Training workflow
train.py - Greedy evaluation
evaluate.py
Analysis and viewing
- Result plots
plots.py - Interactive viewer
viewer.py
Other components
- Project user
- Run metrics
- Model weights
Connections 30
- Project user → Training workflow: starts training
README.md - Project user → Greedy evaluation: requests evaluation
README.md - Project user → Interactive viewer: starts viewer
README.md - Training workflow → Configuration: reads settings
train.py - Training workflow → Level definitions: selects levels
README.md - Training workflow → Snake environment: runs episodes
train.py - Training workflow → BFS state sensors: builds states
train.py - Training workflow → Double DQN agent: selects and trains
train.py - Training workflow → Replay memory: stores and samples
train.py - Training workflow → Greedy evaluation: periodically evaluates
train.py - Training workflow → Run metrics: writes metrics
train.py - Training workflow → Model weights: saves weights
train.py - Snake environment → Configuration: reads rewards
snake_env.py - Snake environment → Level definitions: loads level data
README.md - BFS state sensors → Snake environment: reads game state
state.py - Double DQN agent → Configuration: reads hyperparameters
agent.py - Baseline policies → Snake environment: runs episodes
baselines.py - Baseline policies → BFS state sensors: builds policy inputs
baselines.py - Greedy evaluation → Double DQN agent: loads and queries
evaluate.py - Greedy evaluation → Snake environment: runs episodes
evaluate.py - Greedy evaluation → BFS state sensors: builds states
evaluate.py - Greedy evaluation → Run metrics: writes results
README.md - Result plots → Run metrics: reads run results
plots.py - Result plots → Baseline policies: reads baseline results
plots.py - Interactive viewer → Snake environment: advances game
viewer.py - Interactive viewer → BFS state sensors: builds sensor view
viewer.py - Interactive viewer → Double DQN agent: queries agent
viewer.py - Interactive viewer → Baseline policies: uses baseline policies
viewer.py - Interactive viewer → Greedy evaluation: reads failure results
viewer.py - Interactive viewer → Model weights: loads saved model
README.md