Skip to content
amiratorPublic

About

A Python-based software operations project featuring smart contracts, data simulations, and comprehensive documentation.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Jeddah Medical Waste Transportation Optimization System (JMWT-OS)

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)


Executive Summary

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:

  1. Phase A (Collection): Pickup from hospitals/facilities with accumulating hazardous waste
  2. Phase B (Disposal/Treatment): Delivery to high-security licensed incineration/autoclave facilities
  3. 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.


Key Innovations

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

Deliverables Included

  1. Mathematical Formulation — See docs/mathematical_formulation.md
  2. System Architecture — Mermaid diagrams + explanation in docs/architecture.md
  3. Python Simulation Prototype — Fully runnable in simulations/jmwtos_simulation.py using OR-Tools, NetworkX, PyTorch
  4. Smart Contract — contracts/PhaseCompliance.sol (Solidity 0.8.x)

Jeddah Operational Network (Prototype)

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.

Quick Start (Python Simulation)

Prerequisites (Windows PowerShell):

cd C:\Users\amira\JMWT-OS
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install ortools networkx torch numpy matplotlib pandas

Run Simulation:

python simulations\jmwtos_simulation.py

The 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

Mathematical Highlights

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.


Regulatory & Safety Notes

  • 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.

Future Extensions (Roadmap)

  • 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)

License & Disclaimer

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.


Prototype Execution Results (May 2026 Run)

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 log
  • data/simulation_result.json — Full metrics snapshot
  • simulations/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 torch is present.

How to Reproduce & Extend

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.py

To 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

About

A Python-based software operations project featuring smart contracts, data simulations, and comprehensive documentation.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages