navi/backend/services/navi_offroute/tests
Matt 3fd07eea91 fix(offroute): smooth max_grade penalty instead of hard cliff (DEM noise robustness)
A single noisy DEM cell could fabricate a huge fake slope and make an edge
unconditionally impassable, forcing the pathfinder to route around passable terrain.
Replace the hard cliff (|grade|>max_grade -> skip) with a smooth exponential penalty:
no penalty up to max_grade, then base_time *= exp(overshoot * SLOPE_PENALTY_SCALE);
only grades whose penalty exceeds SLOPE_PENALTY_CAP (true bad data / vertical) are
dropped. Routing can now see through noisy cells while still strongly avoiding real
cliffs. Penalty only raises edge cost, so the heuristic stays admissible.

2 tests: smooth penalty traverses a >max_grade gap (finite, raised cost) yet routes
around / drops a past-cap grade; exactly-at-threshold grade incurs no penalty.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 15:34:18 +00:00
..
__init__.py Add navi-offroute service (extraction #8 — final) (#10) 2026-05-22 23:30:43 -06:00
test_offroute.py fix(offroute): smooth max_grade penalty instead of hard cliff (DEM noise robustness) 2026-05-25 15:34:18 +00:00