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

[feature] keep the original order of vehicle journeys #784

Merged
merged 1 commit into from
May 31, 2021

Conversation

woshilapin
Copy link
Contributor

@woshilapin woshilapin commented May 28, 2021

Using a HashMap to filter the VehicleJourney then iterating again over them makes the final order of VehicleJourney completely random compare to the input order. This is not really desirable for two reasons:

  • why modifying the input order at all? I wouldn't think this would be expected from an end-user
  • running twice the same binary might actually produce 2 different orders due to the fact that HashMap is randomized at runtime: it might actually cause some problems for testing

Note that we're talking about transit_model library end-users (using Model). The binaries will also write the output files in different order but semantically, the model is still the same so it's not incorrect.

This modification should barely impact the performance since this is not really changing how the algorithm works.

🔍 Hint - to ease the review, hide whitespace changes

@woshilapin woshilapin merged commit fdd3338 into master May 31, 2021
@woshilapin woshilapin deleted the deterministic-sanitizing branch May 31, 2021 12:56
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.

3 participants