Skip to content

feat: learn signal and turn delays from GPS trips - #36

Open
agrawalmilin9 wants to merge 1 commit into
wncc:mainfrom
agrawalmilin9:feat/learn-signal-turn-costs
Open

agrawalmilin9 wants to merge 1 commit into
wncc:mainfrom
agrawalmilin9:feat/learn-signal-turn-costs

Conversation

@agrawalmilin9

@agrawalmilin9 agrawalmilin9 commented Oct 25, 2026 •

Copy link
Copy Markdown

Closes #28

Summary

  • Add GPS trace processing to extract candidate signal-wait and turn-delay observations.
  • Fit routing delay models using persisted observations and time-based weighting.
  • Persist observations from completed rides and restore learned models at startup.
  • Add routing and backend tests for extraction, persistence, deduplication, restoration, and ride-completion failure handling.

Testing

  • Routing tests: 137 passed, 16 subtests passed.
  • Backend tests: 18 passed.

@aom12345

Copy link
Copy Markdown
Collaborator

This should wait until #35 is fixed and merged: both PRs add routing/map_matching.py and different gps_learning.py files. Please rebase on it afterwards and add a migration for GPSDelayObservation under backend/migrations. Then: complete_ride runs the learning inline and refresh_delays loops over every edge pair in the city, so move it off the request path. Use only the in-trip pings (the pickup approach and wait inflate signal delays), prune old observations, and confirm a learned turn cost doesn't replace the geometric penalty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Learn traffic-signal waits and turn costs from real trips

3 participants