This project has been created as part of the 42 curriculum by jsmidt.
Fly-in is a drone routing simulation that navigates a fleet of drones through a network of connected zones from a start hub to an end hub in the fewest possible turns. The simulation handles zone capacity constraints, restricted zones with movement costs, priority zones, blocked zones, and connection capacity limits.
The project implements Dijkstra's algorithm from scratch for pathfinding, with a turn-based simulator that moves all drones simultaneously while respecting all constraints.
Pathfinding uses a weighted Dijkstra implementation where zone costs are:
normal— 10priority— 9 (preferred over normal)restricted— 20 (costs 2 turns to enter)blocked— unreachable
Drones are assigned paths sequentially each turn, with earlier assignments reserving their next zone to spread drones across different routes. The simulator processes movement in two passes — first determining which drones can move, then executing all moves simultaneously to prevent order-dependent conflicts.
Given the following map file maps/easy/01_linear_path.txt:
nb_drones: 2
start_hub: start 0 0 [color=green]
hub: waypoint1 1 0 [color=blue]
hub: waypoint2 2 0 [color=blue]
end_hub: goal 3 0 [color=red]
connection: start-waypoint1
connection: waypoint1-waypoint2
connection: waypoint2-goal
Running make run and selecting the map produces:
D0-waypoint1
D0-waypoint2 D1-waypoint1
D0-goal D1-waypoint2
D1-goal
Simulation complete in 4 turnsEach line represents one simulation turn. D0-waypoint1 means drone 0 moved to waypoint1 that turn. Drones that don't move are omitted from the output.
- Python 3.10+
- uv — install with
curl -LsSf https://astral.sh/uv/install.sh | sh
make installmake runThis will present a file picker to select a map from the maps/ directory. The simulation runs with a pygame visualizer by default.
make debug # run with pdb debugger
make lint # run flake8 + mypy
make lint-strict # run mypy --strict
make clean # remove cachesThe pygame visualizer was built by rmoll and displays the drone network as an interactive graph with:
- Zones rendered as colored circles matching their map color
- Connections shown as lines between zones
- Drones animated as 🚁 moving between zones
- Capacity bars showing zone occupancy in real time
- Turn counter and delivery progress bar
- Speed control with
+and-keys Rto restart,QorESCto quit
Claude (Anthropic) was used throughout this project for guidance on OOP design decisions, debugging simulation logic, and understanding algorithm implementation. All code was written and understood by the author — AI was used as a learning tool and sounding board, not a code generator.