> ## Documentation Index
> Fetch the complete documentation index at: https://developers.kardinal.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Cold-chain last-mile

> A reconfigurable refrigerated compartment, trusted-keychain deliveries, zone preference, and predictive traffic on one refrigerated network.

A cold-chain last-mile operation delivers ambient and frozen goods from the same truck, often with a subset of stops (secure lockers, gated buildings) that only a driver holding the right key can serve. Traffic in the delivery area is predictable enough to forecast, and drivers still tend to work their usual sector day to day.

## What makes this vertical distinctive

* **Reconfigurable cold compartment** — a truck's compartment is set to ambient or frozen mode before departure, fixed for the whole tour, never carrying both loads at once.
* **Trusted-keychain deliveries** — a set of key-gated stops is kept to a single driver for the day, not split across whoever has room.
* **Preferred zones** — drivers are softly tied to their usual sector, pulled elsewhere only once it's covered.
* **Predictive traffic** — forecast travel time is baked into the route calculation itself.

## Combined example

```json theme={null}
{
  "resources": [
    {
      "id": "truck-1",
      "vehicleProfile": { "type": "truck", "withTraffic": true },
      "capacities": { "weight": 1200, "ambiant": 400, "frozen": 250 },
      "preferredStopTags": ["zone:usual-sector-7"],
      "tags": ["driver", "bi-temperature"]
    },
    {
      "id": "driver-1",
      "vehicleProfile": { "type": "truck" },
      "tags": ["driver"]
    }
  ],
  "orders": [
    {
      "id": "order-ambient",
      "stops": [
        { "type": "single", "id": "stop-pickup-ambient", "position": { "lon": 2.295, "lat": 48.872 }, "kind": "pickup", "operationDuration": "PT5M", "capacities": { "ambiant": 40 } },
        { "type": "single", "id": "stop-ambient", "position": { "lon": 2.31, "lat": 48.882 }, "kind": "delivery", "operationDuration": "PT6M", "capacities": { "ambiant": 40 } }
      ],
      "successiveStops": true
    },
    {
      "id": "order-frozen",
      "stops": [
        { "type": "single", "id": "stop-pickup-frozen", "position": { "lon": 2.295, "lat": 48.872 }, "kind": "pickup", "operationDuration": "PT5M", "capacities": { "frozen": 20 } },
        { "type": "single", "id": "stop-frozen", "position": { "lon": 2.305, "lat": 48.854 }, "kind": "delivery", "operationDuration": "PT6M", "capacities": { "frozen": 20 } }
      ],
      "successiveStops": true
    },
    {
      "id": "order-afternoon-delivery",
      "stops": [
        {
          "type": "single",
          "id": "stop-afternoon-delivery",
          "position": { "lon": 2.32, "lat": 48.867 },
          "kind": "delivery",
          "operationDuration": "PT8M",
          "capacities": { "ambiant": 10 },
          "tags": ["zone:usual-sector-7"]
        }
      ]
    },
    {
      "id": "order-keychain-0",
      "stops": [
        {
          "type": "single",
          "id": "stop-keychain-0",
          "position": { "lon": 2.31, "lat": 48.882 },
          "kind": "delivery",
          "operationDuration": "PT5M",
          "tags": ["keychain:trusted-set-1"],
          "preferredTimeWindows": [{ "begin": "2026-08-03T06:30:00Z", "end": "2026-08-03T08:00:00Z" }]
        }
      ]
    },
    {
      "id": "order-keychain-1",
      "stops": [
        {
          "type": "single",
          "id": "stop-keychain-1",
          "position": { "lon": 2.275, "lat": 48.88 },
          "kind": "delivery",
          "operationDuration": "PT5M",
          "tags": ["keychain:trusted-set-1"],
          "preferredTimeWindows": [{ "begin": "2026-08-03T06:30:00Z", "end": "2026-08-03T08:00:00Z" }]
        }
      ]
    }
  ],
  "additionalConstraints": [
    {
      "type": "atLeastOneValidCapacity",
      "capacities": { "frozen": 0, "ambiant": 0 },
      "name": "bi-temperature-single-mode-at-a-time",
      "resourceTags": ["bi-temperature"]
    }
  ],
  "globalConstraints": [
    {
      "type": "maxCumulatedCost",
      "maximum": 1,
      "costsByResourceTag": {
        "driver": {
          "costsByStopTag": { "keychain:trusted-set-1": { "using": 1 } }
        }
      },
      "name": "one-driver-per-key-set"
    }
  ]
}
```

### Reconfigurable cold compartment

`truck-1.capacities` carries `ambiant` and `frozen` as two independent dimensions. An `atLeastOneValidCapacity` constraint scoped to `bi-temperature`-tagged resources requires at least one of the two to stay at zero at every stop — in practice, the truck ends up loaded exclusively with ambient or exclusively with frozen goods for the tour, never a mix. This is a related but distinct pattern from [Multi-compartment vehicles](/guides/advanced-constraints#multi-compartment-vehicles): that guide's `atLeastOneConstraint` chooses between whole fixed setups, while this gate is checked stop by stop through an ordinary `capacities` mutual-exclusion.

### Trusted-keychain deliveries

`order-keychain-0`/`-1` share the tag `keychain:trusted-set-1`. A `globalConstraints` entry of type `maxCumulatedCost` caps the number of distinct drivers (tagged `driver`) who can visit a `keychain:trusted-set-1` stop at 1 across the whole fleet — so whichever driver the engine assigns to the first keychain stop is the only one allowed on the rest of that set. See [Constraints catalog](/reference/data-model#constraints-catalog).

### Preferred zones

`truck-1.preferredStopTags: ["zone:usual-sector-7"]` is matched against the same tag on `stop-afternoon-delivery` — a soft pull toward the truck's usual sector, scored through `maximizePreferredStops` rather than enforced as a hard rule. It's the same `preferredStopTags` mechanism [Driver skills and qualifications](/guides/advanced-constraints#driver-skills-and-qualifications) documents for a skill preference, applied here to a zone instead.

### Predictive traffic

`truck-1.vehicleProfile.withTraffic: true` makes the engine use forecast travel times for this truck's legs rather than free-flow distances.

## See also

* [Modeling advanced constraints](/guides/advanced-constraints#multi-compartment-vehicles) — the related whole-tour compartment-setup pattern.
* [Modeling advanced constraints](/guides/advanced-constraints#driver-skills-and-qualifications) — `preferredStopTags`, the soft mechanism behind zone preference.
* [Data model](/reference/data-model#constraints-catalog) — the full `additionalConstraints` and `globalConstraints` catalog.
