minotor 7.0.0 → 7.0.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 -8
- package/dist/cli.mjs +27 -21
- package/dist/cli.mjs.map +1 -1
- package/dist/parser.cjs.js +24 -18
- package/dist/parser.cjs.js.map +1 -1
- package/dist/parser.esm.js +24 -18
- package/dist/parser.esm.js.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/router.d.ts +1 -1
- package/package.json +1 -1
- package/src/routing/router.ts +3 -3
- package/src/timetable/route.ts +23 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
## [7.0.1](https://github.com/aubryio/minotor/compare/v7.0.0...v7.0.1) (2025-09-23)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### BREAKING CHANGES
|
|
10
|
-
|
|
11
|
-
* Timetable binary format was updated and is not compatible with the old one.
|
|
6
|
+
* address corner cases with boarding conditions ([#27](https://github.com/aubryio/minotor/issues/27)) ([cd5fe68](https://github.com/aubryio/minotor/commit/cd5fe682ca359872a6bac46dbdc30ec9d603c8ef))
|
package/dist/cli.mjs
CHANGED
|
@@ -17314,29 +17314,35 @@ let Route$1 = class Route {
|
|
|
17314
17314
|
* @returns The index of the earliest trip meeting the criteria, or undefined if no such trip is found.
|
|
17315
17315
|
*/
|
|
17316
17316
|
findEarliestTrip(stopId, after = Time.origin(), beforeTrip) {
|
|
17317
|
-
|
|
17318
|
-
? Math.min(beforeTrip - 1, this.nbTrips - 1)
|
|
17319
|
-
: this.nbTrips - 1;
|
|
17320
|
-
if (maxTripIndex < 0) {
|
|
17317
|
+
if (this.nbTrips <= 0)
|
|
17321
17318
|
return undefined;
|
|
17322
|
-
|
|
17323
|
-
|
|
17324
|
-
|
|
17325
|
-
|
|
17326
|
-
|
|
17327
|
-
|
|
17328
|
-
|
|
17329
|
-
|
|
17330
|
-
|
|
17331
|
-
|
|
17332
|
-
|
|
17333
|
-
|
|
17319
|
+
let hi = this.nbTrips - 1;
|
|
17320
|
+
if (beforeTrip !== undefined)
|
|
17321
|
+
hi = Math.min(hi, beforeTrip - 1);
|
|
17322
|
+
if (hi < 0)
|
|
17323
|
+
return undefined;
|
|
17324
|
+
let lo = 0;
|
|
17325
|
+
let lb = -1;
|
|
17326
|
+
while (lo <= hi) {
|
|
17327
|
+
const mid = (lo + hi) >>> 1;
|
|
17328
|
+
const depMid = this.departureFrom(stopId, mid);
|
|
17329
|
+
if (depMid.isBefore(after)) {
|
|
17330
|
+
lo = mid + 1;
|
|
17334
17331
|
}
|
|
17335
17332
|
else {
|
|
17336
|
-
|
|
17333
|
+
lb = mid;
|
|
17334
|
+
hi = mid - 1;
|
|
17335
|
+
}
|
|
17336
|
+
}
|
|
17337
|
+
if (lb === -1)
|
|
17338
|
+
return undefined;
|
|
17339
|
+
for (let t = lb; t < (beforeTrip !== null && beforeTrip !== void 0 ? beforeTrip : this.nbTrips); t++) {
|
|
17340
|
+
const pickup = this.pickUpTypeFrom(stopId, t);
|
|
17341
|
+
if (pickup !== 'NOT_AVAILABLE') {
|
|
17342
|
+
return t;
|
|
17337
17343
|
}
|
|
17338
17344
|
}
|
|
17339
|
-
return
|
|
17345
|
+
return undefined;
|
|
17340
17346
|
}
|
|
17341
17347
|
/**
|
|
17342
17348
|
* Retrieves the index of a stop within the route.
|
|
@@ -20801,7 +20807,7 @@ class Result {
|
|
|
20801
20807
|
|
|
20802
20808
|
const UNREACHED = Time.infinity();
|
|
20803
20809
|
/**
|
|
20804
|
-
* A public transportation network router
|
|
20810
|
+
* A public transportation network router implementing the RAPTOR algorithm for
|
|
20805
20811
|
* efficient journey planning and routing. For more information on the RAPTOR
|
|
20806
20812
|
* algorithm, refer to its detailed explanation in the research paper:
|
|
20807
20813
|
* https://www.microsoft.com/en-us/research/wp-content/uploads/2012/01/raptor_alenex.pdf
|
|
@@ -20976,8 +20982,8 @@ class Router {
|
|
|
20976
20982
|
const earliestArrivalOnPreviousRound = (_c = arrivalsAtPreviousRound.get(currentStop)) === null || _c === void 0 ? void 0 : _c.arrival;
|
|
20977
20983
|
if (earliestArrivalOnPreviousRound !== undefined &&
|
|
20978
20984
|
(currentTrip === undefined ||
|
|
20979
|
-
earliestArrivalOnPreviousRound.isBefore(route.
|
|
20980
|
-
earliestArrivalOnPreviousRound.equals(route.
|
|
20985
|
+
earliestArrivalOnPreviousRound.isBefore(route.departureFrom(currentStop, currentTrip.tripIndex)) ||
|
|
20986
|
+
earliestArrivalOnPreviousRound.equals(route.departureFrom(currentStop, currentTrip.tripIndex)))) {
|
|
20981
20987
|
const earliestTrip = route.findEarliestTrip(currentStop, earliestArrivalOnPreviousRound, currentTrip === null || currentTrip === void 0 ? void 0 : currentTrip.tripIndex);
|
|
20982
20988
|
if (earliestTrip !== undefined) {
|
|
20983
20989
|
currentTrip = {
|