A reinforcement learning project for grid world navigation using Stable Baselines3.
Train AI agents to navigate through grid-based mazes using PPO and DQN algorithms. The agent learns to find the shortest path from start (@) to goal ($) while avoiding obstacles (#).
- Multiple Algorithms: Supports PPO and DQN reinforcement learning algorithms
- Custom Maps: Various difficulty levels (easy, medium, hard) with different maze layouts
- Real-time Training: Visualize training progress and agent behavior
- Model Persistence: Save and load trained models for evaluation
- Install Dependencies:
pip install stable-baselines3 gymnasium matplotlib numpy- Train a Model:
python train.py --map-dir maps/ --algo ppo --timesteps 50000- Test the Model:
python test.py --map map.txt --model model.zip├── gridworld_env.py # Custom grid world environment
├── train.py # Training script ├── test.py # Testing and evaluation
├── maps/ # Maze map files
├── models/ # Saved trained models
└── logs/ # Training logs
Maps use simple text-based format:
@- Start position$- Goal position#- Obstacle*- Free space