Skip to content
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

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

binh-dam-ibigroup
Copy link
Collaborator

@binh-dam-ibigroup binh-dam-ibigroup commented Feb 7, 2025

Checklist

  • Appropriate branch selected (all PRs must first be merged to dev before they can be merged to master)
  • Any modified or new methods or classes have helpful JavaDoc and code is thoroughly commented
  • The description lists all applicable issues this PR seeks to resolve
  • The description lists any configuration setting(s) that differ from the default settings
  • All tests and CI builds passing

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.

@binh-dam-ibigroup binh-dam-ibigroup marked this pull request as ready for review February 10, 2025 13:52
Copy link
Contributor

@br648 br648 left a 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.
Copy link
Contributor

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.
Copy link
Contributor

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);
Copy link
Contributor

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) {
Copy link
Contributor

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.

@br648 br648 assigned binh-dam-ibigroup and unassigned br648 Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants