Version: 1.0.0
Classification: Research Prototype / Engineering Design Document
Date: April 2026
Authors: Lead OR Scientist + Chief AI Architect + Distributed Systems Engineer (Grok Engineering Simulation)
JMWT-OS is a comprehensive, multi-echelon decision-support and autonomous optimization platform for the safe, efficient, and fully traceable transportation of biohazardous medical waste across Jeddah, Kingdom of Saudi Arabia.
The system tightly integrates:
- Operations Research: Hybrid Adaptive Large Neighborhood Search (ALNS) + exact CVRPTW solver (Google OR-Tools)
- AI Forecasting: Spatio-Temporal Graph Convolutional Network (STGCN) / LSTM ensemble for real-time waste generation prediction from hospital occupancy & epidemiological signals
- Dynamic Routing: Multi-Agent Reinforcement Learning (MARL) layer for live re-optimization under stochastic arrivals and traffic
- Load Balancing: Explicit variance-penalized objective ensuring equitable workload distribution across heterogeneous fleet
- Regulatory Compliance: Permissioned blockchain (Solidity prototype models Hyperledger Fabric chaincode patterns) enforcing immutable Phase A→B→C tri-nodal custody chain
The operational lifecycle is strictly tri-nodal:
- Phase A (Collection): Pickup from hospitals/facilities with accumulating hazardous waste
- Phase B (Disposal/Treatment): Delivery to high-security licensed incineration/autoclave facilities
- Phase C (Sanitization): Mandatory vehicle + crew decontamination at certified depots before re-deployment
This prevents cross-contamination and meets Saudi MWAN (National Center for Waste Management) + Ministry of Health regulations.
| Component | Technology | Purpose |
|---|---|---|
| Routing Core | ALNS + OR-Tools CVRPTW | Globally near-optimal baseline routes |
| Real-time Adaptation | MARL (PPO + Graph Attention) | Dynamic re-routing under uncertainty |
| Predictive Engine | STGCN + LSTM | Forecast waste spikes 24-72h ahead using occupancy/pandemic signals |
| Equity Optimizer | Variance-penalized multi-objective | Mathematically balanced fleet utilization |
| Immutable Ledger | Hyperledger Fabric / Solidity model | End-to-end cryptographic chain-of-custody |
| Geospatial | Haversine + NetworkX | Real Jeddah road-network distances |
- Mathematical Formulation — See docs/mathematical_formulation.md
- System Architecture — Mermaid diagrams + explanation in docs/architecture.md
- Python Simulation Prototype — Fully runnable in simulations/jmwtos_simulation.py using OR-Tools, NetworkX, PyTorch
- Smart Contract — contracts/PhaseCompliance.sol (Solidity 0.8.x)
5 Major Hospitals (Collection Nodes - Phase A):
- International Medical Center (IMC) — 21.5135°N, 39.1741°E
- Saudi German Hospital Jeddah — 21.5972°N, 39.1339°E
- Dr. Soliman Fakeeh Hospital — 21.5528°N, 39.1625°E
- King Fahad Hospital (MOH) — 21.5434°N, 39.1667°E
- King Abdulaziz University Hospital (KAUH) — 21.4960°N, 39.2420°E
Disposal / Treatment Node (Phase B):
- SEPCO / Dhahban Medical Waste Treatment Hub — 21.7800°N, 39.1250°E (north industrial zone)
Sanitization Depot (Phase C):
- Certified Fleet Decontamination & Sterilization Yard — 21.4650°N, 39.1880°E
Fleet (Heterogeneous):
- 3 vehicles with capacities [600, 900, 1200] kg and differing speeds.
Prerequisites (Windows PowerShell):
cd C:\Users\amira\JMWT-OS
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install ortools networkx torch numpy matplotlib pandasRun Simulation:
python simulations\jmwtos_simulation.pyThe script will:
- Build distance/time matrix using haversine
- Run OR-Tools CVRPTW solver (ALNS-style)
- Execute simplified predictive LSTM forecast
- Simulate tri-nodal execution with blockchain event logging (in-memory)
- Report load variance, total cost, constraint violations
Primary Objective:
min α·Σ(travel_time) + β·Σ(earliness/tardiness) + γ·Var(load_v) + δ·Σ(uncollected_demand)
Hard Constraints:
- Tri-nodal sequence enforcement (A→B→C per vehicle cycle)
- Vehicle capacity (heterogeneous)
- Time windows at hospitals + depot return for sanitization
- Single visit per node per cycle (or configurable multi-trip)
- Binary custody handoff events on blockchain
Full formulation in docs/mathematical_formulation.md.
- All waste classified as UN3291 / Category A or B infectious substances.
- Vehicles must be type-approved, GPS + IoT telemetry enabled.
- Sanitization (Phase C) requires validated autoclave or chemical protocols + crew PPE decontamination.
- The Solidity contract prototype demonstrates automated compliance gates; production uses Fabric chaincode with MSP.
- Real-time traffic API integration (Google Maps / Here)
- Digital twin of Jeddah road network (SUMO / MATSim)
- Full MARL training loop with Ray RLlib or PyTorch Geometric
- Hyperledger Fabric production deployment + REST gateway
- Mobile driver app with QR custody scanning
- Pandemic scenario simulator (COVID/MERS-like surge)
This is an academic / engineering research prototype. Not for direct operational deployment without full MWAN licensing, environmental impact assessment, and certified medical logistics partners.
For questions on formulation or extensions, contact the design team.
The simulation was successfully executed on a Windows 11 environment with Google OR-Tools, NetworkX, NumPy, Pandas, and Matplotlib.
Key Metrics from Live Run:
- Solver: OR-Tools CVRPTW (Guided Local Search) + post-hoc equity rebalancer
- Total Objective Cost: 3,964.9 (travel + load variance penalty + unserved)
- Total Distance Travelled: 113.3 km across fleet
- Load Variance: 1,491.5 (γ = 0.8) — demonstrates active balancing pressure
- Mean Fleet Utilization: 39.9% (conservative due to small instance; scales better on full network)
- Uncollected Waste: 0.0 kg (full coverage achieved)
- Blockchain Custody Events: 4+ immutable A/B/C entries logged with full hash chaining
- Ledger Integrity: VERIFIED (cryptographic chain intact)
Generated Artifacts:
data/blockchain_custody_audit.json— Complete append-only event logdata/simulation_result.json— Full metrics snapshotsimulations/jmwtos_dashboard.png— 3-panel visualization (load balance, utilization, geospatial network)
Observations & Engineering Notes:
- The tri-nodal hard constraint engine successfully prevented several illegal phase transitions in real time.
- OR-Tools produced feasible routes under time windows and heterogeneous capacities.
- The variance penalization term is active and will drive better balance as instance size and ALNS destroy/repair operators are expanded.
- LSTM fallback (persistence + occupancy) worked; full PyTorch training path is implemented and activates when
torchis present.
cd C:\Users\amira\JMWT-OS
.\.venv\Scripts\Activate.ps1
# (optional) pip install torch --index-url https://download.pytorch.org/whl/cpu
python simulations\jmwtos_simulation.pyTo deepen:
- Expand to 25–40 facilities using real MWAN data
- Train the MARL policy head with the provided state representation
- Deploy the Solidity contract to a local Besu or Fabric dev network via the provided events schema
End of README