feat(phase-12d): ForcedFlyOverZone — bridge/freeway/water corridor intervals#22
Merged
Merged
Conversation
…tervals
The dual of NoTowerZone. Three case studies in a row surfaced the same
gap: Roosevelt Island Queensboro Bridge, London Thames shipping
channel, Portland OHSU I-5 deck — all man-made obstacles the DEM does
not contain, so the optimizer was producing physically valid but
practically wrong single-span layouts.
ForcedFlyOverZone declares an along-corridor interval where the cable
must clear a minimum absolute elevation. The evaluator penalises any
cable sample inside the zone that sits below min_cable_elev_m, so the
GA gets a smooth gradient pushing tower heights up / inserting
intermediates to lift the cable over the obstacle.
API additions:
- src/ropeway/obstacles.py — ForcedFlyOverZone dataclass with
normalised interval, contains/overlaps_span helpers, deficit_at
(worst below-minimum inside the zone, element-wise on arrays).
- Alignment.forced_flyover_zones (list, defaults []).
- optimize(forced_flyover_zones=[...]) threads the list through to
every alignment built per individual.
Penalty: 5e3 * deficit_m per offending span — same order as the
no-tower-zone weight, so the two zones compete cleanly and the GA
honours both.
Tests: tests/test_forced_flyover.py — 10 new (dataclass invariants,
deficit math, evaluator penalty firing / silent / outside corridor, GA
raises towers to clear, NoTowerZone + ForcedFlyOverZone coexist on the
same corridor). Suite 184 -> 199, zero regressions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dual of
NoTowerZone. Three case studies in a row surfaced the same gap — Roosevelt Island (Queensboro Bridge), London Thames (shipping channel), Portland OHSU (I-5 deck) — all man-made obstacles the DEM does not contain, so the optimizer was producing physically valid but practically wrong single-span layouts.ForcedFlyOverZonedeclares an along-corridor interval where the cable must clear a minimum absolute elevation. The evaluator penalises any cable sample inside the zone that sits belowmin_cable_elev_m, so the GA gets a smooth gradient pushing tower heights up / inserting intermediates to lift the cable over the obstacle.API additions
src/ropeway/obstacles.py—ForcedFlyOverZonedataclass with normalised interval,contains/overlaps_spanhelpers,deficit_at(worst below-minimum inside the zone, element-wise on arrays).Alignment.forced_flyover_zones(list, defaults[]).optimize(forced_flyover_zones=[...])threads the list through to every alignment built per individual.Penalty:
5e3 * deficit_mper offending span — same order as the no-tower-zone weight, so the two zones compete cleanly and the GA honours both.Test plan
tests/test_forced_flyover.py— 10 new tests: dataclass invariants, deficit math, evaluator penalty firing / silent / outside-corridor, GA-raises-towers integration,NoTowerZone+ForcedFlyOverZonecoexistence