import type { StopID, Time } from "@gb-transit/gtfs-loader"; import type { Network } from "../network/Network.js"; import type { Journey } from "../results/Journey.js"; import type { JourneyFilter } from "../results/filter/JourneyFilter.js"; import type { AsyncPlanner } from "./AsyncPlanner.js"; /** * A range query that scans several departure times at once. * * RangeQuery has to be sequential: it scans, looks at what came back, and starts the next scan a * second after the earliest journey it found. Nothing can be started until the previous scan has * answered. The departure times it lands on are not a secret though, they are the times trips * leave the origin, and the timetable already holds those. Reading them up front turns the query * into a list of independent scans, which can be handed to as many planners as there are. * * The scans are run in batches the size of the pool, and the results are counted after each batch, * so a query that only wants a few journeys stops early. That is the reason for batching rather * than dispatching the whole day: the work wasted by stopping late is bounded by one batch instead * of by however much of the day is left. */ export declare class ParallelRangeQuery { private readonly network; private readonly planners; private readonly filters; constructor(network: Network, planners: AsyncPlanner[], filters?: JourneyFilter[]); /** * Plan journeys departing within the given range, stopping once maxResults of them have been * found rather than covering the whole range. */ plan(origin: StopID, destination: StopID, date: Date, time?: Time, endTime?: Time, maxResults?: number): Promise; /** * Every time a journey could leave the origin at, in order. * * A journey does not have to start on a vehicle at the origin, it can walk somewhere else and * board there, so the times trips leave the far end of a footpath count too, less the time the * walk takes. */ private departureTimes; /** * Add the times a journey could leave the origin to catch a trip departing the given stop, which * is the trip's departure less the time it takes to walk there. */ private collectDepartures; private applyFilters; }