# Terminal delivery experiments

Implemented 24 September 2026. This is a low-TRL synthetic traffic model; the geographic setting does not make the missions or safety parameters observed Norrköping operations.

The current daily workflow adds per-terminal demand, background traffic and multiple assigned profiles. See [DAILY_TRAFFIC.md](DAILY_TRAFFIC.md). The relative-share, requests/hour model below is retained for older short scenarios.

## Source data and demand

`population_nk_processed_06w2.geojson` has 39,121 cells, of which 3,499 have positive `B`. `B` ranges from 0 to 491 and sums to 117,180. All values are nonnegative integers. The companion `...with_D.geojson` contains the same B values and adds D/Dn. The file does not include a field dictionary, census year or population-source licence. **B is treated as population count/weight**, an explicit interpretation of the supplied data, not a verified census attribution. T, v and p are not used as population counts.

Population weights remain unmodified in the source. The importer calculates the area centroid of each polygon and stores each positive cell's ID, position and raw B. For the supplied simple rotated cells, the centroid is an interior synthetic delivery point. No inference about buildings, addresses or landing suitability is made. Import requires CRS84/EPSG:4326 longitude/latitude and numeric nonnegative B.

Requests arrive according to a homogeneous Poisson process with the user-specified total requests/hour λ during the demand period. Arrival, terminal choice, destination choice and sensor/contingency processes have independent seeded streams. The default constant rate is a scenario assumption; it is not inferred from population or historic drone operations.

For terminal k with demand weight w_k:

`P(terminal=k) = w_k / sum_j(w_j)`.

Let S_k contain positive population cell centres within that terminal's service radius. Then:

`P(destination=i | terminal=k) = B_i / sum_{j in S_k}(B_j)`.

Two terminals with equal weights receive equal expected request counts even when their service areas have different populations. Overlapping service areas may serve the same population cell; demand is not multiplied by the number of covered cells. Total λ sets the offered mission count. A terminal with no positive cells generates explicitly rejected demand, not reassigned or silently discarded demand. Geofences do not change destination probabilities; an inaccessible sampled delivery remains a rejected request.

## Network, layers and motion

The network uses exact 250, 500 or 1,000 m junction spacing in local metric coordinates. The grid is centred in the operating bounds and contains complete grid links; its edge margins are at least the corridor half-width. Each layer has directed links in both directions. Straight consecutive links are compressed into one kinematic leg, so reducing the spacing does not invent braking at every straight junction. Turns retain the existing bounded acceleration and yaw waits.

The lower layer carries outbound delivery traffic and the upper layer carries returns. Defaults are 80 and 120 m above the same flat reference surface (40 m separation). Default cylinder half-height is 15 m, so the nominal vertical gap is 10 m. Configuration rejects spacing at or below twice the chosen half-height. This checks nominal geometry only: navigation deviation, faults, CA and access legs may still create encounters. NMAC thresholds and physical aircraft body size are separate inputs.

Legacy short scenarios use one shared multirotor/DAA profile. Daily scenarios assign separate aircraft and DAA profiles per terminal and background source. Prescribed U-plans retain their declared speed and altitude while inheriting the common body, protection and sensing assumptions. Explicit U-plans continue using the reference sensing assumptions; arbitrary per-U-plan profile selection is not exposed by the map editor.

Each delivery itinerary contains:

1. Start airborne above the terminal at the configured hover height; climb to the outbound layer.
2. A straight access leg to the nearest grid junction; the shortest eligible grid path to the destination's nearest junction.
3. A straight off-grid approach at cruise height and vertical descent to the delivery hover height.
4. The configured delivery hover (defaults: 30 s, 10 m above flat reference ground).
5. Vertical climb to the return layer, a grid access leg, a separately planned return route, and terminal approach/descent.

Off-grid legs and vertical transitions use the same exact trajectory geometry, kinematic bounds, restrictions, solids and contact evaluation as the grid route. They are not teleportation. Shortest-path routing can detour around static restrictions on the grid; it does not search arbitrary detours for access/descent legs. If an access leg is blocked or either cruise route is unavailable, DCB rejects the mission. This limitation is visible in rejection reasons. With DCB disabled, route eligibility still applies but strategic restriction/conflict avoidance is disabled; actual violations and contacts remain evaluated.

Climb/hover/descent at endpoints is explicitly an **airborne delivery approximation**. Ground touchdown, building/roof landing, loading, battery/fleet availability and ground turnaround are not implemented. Demand represents requested round trips with aircraft available at origin, not a closed fleet inventory. The default 30 s hover and 10 m height are editable experiment parameters, not inferred service statistics.

## Reservations and outcome counting

DCB reserves the complete round trip before departure. It checks continuous protective separation, actual layer/corridor volume occupancy and corridor headway. A shared terminal movement headway applies to planned outbound and returning movements and is rechecked on rescheduling. Actual movement-headway violations are included in network-capacity violations. This is a capacity approximation, not an airport-pad ground model. The finite planner searches departure slots up to the configured maximum delay. It does not silently move a request to another terminal/destination or omit the return to make it fit the horizon.

Sensor/DAA execution does not count sensor detections as physical encounters. Ground-truth paths still determine contacts and NMAC intervals. Contingency replanning preserves remaining delivery waypoints, remaining service time and the return, instead of shortcutting directly to the terminal. Emergency recovery may leave the original corridor; restrictions and actual network usage remain checked.

Delivery service accumulates only on designated hover segments while the aircraft centre is within 1 m of the synthetic hover location. This 1 m tolerance is numerical/operational bookkeeping for the reference delivery model, not a sensor or collision threshold. Hover disrupted by CA does not count while displaced. If a mission returns without completing service, it is `delivery-incomplete`, not successful. Zero-duration delivery still requires reaching the destination.

One request is **one round-trip mission**, not two independent requests. `offeredDeliveries`, `completedDeliveries` and `returnedDeliveries` distinguish requests, completed delivery service, and completed service with return. A parcel can have been delivered even if the aircraft later fails to return. All airborne outbound, hover, return and contingency time contributes once to actual flight-hour exposure. Unfinished flights contribute their observed time only. Existing NMAC/contact metrics remain independent of delivery counts; U-plans are additional traffic.

The day starts empty. The drain period is included in exposure, and insufficient drain time can reject a round trip. This is a finite-cohort experiment, not evidence of steady-state fleet capacity.

## Dn, sample mode and terrain

Sample mode retains independent unrestricted Dn position samples and the original A/n research rule. Terminal demand, corridor/layer constraints and delivery service apply only in trajectory mode. The route-grid size does not change the sample engine's probabilities or classification.

For new trajectory projects, Dn is a comparison field. Executed occupancy is the measured aircraft-time distribution of the generated missions; it is not forced to match Dn. The 6 × 5 Results aggregation is independent of route spacing. Older projects without a `delivery` field retain their original calibrated-OD compiler. Editing a grid/delivery setting or terminal in the UI opts into terminal demand.

Real height data matters for actual ground clearance. Lantmäteriet supplies a 1 m **Markhöjdmodell Nedladdning**; its 2026 distribution uses 10 × 10 km files. Norrköping documents SWEREF 99 16 30 / RH 2000 for local data. No terrain file, building elevations or verified datum transformation is bundled in this experiment. The common flat ground is therefore retained in both physics and the displayed model description. A visual terrain layer alone would not make altitude/separation calculations terrain-aware.

Primary references:

- [Lantmäteriet product catalogue](https://www.lantmateriet.se/geodataprodukter)
- [2026 elevation product update](https://www.lantmateriet.se/sv/geodata/vara-produkter/Produktnyheter/Geografisk-information/markhojdmodell-nedladdning-utokas-med-mer-innehall/)
- [Norrköping open geodata and coordinate systems](https://norrkoping.se/boende-trafik-och-miljo/lantmateri-och-kartor/oppna-kartdata-och-tjanster)
- [Metropolis II traffic concepts and delivery demand](https://www.sesarju.eu/sites/default/files/documents/sid/2022/paper_88.pdf)

Grid spacing, layer assignment, hover duration and terminal placement remain sensitivity-study choices; these references do not validate our selected values.

## Reproducibility and verification

Exports include terminal coordinates/weights/radii, population cell centres and raw B, available source SHA-256, grid/layer settings, U-plans, geofences and the compiled scenario. JSON import recompiles declarative inputs rather than trusting supplied paths. Compact session drafts omit the expanded graph. The same engine runs in browser workers, independent batches and the parallel CLI. Versions prevent mixing results/checkpoints produced under older engine semantics.

The graph supports up to 12,000 grid junctions and 100,000 directed corridor links. Indexed route search and spatial corridor lookup avoid full graph scans for every physical segment. Results and exposure are still computed by the shared continuous evaluator. These limits and optimizations are not a claim that ten million flight hours have been executed.

Automated tests cover weighted sampling, true polygon centroids, all grid spacings, independent analysis resolution, continuous outbound/hover/return geometry, kinematics, blocked access legs, blocked return paths, empty service areas, censored/missed service, contingency preservation, actual exposure, batch aggregation and JSON roundtrips. Browser tests exercise terminal editing, the actual simulation worker, delivery inspection, 3D markers and mobile layout.

Requirement relationship: layered/corridor design and capacity inputs (REQ-2.1), mission paths (REQ-2.4), common-profile DAA/traffic interaction and actual-exposure output use the existing shared engine. Terrain-aware common altitude reference (REQ-2.10), validated delivery/traffic data and the large-exposure acceptance requirement remain incomplete.
