How siranjeevi2001/problemsolving-skygo-drone-delivery works
Project type and purpose
• This is a Python‐based CLI tool (“Drone Delivery System”) that:
• Reads order data from JSON (testcase1/2.json)
• Assigns orders to drones and computes routes using the A* pathfinding algorithm
• Outputs results to output.json and visualizes the warehouse and drone paths via Matplotlib
File structure
• Top‐level files:
• requirements.txt – Python deps (matplotlib, etc.)
• testcase1.json, testcase2.json – sample input data
• output.json – computed assignment/routes
• src/ – contains generated output images (case1-op.png, case2-op.png)
• README.md – project overview & usage
• There is no multi‐service or client/server split: it’s a single‐process pipeline.
Key insights from README
• Core components: order‐assignment logic, A* pathfinder, Matplotlib visualization
• Data flow: JSON in → algorithm → JSON out + plot display
Main components
a. Input Layer
• JSON Parser
• Data Models (orders, drone fleet, warehouse)
b. Core Processing
• Assignment Engine (allocates orders to drones)
• Pathfinding Module (A* search on grid/map)
c. Output Layer
• JSON Writer (output.json)
• Visualization Module (Matplotlib)
d. Infrastructure/Environment
• File System (input/output JSON, images in src/)
• Python Runtime & Libraries (requirements.txt)
Relationships and data flow
• The CLI (main.py) loads JSON → constructs data models → passes to Assignment Engine
• For each assigned order, the Pathfinding Module computes a route → returns path data
• Main orchestrator writes aggregated results to output.json
• Main invokes Visualization Module to render paths on a 2D plot
• Visualization outputs PNG files into src/ and displays figures
Architectural patterns & principles
• Single‐process pipeline (no network calls)
• Clear separation of concerns: parsing ↔ computing ↔ I/O/visualization
• Modular algorithm implementation (swap A* for another heuristic if needed)
• Stateless computation per invocation (no persistent state beyond JSON)
Technologies and libraries
• Python 3.x (main runtime)
• Matplotlib (visualization)
• JSON (data interchange)
Detailed elements
• JSON Parser → Data Models → Assignment Engine → Pathfinding Module
• File system layer to show where inputs live and where outputs are written
• Python runtime block hosting all modules, with dependencies (Matplotlib, stdlib json, etc.)