Skip to content

Conversation

@miklcct
Copy link
Contributor

@miklcct miklcct commented Aug 6, 2025

Summary

This adjusts the safest street routing to exaggerate the use of safest streets.

This is based on #6782 as the correct heuristics depends on if the normalizer is removed.

Issue

None yet.

The problem here is that, in the original code, safest street has a negligible difference to safe street routing, unless elevation is involved. The original exaggeration code to exaggerate safety factor of < 0.1 does not really happen in practice, as most safe streets (greenways) are around 0.3 to 0.6, and it never happens before the normalizer was removed.

Therefore, I am adjusting it so the safety values used for safest street routing is the original safety squared times 2, and extracted to a helper method. The effect is that, neutral streets will be avoided, dangerous streets will be avoided at all costs, slightly safe streets (about 0.7) will appear neutral, and very safe streets will be safe.

Unit tests

Added

Documentation

N/A

Changelog

N/A

Bumping the serialization version id

N/A

@codecov
Copy link

codecov bot commented Aug 6, 2025

Codecov Report

❌ Patch coverage is 80.51948% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.13%. Comparing base (87cf700) to head (8d2095d).
⚠️ Report is 17 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...r/graph_builder/module/osm/SafetyValueApplier.java 72.72% 9 Missing and 6 partials ⚠️
...ch/strategy/EuclideanRemainingWeightHeuristic.java 78.43% 9 Missing and 2 partials ⚠️
...anner/street/model/StreetLimitationParameters.java 66.66% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6785      +/-   ##
=============================================
- Coverage      72.14%   72.13%   -0.01%     
- Complexity     19673    19681       +8     
=============================================
  Files           2127     2128       +1     
  Lines          79562    79607      +45     
  Branches        8041     8033       -8     
=============================================
+ Hits           57397    57422      +25     
- Misses         19331    19347      +16     
- Partials        2834     2838       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@t2gran t2gran added this to the 2.8 (next release) milestone Aug 11, 2025
# Conflicts:
#	application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java
#	application/src/test/java/org/opentripplanner/routing/algorithm/mapping/__snapshots__/ElevationSnapshotTest.snap
# Conflicts:
#	application/src/main/java/org/opentripplanner/street/search/strategy/EuclideanRemainingWeightHeuristic.java
# Conflicts:
#	application/src/main/java/org/opentripplanner/graph_builder/module/osm/SafetyValueNormalizer.java
#	application/src/test/java/org/opentripplanner/routing/algorithm/mapping/__snapshots__/ElevationSnapshotTest.snap
@t2gran t2gran modified the milestones: 2.8, 2.9 (next release) Sep 10, 2025
# Conflicts:
#	application/src/test/java/org/opentripplanner/routing/algorithm/mapping/__snapshots__/ElevationSnapshotTest.snap
# Conflicts:
#	application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/DirectStreetRouter.java
#	application/src/main/java/org/opentripplanner/routing/impl/GraphPathFinder.java
#	application/src/test/java/org/opentripplanner/astar/AStarTest.java
#	application/src/test/java/org/opentripplanner/routing/algorithm/mapping/__snapshots__/BikeRentalSnapshotTest.snap
#	application/src/test/java/org/opentripplanner/routing/algorithm/mapping/__snapshots__/ElevationSnapshotTest.snap
#	application/src/test/java/org/opentripplanner/street/integration/BikeRentalTest.java
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