Skip to content

Repository files navigation

Reliability--Aware ACO for Drone Routing Under Weather and Battery Uncertainty

A complete, reproducible experimental framework for a research paper on drone delivery routing under uncertain weather and battery conditions using Ant Colony Optimization (ACO).


Project Structure

Drone_Delivery/Code/
├── config.yaml                  ← Single source of truth for ALL parameters
├── requirements.txt
├── main.py                      ← CLI entry point
│
├── data/
│   ├── raw/                     ← Solomon VRPTW .txt files (auto-downloaded)
│   ├── weather/                 ← ERA5 cached CSV + NetCDF
│   ├── loaders/
│   │   ├── solomon_loader.py    ← Download + parse Solomon instances
│   │   └── weather_loader.py   ← ERA5 API + synthetic fallback
│   └── preprocessing.py         ← Coord scaling, distance matrix, wind matrix
│
├── models/
│   ├── distance.py              ← Euclidean distance utilities
│   ├── weather_reliability.py  ← W_ij = exp(-k · wind_speed)
│   ├── battery_reliability.py  ← B_ij = min(1, E_remain / E_ij)
│   ├── edge_reliability.py     ← R_ij = W_ij × B_ij
│   └── route_reliability.py    ← R_route = ∏ R_ij (log-space stable)
│
├── algorithms/
│   ├── aco_base.py             ← Abstract base (shared tour construction)
│   ├── aco_standard.py         ← Standard ACO: η = 1/d
│   ├── aco_ra.py               ← Proposed RA-ACO: η = R/d
│   ├── aco_ablation.py         ← Ablation: η = 1/d, RA deposit
│   └── dijkstra.py             ← Greedy nearest-neighbour baseline
│
├── experiments/
│   ├── run_comparison.py       ← All 4 methods × all instances
│   ├── run_ablation.py         ← RA-ACO vs Ablation side-by-side
│   ├── run_sensitivity.py      ← Wind + battery sensitivity
│   └── run_parameter_tuning.py← α, β, ρ grid search
│
├── evaluation/
│   ├── metrics.py              ← Extract + compute metrics per route
│   ├── aggregation.py          ← Mean/std/best across runs
│   └── convergence.py          ← Convergence analysis utilities
│
├── visualization/
│   ├── plot_routes.py          ← Route maps colored by reliability
│   ├── plot_convergence.py     ← Convergence curves with ±std bands
│   ├── plot_comparison.py      ← Grouped bar charts per metric
│   └── plot_sensitivity.py     ← Wind + battery sensitivity line plots
│
└── output/
    ├── tables/                  ← CSV result tables
    ├── plots/                   ← PNG/PDF figures
    └── logs/                    ← Route logs (JSONL)

Quick Start

1. Install dependencies

pip install -r requirements.txt

2. Configure ERA5 API (if using real weather data)

Ensure your ~/.cdsapirc file is configured:

url: https://cds.climate.copernicus.eu/api/v2
key: YOUR_UID:YOUR_API_KEY

Set weather.use_real_era5: true in config.yaml (default).

3. Download benchmark + weather data

python main.py download-data

This will:

  • Download Solomon VRPTW instances (C101, R101, RC101, etc.) from SINTEF.
  • Download ERA5 January 2023 wind data for Bengaluru, India.
  • Cache everything locally so subsequent runs are instant.

4. Run experiments

# Full pipeline (recommended for paper results)
python main.py run-all

# Or run individually:
python main.py run-comparison        # main results table
python main.py run-ablation          # ablation study
python main.py run-sensitivity       # wind + battery sensitivity
python main.py run-parameter-tuning  # hyperparameter grid search

5. Regenerate plots from saved results

python main.py plot-all

Key Configuration Parameters (config.yaml)

Parameter Default Description
aco.alpha 1.0 Pheromone influence α
aco.beta 2.0 Heuristic influence β
aco.rho 0.1 Evaporation rate ρ
aco.n_ants 20 Ants per iteration
aco.n_iterations 100 Max iterations
objective.lambda_1 0.5 Weight on (1 - R_route)
objective.lambda_2 0.3 Weight on D_route / D_ref
objective.lambda_3 0.2 Weight on E_route / E_max
weather.wind_decay_k 0.1 k in W = exp(-k·wind)
experiment.n_runs 10 Independent repetitions

Method Summary

Method Heuristic η_ij Deposit Δτ Purpose
Dijkstra — (greedy: nearest node) Classical shortest-path baseline
Standard ACO 1 / d_ij 1 / D_route ACO baseline (no reliability)
Ablation ACO 1 / d_ij R_route / (D+E) Ablation: RA deposit, no RA heuristic
RA-ACO (proposed) R_ij / d_ij R_route / (D+E) Reliability-aware routing

Output Files

File Description
output/tables/comparison_results.csv Full per-run results
output/tables/comparison_summary.csv Mean ± std summary table
output/tables/ablation_results.csv Ablation study results
output/tables/sensitivity_wind.csv Wind severity sweep results
output/tables/sensitivity_battery.csv Battery capacity sweep results
output/tables/parameter_tuning_results.csv Full α/β/ρ grid
output/tables/parameter_tuning_best.csv Best hyperparameter combination
output/plots/comparison_reliability.png Reliability bar chart
output/plots/comparison_distance.png Distance bar chart
output/plots/comparison_msr.png Mission success rate bar chart
output/plots/convergence_*.png Per-instance convergence curves
output/plots/sensitivity_wind.png Wind sensitivity line plot
output/plots/sensitivity_battery.png Battery sensitivity line plot
output/logs/comparison_routes.jsonl Best routes per method (JSON)

Reproducibility

  • All experiments use fixed random_seed: 42 (configurable).
  • Run k uses seed = base_seed + k for statistical independence.
  • ERA5 data is cached after one download; results are fully reproducible.
  • Synthetic weather fallback uses a seeded Gaussian random field.

Assumptions (documented for paper)

  1. Single drone with full battery recharge at depot before each run.
  2. Solomon coordinates are scaled to Bengaluru bounding box (12.5–13.5°N, 77.0–78.0°E) for ERA5 mapping.
  3. Wind speed at an edge is the ERA5 grid value nearest to the edge midpoint.
  4. Weather reliability: W_ij = exp(-0.1 · wind_speed) — exponential decay from ERA5 January 2023 monthly mean.
  5. Battery reliability: B_ij = min(1, E_remain / E_ij) — ratio-based formulation.
  6. E_max is calibrated per instance: k_base × n_nodes × mean_distance × 0.85.
  7. Objective is normalised so that all three terms are in [0, ~2] range.

Citation

@article{adhikari2026raaco,
  title={Reliability-Aware ACO for Drone Routing Under Weather and Battery Uncertainty},
  author={Adhikari, Pratyush}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages