-
Notifications
You must be signed in to change notification settings - Fork 20
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
Exclude breaks from timeline that occur outside of the vehicle's day #63
Conversation
.map(createBreakSegment) | ||
.filter( | ||
(brk) => | ||
brk.startTime.greaterThanOrEqual(vehicleStartTime) && |
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.
What would we expect the behavior to be if vehicleStartTime
and/or vehicleEndTime
are null
? In those cases, this code would remove all break segments, which seems like it could the desired behavior (i.e. can't schedule a break if you didn't schedule start/end time). Mostly asking if it's valid to send a scenario to CFR that includes breaks without also setting vehicle start/end, in which case we'd want to filter differently.
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.
In this case, vehicleStartTime
and vehicleEndTime
are the start and end times of the route and aren't related to the vehicle time windows. May be worth renaming to clarify that, but the question still stands of whether or not a route would ever have a null
start or end? I'd assume not, but need to double check.
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.
Renamed vehicleStartTime
and vehicleEndTime
to routeStartTime
and routeEndTime
to make it clearer what we're checking against.
Closes #56