Last active
March 5, 2019 14:39
-
-
Save starsinmypockets/9233d904e8f689c9fa3dc8e762dba546 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Our scheduling algorithm only shows optimistic availble gaps based on the driver's current schedule, and the current time | |
| * As time goes on and the schedule changes, we update gaps / availability to reflect new facts, but we don't need logic for that, | |
| * since those are inputs | |
| **/ | |
| // Schedule: | |
| [ | |
| // a scheduled trip | |
| [ | |
| { start: Date, end: Date }, // earliest possible start time - max(apptStart, now) | |
| { start: Date, end: Date} // latest possible start time min(nextStart, apptEnd) | |
| ], | |
| // another trip | |
| [ | |
| { start: Date, end Date } | |
| // ... | |
| ] | |
| ] | |
| // Gaps: | |
| // use this to show driver available runs with `Order.extemdObservable` or similar | |
| [ { start: Date, end: Date }, { start: Date, end: Date } ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment