Q-Learning Pathfinding Visualizer using Svelte5
An interactive visualization tool demonstrating the Q-Learning algorithm for pathfinding using SvelteKit and Canvas.
🔥 Live Demo
Try the Live Demo →
🚀 Quick Start
- Clone the repository:
git clone https://github.com/ala-garbaa-pro/svelte5-q-learning.git
cd svelte5-q-learning && code .
pnpm install
pnpm run dev
🎯 Overview
This project provides an intuitive and visual way to understand how Q-Learning, a fundamental reinforcement learning algorithm, works in the context of pathfinding. Users can watch the AI agent learn optimal paths between nodes in real-time with engaging visual and audio feedback.
✨ Key Features
- 🎮 Interactive graph visualization
- ⚡ Real-time learning process animation
- 🔊 Sound effects for enhanced user experience
- 📊 Progress tracking and score system
- 🎚️ Multiple difficulty levels
- 🎨 Smooth animations and visual effects
- 💅 Clean and modern UI using shadcn-svelte
🛠️ Tech Stack
📖 How to Use
1. Starting the Application
- Run
pnpm run dev
- Visit
http://localhost:5173
in your browser
2. Using the Visualizer
- Click on the canvas to create nodes
- Use the control panel to adjust learning parameters
- Press "Start Learning" to begin the visualization
- Watch as the agent learns optimal paths between nodes
3. Adjusting Settings
- Learning Rate: Controls how quickly the agent learns
- Exploration Rate: Determines random vs. learned actions
- Speed: Adjust the animation speed
- Sound: Toggle sound effects on/off
🤝 How to Contribute
We welcome contributions! Here's how:
- Fork the repository
- Create a feature branch (
git checkout -b feature/improvement
)
- Make your changes
- Run tests if available
- Commit changes (
git commit -am 'Add new feature'
)
- Push to branch (
git push origin feature/improvement
)
- Open a Pull Request
Please ensure you:
- Follow existing code style
- Add comments for complex logic
- Update documentation
- Test thoroughly
🙏 Attribution
Made with ❤️ by Ala GARBAA
If you use this project, please provide attribution by linking back to this repository.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License