From 9958ffc98ca2a7877610d81611fdfe3471d6f3c9 Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Thu, 17 Oct 2024 12:18:23 +0300 Subject: [PATCH] Rename transitModel to timetableRepository. --- .../graph_builder/module/StreetLinkerModule.java | 10 ++++++---- .../graph_builder/module/StreetLinkerModuleTest.java | 10 +++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java b/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java index a0f37c392ce..dce445d381a 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java @@ -89,10 +89,10 @@ public void linkTransitStops(Graph graph, TimetableRepository timetableRepositor Set stopLocationsUsedForFlexTrips = Set.of(); if (OTPFeature.FlexRouting.isOn()) { - stopLocationsUsedForFlexTrips = getStopLocationsUsedForFlexTrips(transitModel); + stopLocationsUsedForFlexTrips = getStopLocationsUsedForFlexTrips(timetableRepository); } - Set stopLocationsUsedForCarsAllowedTrips = transitModel.getStopLocationsUsedForCarsAllowedTrips(); + Set stopLocationsUsedForCarsAllowedTrips = timetableRepository.getStopLocationsUsedForCarsAllowedTrips(); for (TransitStopVertex tStop : vertices) { // Stops with pathways do not need to be connected to the street network, since there are explicit entrances defined for that @@ -357,8 +357,10 @@ private VehicleParking removeVehicleParkingEntranceVertexFromGraph( } } - private Set getStopLocationsUsedForFlexTrips(TransitModel transitModel) { - Set stopLocations = transitModel + private Set getStopLocationsUsedForFlexTrips( + TimetableRepository timetableRepository + ) { + Set stopLocations = timetableRepository .getAllFlexTrips() .stream() .flatMap(t -> t.getStops().stream()) diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java index 359ed3e938f..3973a7e506a 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java @@ -105,7 +105,7 @@ void linkFlexStop() { @Test void linkCarsAllowedStop() { var model = new TestModel(); - var carsAllowedTrip = TransitModelForTest + var carsAllowedTrip = TimetableRepositoryForTest .of() .trip("carsAllowedTrip") .withCarsAllowed(CarAccess.ALLOWED) @@ -198,7 +198,7 @@ public void withFlexTrip(UnscheduledTrip flexTrip) { } public void withCarsAllowedTrip(Trip trip, StopLocation... stops) { - Route route = TransitModelForTest.route("carsAllowedRoute").build(); + Route route = TimetableRepositoryForTest.route("carsAllowedRoute").build(); var stopTimes = Arrays .stream(stops) .map(s -> { @@ -214,15 +214,15 @@ public void withCarsAllowedTrip(Trip trip, StopLocation... stops) { RealTimeTripTimes tripTimes = TripTimesFactory.tripTimes( trip, stopTimes, - transitModel.getDeduplicator() + timetableRepository.getDeduplicator() ); - TripPattern tripPattern = TransitModelForTest + TripPattern tripPattern = TimetableRepositoryForTest .tripPattern("carsAllowedTripPattern", route) .withStopPattern(stopPattern) .withScheduledTimeTableBuilder(builder -> builder.addTripTimes(tripTimes)) .build(); - transitModel.addTripPattern(tripPattern.getId(), tripPattern); + timetableRepository.addTripPattern(tripPattern.getId(), tripPattern); } } }