mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 00:20:07 +00:00
fix(tours): checklist entries within their contract, whole locks and a leaner reading
A lock flight chained into one group of more than 30 parts broke the checklist's contract and made every decision about it fail; an entry now names its nearest part and the first others, a portage lists at most 30 obstacles and a checklist at most 100 own entries. Reading along a line takes in the parts of a lock the corridor cut off, so its data basis no longer depends on how the route runs. A line or an area stands at the middle of its extent, so adding a node leaves it in place, and an earlier decision is judged by where the obstacle was, not by the route point of its passage. The cache keeps its readings without their lines, for one data version at a time, and the data version is read without the region boundaries.
This commit is contained in:
@@ -213,7 +213,7 @@ export function relateObstaclesToRoute(
|
||||
return related.sort((a, b) => a.alongM - b.alongM);
|
||||
}
|
||||
|
||||
/** Two visits of the route closer than this along it are one passage (a bend that leaves the reach for a moment). */
|
||||
/** Two visits whose closest points lie closer than this along the route are one passage. */
|
||||
export const PASSAGE_GAP_M = 50;
|
||||
/** The most passages one object keeps: an out-and-back tour passes twice, a winding river a few times more. */
|
||||
export const MAX_PASSAGES = 4;
|
||||
@@ -257,9 +257,12 @@ function segmentApproach(
|
||||
|
||||
/**
|
||||
* Every separate time the route comes within `reachM` of an object, in route
|
||||
* order: a run of segments in reach is one visit, two runs closer than
|
||||
* PASSAGE_GAP_M along the route are one, and each visit is anchored where it
|
||||
* comes closest (the earlier point on a tie). An out-and-back tour passes an
|
||||
* order: a run of segments in reach is one visit, anchored where it comes
|
||||
* closest (the earlier point on a tie), and two visits whose anchors lie
|
||||
* closer than PASSAGE_GAP_M along the route are one. Two runs whose anchors
|
||||
* lie further apart stay two passages even when the route left the reach
|
||||
* only briefly between them; that binds a decision to more of the route, so
|
||||
* it errs towards asking for a look again. An out-and-back tour passes an
|
||||
* obstacle twice, so a change to its way back is not missed. At most
|
||||
* MAX_PASSAGES are kept, the closest ones.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user