Overview
The wede score engine ranks available teams for a given event. It runs identically on the API (online) and on the SDK (offline) - no server required, no external dependencies, pure TypeScript. Lower score is better. The top-ranked team is marked asrecommended.
Formula
recommended: true.
Tier System
Teams are ranked within three dispatch tiers before scoring:
The score engine ranks within each tier. Tier 1 teams are always preferred over Tier 2, regardless of score.
Components
travel_score - Haversine great-circle distance between the team position and the event, normalised to a 30-minute ETA at 42 km/h urban average. Capped at 1.0. capability_score - Equipment match ratio. If the event requires specific equipment, this is the fraction of required items the team has inoperational status. Lower is better - a perfect match scores 0.0.
member_score - Member availability ratio. Fraction of members with status: available. Lower means more available members.
load_penalty - 0.5 if the team is currently on_mission, 0 otherwise.
geofence_penalty - 0.2 if the event GPS is outside the team’s zone boundary polygon, 0 otherwise. Teams outside their zone are penalised but not excluded - cross-zone escalation remains possible.
Position resolution
The engine resolves the team position in order:- Fresh GPS - member with
status: available,last_seenwithin 10 minutes - Any GPS - most recent GPS from any member
- Zone center - fallback to the team’s zone
lat_center,lng_center - Unknown - no position data available - distance scored as 0
Fallback channel
Based on ETA and event priority, the engine recommends a communication channel:Offline operation
The score engine is designed to run without connectivity. The SDK stores:- Team positions (
lat,lng,last_seen) - Zone boundaries (polygon coordinates)
- Equipment lists
- Catalog actions (which teams respond to which action types)

