Skip to content

Latest commit

 

History

55 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project has been created as part of the 42 curriculum by smakkass.

Drone Routing Simulator

Simulate and visualize drone routing on a user-defined map, ensuring safe, capacity-aware, and collision-free schedules.

Simulation Demo


Overview

The project parses a simple textual map format, validates graph constraints, computes per-drone paths with time-based reservations, and visualizes the result with an interactive UI.


Getting Started

Quick run (Make)

make run

Direct run (Python)

python -m src --map <path-to-map>

Algorithm Choices & Implementation Strategy

Parsing & Validation

A three-stage flow — lexer, parser, validator — ensures map syntax correctness and semantic checks:

  • Unique zones
  • Valid colors
  • Connectivity
  • Start/end hubs

Pathfinding & Scheduling

Uses a Dijkstra-like search over turns with a ReservationTable to prevent exceeding zone/connection capacity.

Reservation Approach

Each reconstructed path reserves zone and connection slots per turn, so subsequent drone pathfinding avoids conflicts, enabling simple greedy scheduling of multiple drones.


Visual Representation

Renderer: Built with arcade. The visual flow converts internal Map / Connection / Zone objects into simple nodes and edges.

Visualizer Screenshot

Controls

Input Action
Mouse Zoom / Pan map view
/ Retract / Advance a turn
M Toggle map view
D Toggle drone view
P Toggle info popup
F Toggle fullscreen
R Reset map view and turn

Why It Helps

Visualizing per-turn positions clarifies scheduling decisions, highlights bottlenecks (restricted zones, narrow links), and helps debug map definitions and drone interactions.


Project Structure

Fly-in/
├─ Makefile
├─ pyproject.toml
├─ README.md
├─ maps/
│  ├─ README.md
│  ├─ easy/
│  ├─ medium/
│  └─ hard/
└─ src/
  ├─ __main__.py
  ├─ classes.py
  ├─ simulation.py
  ├─ map_parser/
  │  ├─ __init__.py
  │  ├─ classes.py
  │  ├─ lexer.py
  │  ├─ parser.py
  │  ├─ validator.py
  │  └─ errors.py
  └─ visualizer/
    ├─ converter.py
    ├─ visualizer.py
    ├─ map.py
    ├─ drone.py
    ├─ scaler.py
    └─ constants.py

Resources

Parsing
Algorithm
Arcade
Background Image

AI Usage

AI was used to add concise docstrings across the codebase and to draft this README.