feat(phase-6): implement analytics, kpi calculator, event store, heatmaps, and experiment runner

This commit is contained in:
2026-10-21 12:19:15 +05:30
parent 1e50508f53
commit 4c4419a06c
25 changed files with 2725 additions and 63 deletions
+33
View File
@@ -5,6 +5,39 @@ All notable changes to the Warehouse Robot Fleet Digital Twin will be documented
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.7.0] - 2026-10-21
### Added - Phase 6: Analytics and Experiment Framework
- **Comprehensive KPI Calculator** (`warehouse_twin.analytics.kpi_calculator`):
- Standardized, unit-defined metrics for throughput, turnaround latency distributions (mean, std dev, min, p50, p90, p95, p99, max), fleet utilization, loaded vs. empty distances, loaded ratio %, energy intensity, bay occupancy, and SLA compliance.
- Strict isolation of incomplete tasks (pending and in-progress) from completion latency percentiles.
- Granular operational breakdowns grouped by individual task type (`ORDER_PICK`, `PRODUCTION_LINE_FEED`, `REPLENISHMENT`).
- **Telemetry & Event Store** (`warehouse_twin.storage.event_store`):
- Streaming JSON Lines simulation event logger (`events.jsonl`).
- Tabular lifecycle CSV export (`tasks.csv`).
- Robot operational summary CSV export (`robots.csv`).
- Edge and corridor contention CSV export (`aisle_congestion.csv`).
- Full structured KPI summary JSON export (`kpi_summary.json`).
- **Spatial Heatmap & Bottleneck Analyzer** (`warehouse_twin.analytics.heatmap`):
- Interactive, scalable 2D SVG heatmap visualizer with warehouse zone overlays, rack positions, stations, and color-coded traffic flow intensity.
- Terminal-friendly ASCII floorplan heatmap.
- Automated bottleneck diagnosis producing prioritized severity levels and actionable engineering recommendations.
- **Executive Markdown Report Generator** (`warehouse_twin.analytics.report_generator`):
- Automated rendering of executive-ready Markdown reports (`report.md`) with latency distribution tables, fleet spatial distance matrices, individual robot telemetry, and bottleneck diagnosis.
- **Experiment Execution & Scenario Comparison Engine** (`warehouse_twin.analytics.experiment_runner`):
- Deterministic PRNG seed control for 100% reproducible experiments.
- Monte Carlo multi-seed execution engine computing mean, standard deviation, and 95% confidence intervals across replications.
- Automated scenario comparator executing parameter sweeps:
- Fleet sizing analysis across 2, 4, 6, and 8 AMRs under identical order workloads.
- Dispatch heuristic benchmarking (`priority_nearest_idle`, `nearest_idle`, `balanced_utilization`).
- Automated Markdown comparison reports (`results/reports/fleet_size_comparison.md`, `results/reports/dispatch_policy_comparison.md`).
- **CLI Commands**:
- `warehouse-twin run-experiment`: Headless experiment execution with automated report, SVG heatmap, and telemetry exports.
- `warehouse-twin compare-scenarios`: Multi-parameter sweep execution for fleet sizing and dispatch policies.
- **Unit Test Suite**:
- Added 19 comprehensive unit tests across `test_kpi_calculator.py`, `test_event_store.py`, `test_heatmap.py`, `test_experiment_runner.py`, and `test_scenario_comparison.py`.
- Expanded test suite to **129 passed unit tests (100% pass rate in 0.97s)**.
## [0.6.0] - 2026-10-21
### Added - Phase 5: Charging and Operational Constraints