Skip to content

spatial-monorepo


spatial-monorepo / wayfinding/src / buildLiveAvoidanceZones

Function: buildLiveAvoidanceZones()

buildLiveAvoidanceZones(occupancy, reservations, policy?): AvoidanceZone[]

Defined in: packages/wayfinding/src/occupancy-zones.ts:86

Builds the AvoidanceZone[] to pass as DirectionOptions.avoidanceZones from the current occupancy/reservation snapshot, per policy (falling back to DEFAULT_VENUE_AVOIDANCE_POLICY for any field the caller omits). Vacant units and inactive reservations contribute nothing (they simply don't appear in the returned zones — the caller's next route computation naturally stops avoiding them).

Occupied and reserved units are returned as two separate zones (even when blockMode/costMultiplier end up identical) so a caller inspecting the result can still tell which data source produced which unit ids.

Parameters

occupancy

OccupancyState[]

reservations

ReservationState[]

policy?

VenueAvoidancePolicy = {}

Returns

AvoidanceZone[]

Released under commercial licensing.