6.6 KiB
6.6 KiB
Phase 8: Operational Dashboard
1. Executive Summary & Architecture
Phase 8 implements the Operational Dashboard for the Warehouse Robot Fleet Digital Twin.
The dashboard provides facility managers, automation engineers, and robotics researchers with an interactive, glassmorphic dark-mode web application to monitor operational KPIs, inspect AMR fleet status, analyze corridor congestion heatmaps, and evaluate multi-parameter scenario comparisons.
Architectural Principles & Acceptance Criteria
- Zero-Dependency Decoupled Server: Built entirely on standard library Python (
http.server.ThreadingHTTPServer), requiring zero extra pip installs and zero disk space overhead. It works out of the box in the existing environment. - Strict Read-Only Protection: The dashboard operates purely as a telemetry consumer, reading exported JSON/CSV/SVG/MD artifacts. A failure, crash, or reload of the dashboard cannot corrupt or interrupt ongoing simulations.
- Optional Streamlit Integration: Includes
src/warehouse_twin/dashboard/streamlit_app.pyfor environments with Streamlit installed, while providing the primary standalone web app by default. - Data Agreement: All metrics, percentiles, robot states, and bottleneck rankings are drawn directly from the Phase 6 structured stores (
kpi_summary.json,robots.csv,tasks.csv,aisle_congestion.csv).
2. Directory Layout & Module Structure
warehouse-digital-twin/
├── src/warehouse_twin/dashboard/
│ ├── __init__.py # Dashboard package exports
│ ├── data_provider.py # Telemetry parser, CSV reader, and comparison extractor
│ ├── server.py # Threaded HTTP server and REST API handler
│ ├── streamlit_app.py # Optional Streamlit interface
│ └── static/ # Single Page Application assets
│ ├── index.html # Semantic HTML5 layout with glassmorphic cards
│ ├── app.css # Custom Vanilla CSS dark design system
│ └── app.js # Reactive client-side telemetry renderer
└── tests/unit/
├── test_dashboard_data_provider.py # 3 passed tests
├── test_dashboard_server.py # 2 passed tests
└── test_optional_dependencies.py # 2 passed tests
3. Core Dashboard Features & Views
1. Executive KPI Overview
- Summary Configuration Bar: Displays Experiment ID, Fleet Size, Dispatch Heuristic, Simulated Duration, PRNG Seed, and Wall-clock Execution Time.
- 6 Key KPI Cards:
- Throughput: Completed orders / hour (with completion rate badge).
- Turnaround Latency:
p_{50}median turnaround with mean andp_{95}reference thresholds. - On-Time SLA Delivery: Percentage of production-line feeder deadlines met (with 0 violations badge).
- Fleet Utilization: Overall active time % and productive loaded travel ratio.
- Energy Intensity: Total energy consumed (kWh) and kWh / completed task.
- Traffic Contention: Total conflicts, yield wait duration, and deadlocks prevented (0 deadlocks badge).
- Latency Distribution Table: Full percentile breakdown (
p_{50}, p_{90}, p_{95}, p_{99}, mean, std dev, max) across Turnaround, Queue Waiting, and Mission Execution latencies.
2. AMR Fleet & Battery Management
- AMR Telemetry Table: Real-time table showing Robot ID, Chassis Model (Light vs. Heavy AMR), Operational State (Idle, Dispatched, Picking, Loaded Transit, Dropping, Charging), Battery Level with dynamic color gauge, Total Distance, Loaded Distance, Energy Consumed, and Charging Sessions.
- Charging Infrastructure Cards: Active charging bays count, bay occupancy %, completed sessions, and average queue wait time.
- Payload Haulage Ratio Bar: Visual bar comparing productive loaded haulage vs. empty repositioning.
3. Spatial Heatmap & Corridor Congestion
- Embedded 2D SVG Heatmap: Directly embeds and displays
congestion_heatmap.svg, showing traffic intensity across Zone A, Zone B, Zone C, stations, and charging bays. - Corridor Bottleneck Diagnosis: Prioritized table of congested aisle segments with conflict counts, wait times, composite congestion scores, severity badges (
CRITICAL,WARNING,INFO), and actionable recommendations.
4. Tasks & SLA Compliance
- Status Cards: Completed, In-Progress, and Pending orders.
- Task Type Breakdown: Performance breakdown across
ORDER_PICK,PRODUCTION_LINE_FEED, andREPLENISHMENT.
5. Scenario Comparison (Parameter Sweeps)
- Fleet Sizing Sweep Matrix: Side-by-side comparison across 2, 4, 6, and 8 AMRs demonstrating throughput saturation and corridor conflict scaling.
- Dispatch Policy Matrix: Benchmarking
priority_nearest_idle,nearest_idle, andbalanced_utilization.
6. Audit-Ready Executive Report
- Embedded Report Viewer: Directly displays the rendered Markdown
report.mdwith an instant download button.
4. REST API Endpoints
The dashboard server exposes clean REST endpoints:
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Serves the main Single Page Application (index.html) |
GET |
/api/health |
Healthcheck returning { "status": "ok", "version": "0.8.0" } |
GET |
/api/experiments |
Returns JSON array of all discovered experiment runs |
GET |
/api/experiments/<id> |
Returns full experiment detail (config, KPIs, robots, tasks, bottlenecks) |
GET |
/api/experiments/<id>/heatmap.svg |
Returns raw SVG content (image/svg+xml) |
GET |
/api/experiments/<id>/report |
Returns Markdown report text |
GET |
/api/scenarios |
Returns parsed scenario comparison tables |
5. Running the Dashboard
Standalone Web Dashboard (Recommended - Zero Dependencies)
Run via the project CLI:
warehouse-twin dashboard --port 8501 --results-dir results
Open your browser at:
http://127.0.0.1:8501
Optional Streamlit Dashboard
If Streamlit is installed:
streamlit run src/warehouse_twin/dashboard/streamlit_app.py
6. Test & Validation Summary
============================= 144 passed in 2.43s ==============================
- Total Tests Executed: 144 passed across 31 test suites (100% pass rate).
- Phase 8 Test Coverage:
tests/unit/test_dashboard_data_provider.py: 3 passedtests/unit/test_dashboard_server.py: 2 passedtests/unit/test_optional_dependencies.py: 2 passed
- Decoupling Verified: The simulation, routing, and analytics packages execute with zero dependencies on dashboard components.