-
Notifications
You must be signed in to change notification settings - Fork 2
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
No deviation if near bus stop #304
base: dev
Are you sure you want to change the base?
Conversation
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.
A good addition to tracking. Just some minor comments to consider.
@@ -126,6 +128,13 @@ private static TrackingResponse doUpdateTracking( | |||
create || rerouted | |||
); | |||
|
|||
if (isDeviatedWithOnTrackInstruction(tripStatus, instruction)) { | |||
// Deem traveler on track (not deviated) if they are in the 'upcoming' range of a bus stop | |||
// or the departure loaction. |
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.
Typo: location.
if (isDeviatedWithOnTrackInstruction(tripStatus, instruction)) { | ||
// Deem traveler on track (not deviated) if they are in the 'upcoming' range of a bus stop | ||
// or the departure loaction. | ||
// (If near a bus stop, applicable bus notifications would have already been triggered. |
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.
Typo: Missing closing bracket.
* Returns the closest transit leg in 'upcoming' radius eligible for a "Wait for transit" instruction. | ||
*/ | ||
public Leg getTransitLegWithClosestUpcomingOrigin() { | ||
double distance1 = distanceToTransitLegOrigin(currentPosition, expectedLeg); |
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.
Nit. Perhaps name these distanceToExpectedLeg
and distanceToNextLeg
?
@@ -667,6 +703,11 @@ public TraceData(Coordinates position, String expectedInstruction, String messag | |||
this(position, expectedInstruction, false, message); | |||
} | |||
|
|||
public TraceData(Coordinates position, String expectedInstruction, Instant instant, String message) { |
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.
The TraceData class could now benefit from being refactored to use the builder pattern and being moved into it's own class. Perhaps out of scope, will let you decide.
Checklist
dev
before they can be merged tomaster
)Description
This PR addresses instances when a traveler in the 'upcoming' range of a bus stop (or the departure point of an itinerary) would see a "Wait for bus" (or "upcoming" instruction) instruction and still be deemed deviated.