Rust-based optimization project that uses constraint programming to maximize the number of lives saved in emergency and healthcare scenarios. It models hospitals, diseases, available beds, ambulance positions and capacities, and patient needs, then computes optimized resource allocations to improve medical response and outcomes.
- Capture hospitals, treatments, bed capacity, ambulance fleets, and patient demand in a unified Rust model.
- Explore Google OR-Tools CP-SAT (via the
cp_satbindings) to optimize triage, routing, and resource allocation.
-
Start you dotenv file
cp .env.example .env
-
Start PostgreSQL locally with Docker Compose (runs on
localhost:5432)docker compose up -d postgres
-
Apply database migrations
sea-orm-cli migrate up
Need a clean slate? Use
sea-orm-cli migrate refresh. -
Run the tests or binaries as usual
cargo testcargo run
-
Seed curated reference data (optional)
cargo run -p scripts
This command clears the existing
hospitalsandhospital_specialitiestables and inserts a curated dataset covering eight flagship hospitals across Lisbon. It uses coordinates sourced from the public GeoJSON dataset at dados.gov.pt and fills in illustrative bed capacities plus Manchester triage wait targets so you can experiment with the optimizer immediately.Need to add more synthetic patients without wiping the previous ones? Set the mode to
appendwhen running the script:PATIENT_SEED_MODE=append cargo run -p scripts
The default mode is
reset, which keeps the deterministic hospital snapshot while refreshing patients on every run.
When you're done developing, stop the database container with docker compose down (add -v to prune the named volume).