import { Journey } from "../journey/Journey"; import { PatternSegment } from "./PatternSegment"; import { InterchangeTime } from "./repository/InterchangeRepository"; import { LocalDate } from "js-joda"; /** * A transfer pattern represents the skeleton of a journey. It has a list of segments that * makes up path through the stations (A->B, B->C, etc). It uses the legs inside the * segments to create journeys */ export declare class TransferPattern { private readonly segments; private readonly interchangeTimes; private readonly date; constructor(segments: PatternSegment[], interchangeTimes: InterchangeTime, date: LocalDate); /** * Using the segments defined by the transfer patterns create a list of Journeys. * * - Use the first available timetable legs as the seeds * - Then try to progress through each transfer pattern segment picking the earliest available leg * - Some journeys cannot be completed as there may not be enough services of a particular segment, incomplete * journeys are remove */ readonly journeys: Journey[]; /** * Return a list of seed legs to be used to create full journeys. If the first segment is a TimetableLeg those can * act as the seeds. If the first segment is a FixedLeg then we need to construct a list of [FixedLeg, TimetableLeg] * pairs to be used as the seeds. Either way the last leg in each seed legs is a TimetableLeg. */ private getSeedLegs; /** * Recurse through the segments appending the earliest available leg to the list of legs (that will become the * journey). */ private getJourneyLegs; private interchange; /** * Departure time of the journey is the departure time of the first timetable leg minus the duration of any fixed * legs that came before it. */ private departureTime; /** * Arrival time of the journey is the arrival time of the last timetable leg plus the duration of any fixed legs * that come after. */ private arrivalTime; }