You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/mappers/RealTimeRaptorTransitDataUpdater.java
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,31 @@ public RealTimeRaptorTransitDataUpdater(TimetableRepository timetableRepository)
66
66
this.timetableRepository = timetableRepository;
67
67
}
68
68
69
+
/// Updates the real-time [RaptorTransitData] to use the modified timetables.
70
+
///
71
+
/// This method bridges the different update approaches:
72
+
/// 1. `updatedTimetables` and `timetables` only contains [Timetable]s with real-time
73
+
/// updates. This means that removed items are not present.
74
+
/// 2. [RaptorTransitData] requires applying the changes to a previous snapshot: adding,
75
+
/// updating and removing timetables.
76
+
///
77
+
/// To support this the method has three tasks:
78
+
/// 1. Collect [TripPatternForDate]s which have invalidated data (`oldTripPatternsForDate`).
79
+
/// Trips may change in multiple ways and because of that may move between [TripPattern]s. To
80
+
/// track a [TripIdAndServiceDate] it's previous state needs to be stored so that all relevant
81
+
/// places may be updated.
82
+
/// * a trip may have a new (real-time) Timetable, which results in two updated [Timetable]s
83
+
/// * a trip may move between scheduled [StopPattern]s and/or real-time [StopPattern]s
84
+
/// 2. Collect [TripPatternForDate]s which have valid data (`newTripPatternsForDate`).
85
+
/// There are two options:
86
+
/// 1. an update was received
87
+
/// 2. no update was received, and so the previous updated should be removed. If the update
88
+
/// was for a scheduled trip, then the schedule should be restored.
89
+
/// 3. Remove the `oldTripPatternsForDate` and add the `newTripPatternsForDate` to the
90
+
/// [RaptorTransitData].
91
+
///
92
+
/// @param updatedTimetables that changed with the current snapshot
93
+
/// @param timetables which are affected by real-time updates
0 commit comments