Skip to main content
Loading navigation

Build a Port Congestion Aware Carbon Footprint and Delay Explainer — implementation

Prompt source

implementation72 lines11 sectionsNo variables1 code block
## Build
Correlate Singapore vessel queue data from open datasets with bunker fuel consumption. Synthesize maritime emission audit logs and clear delay explanations for shippers.

## User
Maritime ESG and Customer Experience Analyst

## Workflow
1. Ingest vessel anchorage wait times and port arrival schedules from simulated Singapore maritime open data feeds.
2. Calculate auxiliary engine emissions and fuel burn incurred during prolonged anchorage idling.
3. Map carbon intensity increases against standard ocean voyage baselines.
4. Draft customer delay notices that detail operational anchorage hold-ups and ESG emission impact.

## Interface
Emissions dashboard displaying anchorage wait heatmaps, vessel bunker calculations, and draft customer notices.

## Data
Simulated maritime vessel movement records modeled on MPA Singapore public vessel arrival APIs.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Singapore open data API](https://guide.data.gov.sg/developer-guide/api-overview)
Applies data.gov.sg dataset querying and API v1 metadata patterns to access public maritime vessel queue and port arrival metrics.

## Tools
dspy, python, fastapi.
DSPy compiles robust prompt logic to convert vessel telemetry and auxiliary fuel calculations into clear ESG explanations.
Hosted reasoning model via API for generating empathetic yet quantitatively grounded customer service communications.

## 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
- Calculate auxiliary engine carbon emissions using IMO standard conversion factors (3.114 g CO2/g fuel).
- Correlate anchorage duration in Singapore waters with container delivery delay milestones.
- Generate a structured delay explanation citing verified port anchorage wait conditions.
- Output an ESG ledger update documenting Scope 3 transport emission increments.

## Starter Examples
```json
[
  {
    "input": {
      "vessel_call_id": "CALL-SIN-9912",
      "vessel_name": "Ocean Singapore",
      "scheduled_berth_time": "2025-03-15T02:00:00Z",
      "actual_berth_time": "2025-03-16T14:00:00Z",
      "anchorage_area": "Eastern Anchorage",
      "aux_engine_fuel_rate_mt_per_day": 3.2,
      "cargo_teus_onboard": 2400
    },
    "expected_output": {
      "anchorage_wait_hours": 36,
      "total_bunker_burned_mt": 4.8,
      "additional_co2_tonnes": 14.95,
      "co2_per_teu_kg": 6.23,
      "customer_notice": "Vessel Ocean Singapore experienced 36 hours anchorage waiting due to high terminal berth density. Total Scope 3 increment: 6.23 kg CO2/TEU."
    }
  },
  {
    "input": {
      "vessel_call_id": "CALL-SIN-9913",
      "vessel_name": "Lion City Express",
      "scheduled_berth_time": "2025-03-15T08:00:00Z",
      "actual_berth_time": "2025-03-15T09:30:00Z",
      "anchorage_area": "Western Anchorage",
      "aux_engine_fuel_rate_mt_per_day": 2.5,
      "cargo_teus_onboard": 1800
    },
    "expected_output": {
      "anchorage_wait_hours": 1.5,
      "total_bunker_burned_mt": 0.16,
      "additional_co2_tonnes": 0.5,
      "co2_per_teu_kg": 0.28,
      "customer_notice": "Vessel Lion City Express berthed within normal operational buffer (1.5 hours). No material delay or ESG adjustment required."
    }
  }
]
```

## Safety
Emissions calculations are internal estimates and do not constitute formal IMO compliance filings or legal liabilities.
Use mock external writes. Require human review before any real deployment.