-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separating crew runs from public-facing trips using distinct service_ids #76
Comments
@jeffkessler-keolis Thanks for sharing the concern around the different ways schedules can be implemented as well as the possible solution. Question: Your proposal is only to add the new optional |
Okay, I think I understand how this is an issue, and how this suggestion fixes it. Responses to specific parts:
I think it'd be useful to see some example data ( |
And responding to Josh: |
@skyqrose I detailed a number of different examples in #80, but to directly answer your questions:
|
Context
TODS v2 represents a major step forward in the standard with respect to the modeling of crew runs. The overhauled run_events.txt file likewise provides enhancements for the modeling of runs alongside trips that may already exist in GTFS.
Problem
Since run_events.txt are mapped to existing GTFS trips via service_ids, the two are paired in a 1:1 relationship of runs and trips. This presents two challenges for producers seeking to model crew runs in run_events.txt.
Many scheduling systems (e.g. Hastus) decouple "vehicle schedules" and "crew schedules," representation of which in a single shared
service_id
limits the ability to distinguish between the two and create a 1:many mapping of trips and runs.For example, while a set of trips may remain unchanged, the underlying runs could be modified themselves (generally around trackwork or holidays).
Consider a set of trips with service_id
spring24-schedule1
. While there may be a standard set of crew runs mapped to the trips on that day, some crew runs may not operate on the day before/after a holiday, and other runs may be modified to accommodate the lower staffing, even through all trips will operate normally.e.g. For a US railroad, this Friday (7/5/24) will likely be very light ridership with individuals taking off after the Independence Day [Federal/≈"Bank"] Holiday, despite operating a standard weekday schedule. As a result, additional Assistant Conductors to support higher-ridership trains may not be required on Friday, meaning some CREW runs will not operate, and others will be modified, despite operating the same public schedule of TRIPS (which would continue to use the standard weekday schedule's
service_id
in the base GTFS).Crew schedules could have different runs depending on the day of the week, yet be stored in the same schedule (e.g. special Friday service).
Many scheduling systems allow for deviations in runs within a singular schedule, an example of which might be the inclusion of certain runs and trips that operate only on a particular day of the week within a larger set of service.
e.g. The seasonal CapeFLYER service operates only on Fridays, with some modified crew runs to accommodate the additional service on Fridays within a singular Hastus crew schedule.
Potential Mitigations
Create a unique service_id for every applicable combination of trips and runs (vehicle and crew schedule)
While one could create a concatenated service_id representing the combination of vehicle and crew schedules (e.g. service_id
spring24-schedule1-crew1
andspring24-schedule1-crew2
, doing so is a inadvisable for two reasons:This approach requires producers to change the way in which they produce their public GTFS, which is something the working group expressed we wanted to generally avoid; PLUS,
This approach requires duplication of otherwise identical trip data for each service_id, alongside modification to the underlying primary keys (e.g. trip_ids of
trip1
andtrip1-crew2
to ensure uniqueness to each service_id), thereby (a) adding considerably to the size of the underlying file, (b) adding extensive onus to producers, and (c) potentially also having downstream impacts on customer-facing applications that group service by service_id.Proposed Solution
Adding a new, optional
trip_service_id
field to run_eventsTo combat these issues, ensure backwards-compatibility, and more easily support export from existing scheduling systems, the addition of an optional
trip_service_id
field is proposed.This would allow individuals with paired vehicle and crew schedules to use the existing v2 specification's use of run_events without modifications (ensuring backwards-compatibility with TODS v2).
Those with decoupled crew and trip schedules could keep them separate by defining a new
service_id
for the runs in run_events, and mapping the runs to corresponding trips using the trips' existingservice_id
s by entering them in the addedtrip_service_id
field.In the above examples, the distinct crew schedules of
spring24-crew1
andspring24-crew2
could be used as theservice_id
fields inrun_events.txt
, with thetrip_service_id
value beingspring24-schedule1
in both instances.spring24-crew1-fri
for runs in a Friday schedule, andspring24-crew1-mtwr
for other weekdays) and assigned on their applicable days, yet all mapping back to the same service_ids for the respective trips.service_id
s in effect.Supporting additional service_id definitions via calendar_supplement.txt and calendar_dates_supplement.txt
Introducing new
service_id
entries means a mechanism would need to be added for the assignment of these entries to particular dates. Fortunately, the newly-introduced supplement paradigm allows for an updating of the calendar.txt and calendar_dates.txt files via the addition of entries in applicable TODS supplement files.These files would permit the assignment of any new run-specific
service_id
s on both specific dates and in a given date range via the existing data standard of thecalendar.txt
andcalendar_dates.txt
files.Approach Limitations
A check would need to be added to ensure applicable trip
service_id
s are in effect whenever the corresponding runservice_id
s are in effect.A
service_id
used for runs could NOT be the same as one used for trips in public GTFS, UNLESS the schedules are coupled together (i.e. the same runs will always be operated when those trips are being operated).service_id
s must be distinct.service_id
ofspring24-schedule1
, assigning runs toservice_id
ofspring24-schedule1
indicates that those runs will always operate when the corresponding trips are running.Where a
service_id
of runs is already paired to aservice_id
of trips (i.e.run_events.txt
has entries with a definedservice_id
matching one already defined in the standard GTFS), a second set of runs can NOT be assigned to use the trips assigned to the sameservice_id
, as — by definition — the runs paired to the sameservice_id
would be in effect at the same time.service_id
ofspring24-schedule1
, and runs are also assigned toservice_id
ofspring24-schedule1
, runs withservice_id
ofspring24-schedule1-crew2
could NOT have atrip_service_id
ofspring24-schedule1
, as the calendar/calendar_dates entries would indicate the runs withservice_id
ofspring24-schedule1
will always operate when trips withservice_id
ofspring24-schedule1
are operating, thus creating duplicate runs for the same trips.Next Steps
Happy to use this as a springboard for discussion as to potential approaches and evolutions of the spec for TODS 2.1+.
This also ties in nicely to discussion of approaches for rostering, as the assignment of runs within a roster can be mapped more flexibly with run variations uncoupled from trips.
We'll draft a pull request of what this'd look like to provide a more tangible overview of how this'd be represented in the documentation.
The text was updated successfully, but these errors were encountered: