Skip to main content
Loading navigation
Back to prompt library

Build a Port Corridor Congestion and Truck Slot Dispatcher — implementation

Linked challenge: Build a Port Corridor Congestion and Truck Slot Dispatcher

Prompt source

implementation66 lines11 sectionsNo variables1 code block
## Build
Analyze Singapore port corridor traffic congestion and Expressway camera alerts. Rebalance heavy prime mover gate pickup slots to prevent terminal road gridlock.

## User
Container Fleet Dispatcher

## Workflow
1. Query real-time traffic incident endpoints from Singapore data.gov.sg.
2. Estimate transport travel times across primary port logistics corridors.
3. Identify impending gate slot misses caused by unexpected road congestion.
4. Formulate adjusted pickup appointment schedules and alert transport coordinators.

## Interface
Dispatch kanban board displaying live hauler route progress, corridor congestion heatmaps, and gate status.

## Data
Query Singapore Land Transport traffic incident feeds on data.gov.sg or use static historical fixtures.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Singapore open data API](https://guide.data.gov.sg/developer-guide/api-overview)
Utilizes data.gov.sg real-time traffic camera and incident notification API endpoints.

## Tools
crewai, pydantic, fastapi.
CrewAI facilitates coordinated agent roles for corridor monitoring, slot management, and dispatch drafting.
Local fast model to synthesize driver dispatch instructions in plain concise English.

## 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
- Ingest Singapore Expressway camera and incident feeds from open APIs.
- Correlate port gate reservation slots with live traffic congestion indices along transit corridors.
- Synthesize dynamic hauler departure buffer schedules to avoid peak terminal queues.
- Generate real-time gate slot rescheduling recommendations for logistics dispatchers.

## Starter Examples
```json
[
  {
    "input": {
      "corridor": "West Coast Highway",
      "gate_slot": "14:30",
      "hauler_id": "TRUCK-441",
      "traffic_incident": true,
      "travel_time_min": 55
    },
    "expected_output": {
      "delay_estimate_min": 25,
      "recommended_action": "RESCHEDULE_SLOT",
      "reroute_corridor": "AYE via Pioneer Road",
      "revised_slot": "15:00"
    }
  },
  {
    "input": {
      "corridor": "AYE",
      "gate_slot": "10:00",
      "hauler_id": "TRUCK-442",
      "traffic_incident": false,
      "travel_time_min": 20
    },
    "expected_output": {
      "delay_estimate_min": 0,
      "recommended_action": "PROCEED_AS_PLANNED",
      "reroute_corridor": null,
      "revised_slot": "10:00"
    }
  }
]
```

## Safety
Advisory dispatch suggestions only; drivers and operators retain full control over vehicle routing.
Use mock external writes. Require human review before any real deployment.