-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rjf/dispatcher req sort #206
Conversation
read the docs failed with the following error (below). link to build. it looks like we need to pin our sphinx version to "<7.0.0" as readthedocs doesn't support sphinx 7 yet.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dude! Great find! It would have taken me forever to track that down. So happy you had the lighting bolt moment ⚡
@nreinicke i think i found it. i was writing an email response to dylan and was jotting down some potential leads, like looking into whether scipy guarantees the linear_sum_assignment is deterministic. then i was like OH YA i should quadruple-check that we build the matrix deterministically. we do not.
in the dispatcher logic, we were creating the assignment matrix of available vehicles by current unassigned requests. the
unassigned_requests
collection was being sorted by value descending, which is to say, "put the highest-valued customers at the top of this list". but there was no tie-breaker:I fixed this by making the sort key
lambda r: (-r.value, r.id)
. I ran manhattan.yaml twice in a row and observed the top-level stats were the same:as you'll see in the changed files for this PR, i've also updated the newly-added design.md section of the HIVE documentation to clearly highlight the sort issue.