This small project aims to reproduce the ant colony optimization algorithm. It is a technique used to solve problems which can be reduced to finding good paths through graphs. It follows the pattern of a real ant colony. Go check this out on Wikipedia, it's really interesting!
This project is built in Python around three modules:
- The model, which contains all the interesting formulas and the interaction between the ants and their world.
- The GUI, which displays the world as a nice grid, great to see the evolution.
- The console, which runs in the background way faster and display a path as text (with some stats) when the model thinks it converged.
- Python 3
- Pygame library.
- Grab the Python files from GitHub
pip install -r requirements.txt
in the project directory.
- Simply run GUI.py or Console.py (Model.py needs to be in the same folder).
python GUI.py
python Console.py
Both GUI.py and Console.py accept command line parameters to edit some constants. Run this command to get the parameters:
python GUI.py -h
python GUI.py -h
Thibault Nocchi To contact me, file an issue, thanks.
This project is licensed under the Unlicense License - see the LICENSE file for details.