Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AeroNet Lite 🚁

Autonomous Drone Delivery Simulation with CSP, Genetic Algorithm, A* Routing, Real-Time Replanning, Demand Forecasting, and Anomaly Detection

BS Data Science — AI Semester Project


Quick Start Guide

1. Install Dependencies

pip install -r requirements.txt

2. Run the Streamlit Web Application

The entire visual dashboard and simulation engine are hosted locally via Streamlit. To start the application, run:

streamlit run app/streamlit_app.py --server.port 8501

Once the server starts, open your browser and go to: http://localhost:8501

(Optional) You can also run the purely text-based console version for debugging:

python -m src.main --budget 12000

How to Use the Application

The AeroNet Lite dashboard is divided into interactive controls on the left sidebar and simulation results in the main view.

🎮 Simulation Controls (Sidebar)

  1. Fleet Budget Slider: Adjust your funding (e.g., $5k to $20k). Clicking Reset will trigger the Genetic Algorithm to instantly calculate a brand new optimal drone fleet based on this budget.
  2. Auto-Play vs Step-by-Step:
    • Step-by-Step Mode: Click the "▶️ Advance One Step" button to manually move through the 20-step simulation. Ideal for academic presentations.
    • Auto-Play Mode: Automatically advances the simulation. You can use the Speed Slider to control how fast the drones fly.
  3. Restart Simulation: When the simulation reaches Step 20, the advance button turns into a restart button, allowing you to instantly clear the board and run a fresh scenario.

How to Interpret the UI Results

The dashboard is designed to provide real-time telemetry and post-simulation analytics. Here is how to interpret the results you see on the screen:

🗺️ The Live Grid Map

  • Background Colours: Represent zoning laws (e.g., Light Green = Residential, Yellow = Commercial, Red = Industrial).
  • Grid Icons: H = Hospital, S = School, ⚡ = Charging Pad, 🎯 = Hub.
  • Red Crosses (❌): Indicate No-Fly Zones. During the simulation (Step 11), a no-fly zone will dynamically appear. Watch how the A* Search algorithm instantly recalculates the path to steer drones around it.
  • Moving Dots: These are your drones flying their assigned delivery routes.

📊 Dashboard Tabs (Top Right)

  1. 📦 Deliveries (Donut Chart): Tracks the real-time status of all packages. If you see "Delayed", it means the Genetic Algorithm could not afford enough Heavy drones to carry heavy packages (over 2kg).
  2. 🔋 Battery (Bar Chart): Shows the live battery level of active drones. In Step 18, an anomaly is injected that instantly drains a drone's battery, turning the bar red and forcing it to abort its mission.
  3. 📈 GA Fitness: A static historical chart showing how the Genetic Algorithm solved the fleet selection problem at Step 0. Due to the small budget constraints, you will notice this line is usually flat—this proves the initial randomized population successfully brute-forced the optimal answer at Generation 0!

📋 Event Log

A colour-coded, scrolling text log detailing exactly what the AI modules are doing at any given microsecond (e.g., [delivery] Delivery 4 assigned to D7 (cost: 14.0)).


🧠 Interpreting the Machine Learning Results

At the bottom of the dashboard, you will find the Machine Learning results derived from processing 5 real-world datasets.

1. Demand Forecasting (Regression)

  • What it does: Uses Kaggle Bike Sharing and Amazon Delivery datasets to predict delivery traffic using Random Forest and Linear Regression.
  • How to read the charts: The Actual vs Predicted scatterplot visually demonstrates accuracy. A perfect model would have all dots directly on the diagonal dashed line. You can compare the Mean Absolute Error (MAE) and Root Mean Squared Error (RMSE) in the comparisons tab; lower bars equal a better prediction model.

2. Anomaly Detection (Classification)

  • What it does: Classifies drone telemetry failures (Engine, Aileron, Rudder) vs Normal flights using 595 real-world flight logs from CMU KiltHub.
  • How to read the Confusion Matrix: The diagonal squares (from top-left to bottom-right) represent correct predictions. Any numbers outside this diagonal mean the AI guessed incorrectly.
  • Why Balanced Accuracy matters: The dataset is 93% "Normal" flights. If an algorithm simply guesses "Normal" every single time, it gets a 93% raw accuracy, which is academically invalid. The Balanced-Acc metric penalizes this behavior. For example, Naive Bayes drops to a 28% Balanced Accuracy, proving it completely failed to learn, while KNN maintains a 93.5% Balanced Accuracy, proving it genuinely learned how to spot drone failures.

Project Structure

aeronet_lite/
├── app/
│   └── streamlit_app.py          # Interactive web dashboard
├── data/
│   ├── raw/                      # Integrated real-world datasets
├── src/
│   ├── grid_model.py             # Shared 10×10 grid model
│   ├── layout_validator.py       # Module 1: CSP constraint validation
│   ├── fleet_selector.py         # Module 2: GA fleet selection
│   ├── astar_planner.py          # Module 3: A* path planning
│   ├── delivery_simulator.py     # Module 4: 20-step simulation engine
│   ├── ml_pipeline.py            # Module 5: Demand forecasting + anomaly detection
│   └── main.py                   # CLI entry point
├── report/
│   ├── requirements_verification.md  # Official checklist of requirements
│   └── final_report.md           # Project report
├── requirements.txt
└── README.md

License

Academic project — not for commercial use.

About

An autonomous drone delivery simulator integrating A* pathfinding, Genetic Algorithms, and Machine Learning. Built with Python and Streamlit.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages