UNPKG

raptor-journey-planner

Version:

Implementation of the Round bAsed Public Transit Optimized Router (Raptor) journey planning algorithm.

18 lines (17 loc) 770 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ScanResultsFactory = void 0; const ScanResults_1 = require("./ScanResults"); class ScanResultsFactory { stops; constructor(stops) { this.stops = stops; } create(origins) { const bestArrivals = Object.fromEntries(this.stops.map(stop => [stop, origins[stop] || Number.MAX_SAFE_INTEGER])); const kArrivals = [Object.fromEntries(this.stops.map(stop => [stop, origins[stop] || Number.MAX_SAFE_INTEGER]))]; const kConnections = Object.fromEntries(this.stops.map(stop => [stop, Object.create(null)])); return new ScanResults_1.ScanResults(bestArrivals, kArrivals, kConnections); } } exports.ScanResultsFactory = ScanResultsFactory;