Created
June 25, 2020 07:13
-
-
Save linusnorton/9da8bbd7cc7a52f34ce124ce4bcd6f98 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
function isReachable(results: Results, c: Connection): boolean { | |
const interchangeRequired = results.bestConnections[c.origin] | |
&& results.bestConnections[c.origin].tripId != c.tripId; | |
const interchangeTime = interchangeRequired ? interchangeTimeAt(c.origin) : 0; | |
return results.earliestArrival[c.origin] && results.earliestArrival[c.origin] + interchangeTime <= c.departureTime; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment