minotor 11.1.3 → 11.2.0
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/.cspell.json +7 -1
- package/CHANGELOG.md +3 -3
- package/README.md +111 -86
- package/dist/cli/perf.d.ts +57 -18
- package/dist/cli.mjs +1349 -345
- package/dist/cli.mjs.map +1 -1
- package/dist/parser.cjs.js +57 -4
- package/dist/parser.cjs.js.map +1 -1
- package/dist/parser.esm.js +57 -4
- 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.d.ts +5 -5
- 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/__tests__/access.test.d.ts +1 -0
- package/dist/routing/__tests__/plainRouter.test.d.ts +1 -0
- package/dist/routing/__tests__/rangeResult.test.d.ts +1 -0
- package/dist/routing/__tests__/rangeRouter.test.d.ts +1 -0
- package/dist/routing/__tests__/rangeState.test.d.ts +1 -0
- package/dist/routing/__tests__/raptor.test.d.ts +1 -0
- package/dist/routing/__tests__/state.test.d.ts +1 -0
- package/dist/routing/access.d.ts +55 -0
- package/dist/routing/plainRouter.d.ts +21 -0
- package/dist/routing/plotter.d.ts +9 -0
- package/dist/routing/query.d.ts +132 -13
- package/dist/routing/rangeResult.d.ts +155 -0
- package/dist/routing/rangeRouter.d.ts +24 -0
- package/dist/routing/rangeState.d.ts +83 -0
- package/dist/routing/raptor.d.ts +96 -0
- package/dist/routing/result.d.ts +27 -7
- package/dist/routing/route.d.ts +5 -21
- package/dist/routing/router.d.ts +20 -91
- package/dist/routing/state.d.ts +74 -17
- package/dist/timetable/route.d.ts +8 -0
- package/dist/timetable/timetable.d.ts +17 -1
- package/package.json +1 -1
- package/src/__e2e__/benchmark.json +18 -0
- package/src/__e2e__/router.test.ts +461 -127
- package/src/cli/minotor.ts +39 -3
- package/src/cli/perf.ts +324 -60
- package/src/cli/repl.ts +96 -41
- package/src/router.ts +11 -3
- package/src/routing/__tests__/access.test.ts +294 -0
- package/src/routing/__tests__/plainRouter.test.ts +1633 -0
- package/src/routing/__tests__/plotter.test.ts +8 -8
- package/src/routing/__tests__/rangeResult.test.ts +273 -0
- package/src/routing/__tests__/rangeRouter.test.ts +472 -0
- package/src/routing/__tests__/rangeState.test.ts +246 -0
- package/src/routing/__tests__/raptor.test.ts +366 -0
- package/src/routing/__tests__/result.test.ts +27 -27
- package/src/routing/__tests__/route.test.ts +28 -0
- package/src/routing/__tests__/router.test.ts +75 -1587
- package/src/routing/__tests__/state.test.ts +78 -0
- package/src/routing/access.ts +144 -0
- package/src/routing/plainRouter.ts +60 -0
- package/src/routing/plotter.ts +53 -6
- package/src/routing/query.ts +116 -13
- package/src/routing/rangeResult.ts +292 -0
- package/src/routing/rangeRouter.ts +167 -0
- package/src/routing/rangeState.ts +150 -0
- package/src/routing/raptor.ts +416 -0
- package/src/routing/result.ts +68 -26
- package/src/routing/route.ts +15 -53
- package/src/routing/router.ts +40 -480
- package/src/routing/state.ts +165 -32
- package/src/timetable/__tests__/timetable.test.ts +373 -0
- package/src/timetable/route.ts +16 -4
- package/src/timetable/timetable.ts +54 -1
package/.cspell.json
CHANGED
|
@@ -17,9 +17,12 @@
|
|
|
17
17
|
"Dolderbahn",
|
|
18
18
|
"dolmuş",
|
|
19
19
|
"dropoff",
|
|
20
|
+
"dests",
|
|
20
21
|
"Dymchurch",
|
|
22
|
+
"empts",
|
|
21
23
|
"Engadin",
|
|
22
24
|
"Eurostar",
|
|
25
|
+
"ffbt",
|
|
23
26
|
"fontname",
|
|
24
27
|
"Francey",
|
|
25
28
|
"funi",
|
|
@@ -58,6 +61,7 @@
|
|
|
58
61
|
"nodesep",
|
|
59
62
|
"Olten",
|
|
60
63
|
"penwidth",
|
|
64
|
+
"platz",
|
|
61
65
|
"protoc",
|
|
62
66
|
"rankdir",
|
|
63
67
|
"ranksep",
|
|
@@ -76,7 +80,9 @@
|
|
|
76
80
|
"Tilleul",
|
|
77
81
|
"Tpng",
|
|
78
82
|
"Tsvg",
|
|
79
|
-
"Wokingham"
|
|
83
|
+
"Wokingham",
|
|
84
|
+
"τdep",
|
|
85
|
+
"τarr"
|
|
80
86
|
],
|
|
81
87
|
"flagWords": [],
|
|
82
88
|
"ignorePaths": [
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
# [11.2.0](https://github.com/aubryio/minotor/compare/v11.1.3...v11.2.0) (2026-04-27)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Features
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* range queries support ([#67](https://github.com/aubryio/minotor/issues/67)) ([39d1dd3](https://github.com/aubryio/minotor/commit/39d1dd3ecd17070a1e49bfded3bbb0888594a77b)), closes [#31](https://github.com/aubryio/minotor/issues/31) [#62](https://github.com/aubryio/minotor/issues/62)
|
package/README.md
CHANGED
|
@@ -10,10 +10,10 @@ Unlike most transit planners out there, **minotor** can store all the transit da
|
|
|
10
10
|
This is particularly useful for highly dynamic applications or complex visualizations for research purposes where the user needs to query the data in real-time.
|
|
11
11
|
Privacy-conscious applications where the user does not want to share their location data with a server can also benefit from this model.
|
|
12
12
|
|
|
13
|
-
The transit router and the stops index of **minotor** can run in the browser, on
|
|
14
|
-
Transit data (GTFS) parsing runs on Node.js, and the resulting data is serialized as a protobuf binary that can be loaded
|
|
13
|
+
The transit router and the stops index of **minotor** can run in the browser, on React Native or in a Node.js environment.
|
|
14
|
+
Transit data (GTFS) parsing runs on Node.js, and the resulting data is serialized as a protobuf binary that can be loaded by the router.
|
|
15
15
|
|
|
16
|
-
Minotor routing algorithm is mostly based on RAPTOR. See [Round-Based Public Transit Routing, D. Delling et al. 2012](https://www.microsoft.com/en-us/research/wp-content/uploads/2012/01/raptor_alenex.pdf).
|
|
16
|
+
Minotor's routing algorithm is mostly based on RAPTOR. See [Round-Based Public Transit Routing, D. Delling et al. 2012](https://www.microsoft.com/en-us/research/wp-content/uploads/2012/01/raptor_alenex.pdf).
|
|
17
17
|
|
|
18
18
|
## Examples
|
|
19
19
|
|
|
@@ -34,15 +34,16 @@ A more complete isochrone map showcase can be found on [isochrone.ch](https://is
|
|
|
34
34
|
## Features
|
|
35
35
|
|
|
36
36
|
- GTFS feed parsing (standard and extended)
|
|
37
|
-
- Geographic and textual
|
|
38
|
-
-
|
|
39
|
-
-
|
|
37
|
+
- Geographic and textual stop search
|
|
38
|
+
- **Point queries** — earliest-arrival journey from an origin to a destination at a given time
|
|
39
|
+
- **Range queries** — all Pareto-optimal journeys within a departure-time window
|
|
40
|
+
- Isochrone computation — earliest arrival times / fastest routes to every reachable stop
|
|
40
41
|
|
|
41
42
|
### Tested GTFS feeds
|
|
42
43
|
|
|
43
|
-
| Feed | Parsing time | Timetable
|
|
44
|
+
| Feed | Parsing time | Timetable size for a day (compressed) |
|
|
44
45
|
| ------------------------------------------------------------------------------------------ | ------------ | ------------------------------------- |
|
|
45
|
-
| [Swiss GTFS feed](https://data.opentransportdata.swiss/en/dataset/timetable-2026-gtfs2020) | ~2 minutes | 20 MB (
|
|
46
|
+
| [Swiss GTFS feed](https://data.opentransportdata.swiss/en/dataset/timetable-2026-gtfs2020) | ~2 minutes | 20 MB (5 MB) |
|
|
46
47
|
|
|
47
48
|
## Get started
|
|
48
49
|
|
|
@@ -50,11 +51,11 @@ A more complete isochrone map showcase can be found on [isochrone.ch](https://is
|
|
|
50
51
|
|
|
51
52
|
`npm i minotor`
|
|
52
53
|
|
|
53
|
-
###
|
|
54
|
+
### TypeScript API
|
|
54
55
|
|
|
55
|
-
#### GTFS
|
|
56
|
+
#### GTFS feed parsing (Node.js only)
|
|
56
57
|
|
|
57
|
-
```
|
|
58
|
+
```ts
|
|
58
59
|
import { GtfsParser, extendedGtfsProfile } from 'minotor/parser';
|
|
59
60
|
|
|
60
61
|
const parser = new GtfsParser('gtfs-feed.zip', extendedGtfsProfile);
|
|
@@ -62,87 +63,125 @@ const timetable = await parser.parseTimetable(new Date());
|
|
|
62
63
|
const stopsIndex = await parser.parseStops();
|
|
63
64
|
```
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
Times are represented at the minute level (16-bit integers). Parsing can take a few minutes for large feeds.
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
#### Stop search (browser or Node.js)
|
|
68
69
|
|
|
69
|
-
|
|
70
|
+
```ts
|
|
71
|
+
// Text search (supports partial names and accents)
|
|
72
|
+
const results = stopsIndex.findStopsByName('Fribourg');
|
|
70
73
|
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
+
// Lookup by source ID from the GTFS feed
|
|
75
|
+
const platform = stopsIndex.findStopBySourceStopId('8504100:0:2');
|
|
76
|
+
|
|
77
|
+
// Nearest stops within 500 m
|
|
78
|
+
const nearby = stopsIndex.findStopsByLocation(46.803, 7.151, 5, 0.5);
|
|
74
79
|
```
|
|
75
80
|
|
|
76
|
-
|
|
81
|
+
#### Point query (browser or Node.js)
|
|
77
82
|
|
|
78
|
-
|
|
83
|
+
Find the earliest-arrival journey departing at a specific time:
|
|
79
84
|
|
|
80
|
-
|
|
85
|
+
```ts
|
|
86
|
+
import { Query, Router } from 'minotor';
|
|
81
87
|
|
|
82
|
-
|
|
88
|
+
const router = new Router(timetable, stopsIndex);
|
|
83
89
|
|
|
84
|
-
|
|
90
|
+
const [origin] = stopsIndex.findStopsByName('Fribourg/Freiburg');
|
|
91
|
+
const [destination] = stopsIndex.findStopsByName('Moléson-sur-Gruyères');
|
|
85
92
|
|
|
86
|
-
|
|
87
|
-
|
|
93
|
+
const result = router.route(
|
|
94
|
+
new Query.Builder()
|
|
95
|
+
.from(origin.id)
|
|
96
|
+
.to(destination.id)
|
|
97
|
+
.departureTime(8 * 60 + 30) // 08:30 in minutes from midnight
|
|
98
|
+
.maxTransfers(3)
|
|
99
|
+
.build(),
|
|
100
|
+
);
|
|
88
101
|
|
|
89
|
-
const
|
|
102
|
+
const route = result.bestRoute(); // Route | undefined
|
|
90
103
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
.to('Parent8504748')
|
|
94
|
-
.departureTime(8*60)
|
|
95
|
-
.maxTransfers(5)
|
|
96
|
-
.build();
|
|
97
|
-
const result = router.route(query);
|
|
104
|
+
// Earliest arrival at any individual stop (useful for isochrone computation)
|
|
105
|
+
const arrival = result.arrivalAt(stop.id); // { arrival: Time, legNumber: number } | undefined
|
|
98
106
|
```
|
|
99
107
|
|
|
100
|
-
|
|
108
|
+
Query options:
|
|
101
109
|
|
|
102
|
-
|
|
110
|
+
| Option | Default | Description |
|
|
111
|
+
| ----------------------- | --------- | ---------------------------------------------------------------------- |
|
|
112
|
+
| `maxTransfers` | `5` | Maximum number of transfers |
|
|
113
|
+
| `minTransferTime` | `2 min` | Fallback minimum transfer time |
|
|
114
|
+
| `maxInitialWaitingTime` | unlimited | Maximum wait for the first vehicle after arriving at the boarding stop |
|
|
115
|
+
| `transportModes` | all | Restrict to a subset of GTFS route types |
|
|
103
116
|
|
|
104
|
-
|
|
105
|
-
This time will be correct for any stop reachable before the first query destination reached.
|
|
117
|
+
#### Range query (browser or Node.js)
|
|
106
118
|
|
|
107
|
-
|
|
119
|
+
Find all Pareto-optimal journeys within a departure-time window — no journey in the result is dominated by another (i.e. no journey departs later _and_ arrives earlier):
|
|
108
120
|
|
|
109
|
-
|
|
121
|
+
```ts
|
|
122
|
+
import { RangeQuery, Router } from 'minotor';
|
|
110
123
|
|
|
111
|
-
|
|
124
|
+
const rangeResult = router.rangeRoute(
|
|
125
|
+
new RangeQuery.Builder()
|
|
126
|
+
.from(origin.id)
|
|
127
|
+
.to(destination.id)
|
|
128
|
+
.departureTime(8 * 60) // window start: 08:00
|
|
129
|
+
.lastDepartureTime(10 * 60) // window end: 10:00
|
|
130
|
+
.maxTransfers(3)
|
|
131
|
+
.build(),
|
|
132
|
+
);
|
|
112
133
|
|
|
113
|
-
|
|
134
|
+
console.log(rangeResult.size); // number of Pareto-optimal journeys
|
|
135
|
+
|
|
136
|
+
// Iterate runs latest-departure-first
|
|
137
|
+
for (const { departureTime, result } of rangeResult) {
|
|
138
|
+
const route = result.bestRoute();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Or pick a specific journey
|
|
142
|
+
const earliest = rangeResult.bestRoute(); // earliest arrival
|
|
143
|
+
const latest = rangeResult.latestDepartureRoute(); // latest possible departure
|
|
144
|
+
const fastest = rangeResult.fastestRoute(); // shortest travel duration
|
|
145
|
+
const all = rangeResult.getRoutes(); // all routes, earliest-departure-first
|
|
146
|
+
|
|
147
|
+
// Earliest arrival at every reachable stop across all runs
|
|
148
|
+
const arrivals = rangeResult.allEarliestArrivals(); // Map<StopId, Arrival>
|
|
149
|
+
const durations = rangeResult.allShortestDurations(); // Map<StopId, DurationArrival>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### CLI Usage
|
|
114
153
|
|
|
115
|
-
|
|
116
|
-
|
|
154
|
+
Parse GTFS data for today and save the timetable and stops index to `/tmp`:
|
|
155
|
+
|
|
156
|
+
`minotor parse-gtfs gtfs_feed.zip`
|
|
117
157
|
|
|
118
|
-
|
|
158
|
+
Start the interactive REPL:
|
|
119
159
|
|
|
120
160
|
`minotor repl`
|
|
121
161
|
|
|
122
|
-
Search stops
|
|
162
|
+
Search stops:
|
|
123
163
|
|
|
124
164
|
`minotor> .find moleson`
|
|
125
165
|
|
|
126
|
-
Query
|
|
166
|
+
Query a route:
|
|
127
167
|
|
|
128
168
|
`minotor> .route from fribourg to moleson at 08:00`
|
|
129
169
|
|
|
170
|
+
Run `minotor parse-gtfs -h` and `minotor repl -h` for all available options.
|
|
171
|
+
|
|
130
172
|
## Development
|
|
131
173
|
|
|
132
174
|
### Requirements
|
|
133
175
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
`protoc` also needs to be available on the build system.
|
|
176
|
+
A working [Node.js](https://nodejs.org) environment and `protoc`:
|
|
137
177
|
|
|
138
178
|
Ubuntu: `apt install -y protobuf-compiler` |
|
|
139
179
|
Fedora: `dnf install -y protobuf-compiler` |
|
|
140
|
-
|
|
180
|
+
macOS: `brew install protobuf`
|
|
141
181
|
|
|
142
182
|
### Debugging
|
|
143
183
|
|
|
144
|
-
|
|
145
|
-
of the router.
|
|
184
|
+
The REPL (`minotor repl`) exposes several inspection tools.
|
|
146
185
|
|
|
147
186
|
#### Inspect a stop
|
|
148
187
|
|
|
@@ -154,48 +193,34 @@ of the router.
|
|
|
154
193
|
|
|
155
194
|
#### Plot the routing graph
|
|
156
195
|
|
|
157
|
-
|
|
196
|
+
Requires [Graphviz](https://graphviz.org):
|
|
158
197
|
|
|
159
198
|
Ubuntu: `apt install -y graphviz` |
|
|
160
199
|
Fedora: `dnf install -y graphviz` |
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
`minotor> .plot from <stationId> to <stationId> at <HH:mm> [with <N> transfers] [to <graph.dot>]`
|
|
164
|
-
|
|
165
|
-
`dot -Ksfdp -Tsvg graph.dot -o graph.svg`
|
|
166
|
-
|
|
167
|
-
### Build
|
|
168
|
-
|
|
169
|
-
- `build`: builds the project in the `dist/` directory
|
|
170
|
-
- `clean`: removes the `dist/` directory
|
|
171
|
-
|
|
172
|
-
### Unit Tests
|
|
173
|
-
|
|
174
|
-
- `test`: runs unit tests
|
|
175
|
-
- `test:coverage`: runs unit test runner with coverage reports
|
|
200
|
+
macOS: `brew install graphviz`
|
|
176
201
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
-
|
|
180
|
-
|
|
181
|
-
### Performance Tests
|
|
182
|
-
|
|
183
|
-
- `perf`: runs a basic performance test, using a real data from a day in the Swiss GTFS dataset
|
|
184
|
-
|
|
185
|
-
Note that performance tests are not included in the CI pipeline and must be run manually.
|
|
186
|
-
|
|
187
|
-
### Formatting & linting
|
|
188
|
-
|
|
189
|
-
- `lint`: ESLint with automatic fixing
|
|
190
|
-
- `format`: Prettier with automatic fixing
|
|
191
|
-
- `spell:check`: Spell checker
|
|
202
|
+
```
|
|
203
|
+
minotor> .plot from <station> to <station> at <HH:mm> [with <N> transfers] [to <graph.dot>]
|
|
204
|
+
dot -Ksfdp -Tsvg graph.dot -o graph.svg
|
|
205
|
+
```
|
|
192
206
|
|
|
193
|
-
###
|
|
207
|
+
### Scripts
|
|
194
208
|
|
|
195
|
-
|
|
209
|
+
| Script | Description |
|
|
210
|
+
| --------------- | --------------------------------------------- |
|
|
211
|
+
| `build` | Compile to `dist/` |
|
|
212
|
+
| `clean` | Remove `dist/` |
|
|
213
|
+
| `test` | Run unit tests |
|
|
214
|
+
| `test:coverage` | Unit tests with coverage |
|
|
215
|
+
| `e2e` | End-to-end tests against real Swiss GTFS data |
|
|
216
|
+
| `perf` | Performance benchmark (not in CI) |
|
|
217
|
+
| `lint` | ESLint with auto-fix |
|
|
218
|
+
| `format` | Prettier with auto-fix |
|
|
219
|
+
| `spell:check` | Spell checker |
|
|
220
|
+
| `cz` | Generate a Commitizen commit message |
|
|
196
221
|
|
|
197
|
-
Releases are automatically published to npm
|
|
222
|
+
Releases are automatically published to npm on merge to `main` (stable) or `beta` (pre-release).
|
|
198
223
|
|
|
199
224
|
## Roadmap and requests
|
|
200
225
|
|
|
201
|
-
The project is under active development
|
|
226
|
+
The project is under active development. Use GitHub issues for bug reports and feature requests. For custom development, consulting, integrations, or other inquiries, feel free to contact [the author](https://aubry.io/).
|
package/dist/cli/perf.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Query, Router, StopsIndex } from '../router.js';
|
|
1
|
+
import { Query, RangeQuery, Router, StopsIndex } from '../router.js';
|
|
2
2
|
type PerformanceResult = {
|
|
3
|
-
|
|
3
|
+
label: string;
|
|
4
4
|
meanTimeUs: number;
|
|
5
5
|
meanMemoryMb: number;
|
|
6
6
|
};
|
|
@@ -8,11 +8,8 @@ type PerformanceResult = {
|
|
|
8
8
|
* Loads a list of routing queries from a JSON file and resolves the
|
|
9
9
|
* human-readable stop IDs to the internal numeric IDs used by the router.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* { "from": "STOP_A", "to": ["STOP_B", "STOP_C"], "departureTime": "08:30:00" }
|
|
14
|
-
* ```
|
|
15
|
-
* An optional `maxTransfers` integer field is also supported.
|
|
11
|
+
* Only entries that do **not** carry a `lastDepartureTime` field are loaded —
|
|
12
|
+
* range-query entries are silently skipped.
|
|
16
13
|
*
|
|
17
14
|
* @param filePath - Path to the JSON file containing the serialized queries.
|
|
18
15
|
* @param stopsIndex - The stops index used to resolve source stop IDs to the
|
|
@@ -23,6 +20,22 @@ type PerformanceResult = {
|
|
|
23
20
|
* referenced in the file cannot be found in the stops index.
|
|
24
21
|
*/
|
|
25
22
|
export declare const loadQueriesFromJson: (filePath: string, stopsIndex: StopsIndex) => Query[];
|
|
23
|
+
/**
|
|
24
|
+
* Loads a list of range routing queries from a JSON file and resolves the
|
|
25
|
+
* human-readable stop IDs to the internal numeric IDs used by the router.
|
|
26
|
+
*
|
|
27
|
+
* Only entries that carry a `lastDepartureTime` field are loaded — plain
|
|
28
|
+
* point-query entries are silently skipped.
|
|
29
|
+
*
|
|
30
|
+
* @param filePath - Path to the JSON file containing the serialized queries.
|
|
31
|
+
* @param stopsIndex - The stops index used to resolve source stop IDs to the
|
|
32
|
+
* internal numeric IDs expected by the router.
|
|
33
|
+
* @returns An array of fully constructed {@link RangeQuery} objects ready to
|
|
34
|
+
* be passed to {@link Router.rangeRoute}.
|
|
35
|
+
* @throws If the file cannot be read, the JSON is malformed, or any stop ID
|
|
36
|
+
* referenced in the file cannot be found in the stops index.
|
|
37
|
+
*/
|
|
38
|
+
export declare const loadRangeQueriesFromJson: (filePath: string, stopsIndex: StopsIndex) => RangeQuery[];
|
|
26
39
|
/**
|
|
27
40
|
* Benchmarks {@link Router.route} across a set of queries.
|
|
28
41
|
*
|
|
@@ -31,10 +44,11 @@ export declare const loadQueriesFromJson: (filePath: string, stopsIndex: StopsIn
|
|
|
31
44
|
* produced per query.
|
|
32
45
|
* @param iterations - Number of times each query is repeated. Higher values
|
|
33
46
|
* yield a more stable mean at the cost of longer wall-clock time.
|
|
47
|
+
* @param stopsIndex - Used to resolve stop names for result labels.
|
|
34
48
|
* @returns An array of {@link PerformanceResult} objects, one per query, each
|
|
35
49
|
* containing the mean wall-clock time (µs) and mean heap delta (MB).
|
|
36
50
|
*/
|
|
37
|
-
export declare const testRouterPerformance: (router: Router, tasks: Query[], iterations: number) => PerformanceResult[];
|
|
51
|
+
export declare const testRouterPerformance: (router: Router, tasks: Query[], iterations: number, stopsIndex: StopsIndex) => PerformanceResult[];
|
|
38
52
|
/**
|
|
39
53
|
* Benchmarks {@link Result.bestRoute} — the path-reconstruction phase —
|
|
40
54
|
* independently of the routing phase.
|
|
@@ -44,23 +58,48 @@ export declare const testRouterPerformance: (router: Router, tasks: Query[], ite
|
|
|
44
58
|
* @param tasks - The list of queries to benchmark. One {@link PerformanceResult}
|
|
45
59
|
* is produced per query.
|
|
46
60
|
* @param iterations - Number of times `bestRoute` is called per query.
|
|
61
|
+
* @param stopsIndex - Used to resolve stop names for result labels.
|
|
47
62
|
* @returns An array of {@link PerformanceResult} objects, one per query, each
|
|
48
63
|
* containing the mean wall-clock time (µs) and mean heap delta (MB) for the
|
|
49
64
|
* `bestRoute` call alone.
|
|
50
65
|
*/
|
|
51
|
-
export declare const testBestRoutePerformance: (router: Router, tasks: Query[], iterations: number) => PerformanceResult[];
|
|
66
|
+
export declare const testBestRoutePerformance: (router: Router, tasks: Query[], iterations: number, stopsIndex: StopsIndex) => PerformanceResult[];
|
|
67
|
+
/**
|
|
68
|
+
* Benchmarks {@link Router.rangeRoute} across a set of range queries.
|
|
69
|
+
*
|
|
70
|
+
* @param router - The router instance to benchmark.
|
|
71
|
+
* @param tasks - The list of range queries to run. One {@link PerformanceResult}
|
|
72
|
+
* is produced per query.
|
|
73
|
+
* @param iterations - Number of times each query is repeated.
|
|
74
|
+
* @param stopsIndex - Used to resolve stop names for result labels.
|
|
75
|
+
* @returns An array of {@link PerformanceResult} objects, one per query, each
|
|
76
|
+
* containing the mean wall-clock time (µs) and mean heap delta (MB).
|
|
77
|
+
*/
|
|
78
|
+
export declare const testRangeRouterPerformance: (router: Router, tasks: RangeQuery[], iterations: number, stopsIndex: StopsIndex) => PerformanceResult[];
|
|
79
|
+
/**
|
|
80
|
+
* Benchmarks {@link RangeResult.getRoutes} — the full Pareto-frontier
|
|
81
|
+
* reconstruction phase — independently of the range routing phase.
|
|
82
|
+
*
|
|
83
|
+
* @param router - The router instance used to produce the range results that
|
|
84
|
+
* are then fed into `getRoutes`.
|
|
85
|
+
* @param tasks - The list of range queries to benchmark. One
|
|
86
|
+
* {@link PerformanceResult} is produced per query.
|
|
87
|
+
* @param iterations - Number of times `getRoutes` is called per query.
|
|
88
|
+
* @param stopsIndex - Used to resolve stop names for result labels.
|
|
89
|
+
* @returns An array of {@link PerformanceResult} objects, one per query, each
|
|
90
|
+
* containing the mean wall-clock time (µs) and mean heap delta (MB) for the
|
|
91
|
+
* `getRoutes` call alone.
|
|
92
|
+
*/
|
|
93
|
+
export declare const testRangeResultPerformance: (router: Router, tasks: RangeQuery[], iterations: number, stopsIndex: StopsIndex) => PerformanceResult[];
|
|
52
94
|
/**
|
|
53
|
-
* Prints a
|
|
95
|
+
* Prints a table summary of performance results to stdout.
|
|
54
96
|
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* told apart when several calls appear in the same run.
|
|
97
|
+
* Each row corresponds to one task, identified by a human-readable query label
|
|
98
|
+
* (origin → destination + departure time). A footer row shows the mean across
|
|
99
|
+
* all tasks. An optional `label` is printed as a section header above the table.
|
|
59
100
|
*
|
|
60
|
-
* @param results - The performance results to display
|
|
61
|
-
*
|
|
62
|
-
* @param label - Optional heading printed above the results block.
|
|
63
|
-
* Defaults to `'Performance Results'`.
|
|
101
|
+
* @param results - The performance results to display.
|
|
102
|
+
* @param label - Heading printed above the table. Defaults to `'Performance Results'`.
|
|
64
103
|
*/
|
|
65
104
|
export declare const prettyPrintPerformanceResults: (results: PerformanceResult[], label?: string) => void;
|
|
66
105
|
export {};
|