minotor 11.2.0 → 11.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -3
- package/dist/cli.mjs +45 -19
- package/dist/cli.mjs.map +1 -1
- package/dist/router.cjs.js +1 -1
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.esm.js +1 -1
- package/dist/router.esm.js.map +1 -1
- package/dist/router.umd.js +1 -1
- package/dist/router.umd.js.map +1 -1
- package/dist/routing/rangeResult.d.ts +21 -1
- package/package.json +1 -1
- package/src/routing/__tests__/rangeResult.test.ts +86 -1
- package/src/routing/__tests__/rangeRouter.test.ts +129 -0
- package/src/routing/rangeResult.ts +21 -1
- package/src/routing/rangeRouter.ts +27 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
## [11.2.1](https://github.com/aubryio/minotor/compare/v11.2.0...v11.2.1) (2026-04-27)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
* range
|
|
6
|
+
* range raptor with no destination should cover the full network ([#68](https://github.com/aubryio/minotor/issues/68)) ([8a47577](https://github.com/aubryio/minotor/commit/8a4757739a84db478443ea2dd77bb6867e4b6851))
|
package/dist/cli.mjs
CHANGED
|
@@ -22493,7 +22493,8 @@ class PlainRouter {
|
|
|
22493
22493
|
* The result of a Range RAPTOR query.
|
|
22494
22494
|
*
|
|
22495
22495
|
* Contains the complete Pareto-optimal set of journeys for a resolved
|
|
22496
|
-
* destination set
|
|
22496
|
+
* destination set, **or** the full per-departure-time routing state when no
|
|
22497
|
+
* destinations were provided (full-network / isochrone mode).
|
|
22497
22498
|
*
|
|
22498
22499
|
* **Pareto dominance**: journey J1 dominates J2 iff
|
|
22499
22500
|
* `τdep(J1) ≥ τdep(J2) AND τarr(J1) ≤ τarr(J2)`
|
|
@@ -22503,6 +22504,15 @@ class PlainRouter {
|
|
|
22503
22504
|
* strictly earlier *and* arrives strictly earlier than the previous one,
|
|
22504
22505
|
* forming the classic staircase Pareto frontier.
|
|
22505
22506
|
*
|
|
22507
|
+
* **Full-network mode** (empty `destinations`): when no destinations are
|
|
22508
|
+
* supplied to the range query every departure slot in the window becomes its
|
|
22509
|
+
* own run, because destination-based Pareto pruning cannot be applied.
|
|
22510
|
+
* In this mode the destination-specific helpers ({@link getRoutes},
|
|
22511
|
+
* {@link bestRoute}, {@link latestDepartureRoute}, {@link fastestRoute})
|
|
22512
|
+
* return empty results; use {@link allEarliestArrivals},
|
|
22513
|
+
* {@link allShortestDurations}, {@link earliestArrivalAt}, or
|
|
22514
|
+
* {@link shortestDurationTo} instead.
|
|
22515
|
+
*
|
|
22506
22516
|
* Destination handling is delegated to {@link Result}, which expands
|
|
22507
22517
|
* equivalent stops when reconstructing routes or looking up arrivals.
|
|
22508
22518
|
*/
|
|
@@ -22528,6 +22538,10 @@ class RangeResult {
|
|
|
22528
22538
|
*
|
|
22529
22539
|
* Each route in the list departs strictly earlier *and* arrives strictly
|
|
22530
22540
|
* earlier than its predecessor.
|
|
22541
|
+
*
|
|
22542
|
+
* Returns an empty array when no destinations were provided (full-network
|
|
22543
|
+
* mode). Use {@link allEarliestArrivals} or {@link allShortestDurations}
|
|
22544
|
+
* to query individual stops in that case.
|
|
22531
22545
|
*/
|
|
22532
22546
|
getRoutes() {
|
|
22533
22547
|
const routes = [];
|
|
@@ -22547,6 +22561,8 @@ class RangeResult {
|
|
|
22547
22561
|
* at a transit stop.
|
|
22548
22562
|
*
|
|
22549
22563
|
* Defaults to this result's own destination stop(s) when `to` is omitted.
|
|
22564
|
+
* Always pass an explicit `to` stop when operating in full-network mode
|
|
22565
|
+
* (no destinations), otherwise `undefined` is returned.
|
|
22550
22566
|
*
|
|
22551
22567
|
* @param to Optional destination stop ID or set of stop IDs.
|
|
22552
22568
|
* @returns The reconstructed {@link Route} with the earliest arrival,
|
|
@@ -22579,6 +22595,8 @@ class RangeResult {
|
|
|
22579
22595
|
* {@link fastestRoute}.
|
|
22580
22596
|
*
|
|
22581
22597
|
* Defaults to this result's own destination stop(s) when `to` is omitted.
|
|
22598
|
+
* Always pass an explicit `to` stop when operating in full-network mode
|
|
22599
|
+
* (no destinations), otherwise `undefined` is returned.
|
|
22582
22600
|
*
|
|
22583
22601
|
* @param to Optional destination stop ID or set of stop IDs.
|
|
22584
22602
|
* @returns The reconstructed {@link Route} with the latest departure,
|
|
@@ -22603,6 +22621,8 @@ class RangeResult {
|
|
|
22603
22621
|
* spent traveling.
|
|
22604
22622
|
*
|
|
22605
22623
|
* Defaults to this result's own destination stop(s) when `to` is omitted.
|
|
22624
|
+
* Always pass an explicit `to` stop when operating in full-network mode
|
|
22625
|
+
* (no destinations), otherwise `undefined` is returned.
|
|
22606
22626
|
*
|
|
22607
22627
|
* @param to Optional destination stop ID or set of stop IDs.
|
|
22608
22628
|
* @returns The reconstructed fastest {@link Route}, or `undefined` if the
|
|
@@ -22853,6 +22873,7 @@ class RangeRouter {
|
|
|
22853
22873
|
const destinations = Array.from(query.to)
|
|
22854
22874
|
.flatMap((destination) => this.stopsIndex.equivalentStops(destination))
|
|
22855
22875
|
.map((destination) => destination.id);
|
|
22876
|
+
const noDestinations = destinations.length === 0;
|
|
22856
22877
|
const accessLegs = this.accessFinder.collectAccessPaths(query.from, query.options.minTransferTime);
|
|
22857
22878
|
const departureSlots = this.accessFinder.collectDepartureTimes(accessLegs, earliest, latest);
|
|
22858
22879
|
if (departureSlots.length === 0) {
|
|
@@ -22874,15 +22895,18 @@ class RangeRouter {
|
|
|
22874
22895
|
routingState = new RoutingState(latest + 1, destinations, accessLegs, this.timetable.nbStops(), maxRounds);
|
|
22875
22896
|
rangeState.setCurrentRun(routingState);
|
|
22876
22897
|
this.raptor.run(Object.assign(Object.assign({}, query.options), { maxInitialWaitingTime: undefined }), rangeState);
|
|
22877
|
-
|
|
22878
|
-
const
|
|
22879
|
-
|
|
22880
|
-
paretoDestBest.
|
|
22898
|
+
if (!noDestinations) {
|
|
22899
|
+
for (const dest of destinations) {
|
|
22900
|
+
const t = routingState.arrivalTime(dest);
|
|
22901
|
+
if (t < ((_a = paretoDestBest.get(dest)) !== null && _a !== void 0 ? _a : UNREACHED_TIME))
|
|
22902
|
+
paretoDestBest.set(dest, t);
|
|
22903
|
+
}
|
|
22881
22904
|
}
|
|
22882
22905
|
}
|
|
22883
22906
|
for (const { depTime, legs } of departureSlots) {
|
|
22884
|
-
if (trivialDestCovered.size === destinations.length)
|
|
22907
|
+
if (!noDestinations && trivialDestCovered.size === destinations.length) {
|
|
22885
22908
|
break;
|
|
22909
|
+
}
|
|
22886
22910
|
if (routingState === null) {
|
|
22887
22911
|
routingState = new RoutingState(depTime, destinations, legs, this.timetable.nbStops(), maxRounds);
|
|
22888
22912
|
}
|
|
@@ -22891,21 +22915,23 @@ class RangeRouter {
|
|
|
22891
22915
|
}
|
|
22892
22916
|
rangeState.setCurrentRun(routingState);
|
|
22893
22917
|
this.raptor.run(Object.assign(Object.assign({}, query.options), { maxInitialWaitingTime: 0 }), rangeState);
|
|
22894
|
-
let isParetoOptimal =
|
|
22895
|
-
|
|
22896
|
-
const
|
|
22897
|
-
|
|
22898
|
-
|
|
22899
|
-
|
|
22900
|
-
|
|
22918
|
+
let isParetoOptimal = noDestinations;
|
|
22919
|
+
if (!noDestinations) {
|
|
22920
|
+
for (const dest of destinations) {
|
|
22921
|
+
const arrival = routingState.arrivalTime(dest);
|
|
22922
|
+
if (arrival >= ((_b = paretoDestBest.get(dest)) !== null && _b !== void 0 ? _b : UNREACHED_TIME)) {
|
|
22923
|
+
continue;
|
|
22924
|
+
}
|
|
22925
|
+
if (trivialDests.has(dest) && trivialDestCovered.has(dest)) {
|
|
22926
|
+
paretoDestBest.set(dest, arrival);
|
|
22927
|
+
continue;
|
|
22928
|
+
}
|
|
22901
22929
|
paretoDestBest.set(dest, arrival);
|
|
22902
|
-
|
|
22903
|
-
|
|
22904
|
-
|
|
22905
|
-
|
|
22906
|
-
trivialDestCovered.add(dest);
|
|
22930
|
+
if (trivialDests.has(dest)) {
|
|
22931
|
+
trivialDestCovered.add(dest);
|
|
22932
|
+
}
|
|
22933
|
+
isParetoOptimal = true;
|
|
22907
22934
|
}
|
|
22908
|
-
isParetoOptimal = true;
|
|
22909
22935
|
}
|
|
22910
22936
|
if (isParetoOptimal) {
|
|
22911
22937
|
paretoRuns.push({
|