simulate_scenario
Run a what-if scenario on a freight lane to see cost and time impacts from market changes like route diversions, fuel spikes, or tariff adjustments, with transparent baseline and delta comparisons.
Instructions
Run a WHAT-IF on a lane: recompute the COST and TIME impact of a structural change to the freight market, on top of freight-pulse's engines. Scenarios: 'red-sea-reopen' (Suez/Bab-el-Mandeb reopens and Asia-Europe / the Suez share of Asia-US-East services return from the Cape-of-Good-Hope diversion → shorter transit, war-risk & diversion surcharges fall — only material on Suez-exposed lanes); 'fuel-spike' (bunker VLSFO up X% → the BAF/bunker portion of the all-in rises; pass fuel_spike_pct); 'cny' (Chinese New Year front-loading: the pre-CNY rush spikes the spot rate and the equipment crunch and dips schedule reliability — material on China-origin lanes); 'tariff-change' (destination duty changes by X percentage points — e.g. a new Section-301 tranche or an FTA change — raising/lowering the landed cost while freight is UNCHANGED; pass tariff_delta_pp and value). It recomputes the affected engine outputs under the perturbed inputs it can thread (fuel proxy, ship date) and models the structural ones (the Red-Sea routing flag, a tariff delta) as explicit, transparent adjustments — never silently — and reports the baseline, the scenario and the deltas. A what-if is a MODELED counterfactual, not a prediction the event will occur (regla 7). PREMIUM: pay per call with x402 (USDC on Base) or set a prepaid key (FREIGHT_PULSE_KEY). Same UN/LOCODE port normalization as get_spot_rate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| origin_port | Yes | Origin port (city, UN/LOCODE, or 'City, Country'). | |
| dest_port | Yes | Destination port (city, UN/LOCODE, or 'City, Country'). | |
| scenario | Yes | The what-if: 'red-sea-reopen', 'fuel-spike', 'cny' or 'tariff-change'. REQUIRED. | |
| container_type | No | Container size '20ft'/'40ft'/'40HC'. Optional; defaults to '40ft'. | |
| ship_date | No | Intended ship date (ISO). Drives the CNY-year and the baseline all-in. Optional; defaults to today. | |
| fuel_spike_pct | No | For 'fuel-spike': percent increase in VLSFO bunker (e.g. 30 = +30%). Default 30. | |
| tariff_delta_pp | No | For 'tariff-change': change in duty in PERCENTAGE POINTS (e.g. 10 = +10pp, -5 = a cut). Default 10. | |
| value | No | For 'tariff-change': merchandise value (USD) to size the duty/landed impact. Default 50000. |