Build a Port-Adjacent Heavy Vehicle Staging and Rain Delay Optimizer — implementation
Linked challenge: Build a Port-Adjacent Heavy Vehicle Staging and Rain Delay Optimizer
Prompt source
implementation82 lines11 sectionsNo variables1 code block
## Build
Correlate Singapore real-time weather rainfall observations with heavy hauler port gate slot bookings. Rebalance terminal truck dispatch itineraries to avoid high-intensity tropical downpours and terminal bottlenecks.
## User
Container fleet dispatch manager
## Workflow
1. Poll real-time rainfall and weather readings across Singapore maritime sectors from the data.gov.sg API.
2. Ingest scheduled container truck appointment slots at Pasir Panjang and Tuas container terminals.
3. Evaluate route delay risks by comparing high-intensity precipitation readings against hauler travel corridors.
4. Synthesize revised departure time slots and staging yard parking assignments for fleet drivers.
## Interface
Interactive corridor map showing weather radar overlays, hauler transit queues, and suggested slot shifts.
## Data
Singapore open data real-time weather API endpoint for precipitation; mock hauler gate slot schedule table.
Starter examples below are synthetic. They are not downloaded records.
## Source
[Singapore open data API](https://guide.data.gov.sg/developer-guide/api-overview)
Directly consumes data.gov.sg real-time weather API documentation parameters to query localized precipitation observations.
## Tools
ray-serve, python, httpx.
Ray Serve efficiently orchestrates high-frequency batch scoring of hundreds of hauler itineraries against streaming rainfall data.
Standard inference model for summarizing hauler schedule shifts and drafting driver advisory alerts.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Retrieves and parses real-time rainfall data from data.gov.sg without authentication failures.
- Identifies weather stations reporting rainfall exceeding 20mm/hr along primary logistics expressways.
- Computes delay risk scores and proposes rescheduled booking slots for affected haulers.
- Maintains simulated driver dispatch logs without transmitting live road alerts.
## Starter Examples
```json
[
{
"input": {
"vehicle_id": "SHA1234A",
"terminal": "Tuas Port",
"scheduled_gate_time": "2025-04-01T14:30:00+08:00",
"corridor": "AYE_WESTBOUND",
"weather_observations": [
{
"station_id": "S117",
"location": "Tuas South",
"rainfall_mm": 35.2
}
]
},
"expected_output": {
"corridor_status": "SEVERE_WEATHER_ALERT",
"risk_score": 0.88,
"original_gate_time": "2025-04-01T14:30:00+08:00",
"recommended_gate_time": "2025-04-01T15:15:00+08:00",
"staging_depot": "Tuas West Holding Yard 2",
"action": "RESCHEDULE_BUFFER"
}
},
{
"input": {
"vehicle_id": "SHA5678B",
"terminal": "Pasir Panjang Terminal",
"scheduled_gate_time": "2025-04-01T15:00:00+08:00",
"corridor": "WEST_COAST_HIGHWAY",
"weather_observations": [
{
"station_id": "S116",
"location": "Pasir Panjang",
"rainfall_mm": 1.2
}
]
},
"expected_output": {
"corridor_status": "NORMAL",
"risk_score": 0.12,
"original_gate_time": "2025-04-01T15:00:00+08:00",
"recommended_gate_time": "2025-04-01T15:00:00+08:00",
"staging_depot": "DIRECT_GATE_ENTRY",
"action": "PROCEED"
}
}
]
```
## Safety
All route adjustments and terminal slot assignments are simulated for dispatcher planning without affecting actual traffic signals.
Use mock external writes. Require human review before any real deployment.