-
Notifications
You must be signed in to change notification settings - Fork 183
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
Add variable fares by time or day #357
Add variable fares by time or day #357
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Hello everyone! Here is an update on this work. What was done based on the feedback received on #343
Outstanding items
I believe these were all the items discussed, please let me know if you think otherwise. |
There's a typo: |
"Mentioned that start and end times are included in the interval" |
Thanks, fixed. ✅
Understood. The start and end times are modeled the same way |
LOL, you just proved my point. You wrote: "so that people design intervals as 08:00 - 09:59, off-peak: 10:00 - 16:00, even though they talk about peaks as 08:00 to 10:00 ; off-peak: 10:00 - 16:00. " You should've written: 10:00 - 15:59 But I get it. So the important thing is to make it required to cover the whole day and not to have overlap somehow so it'll be possible for a validator to spot things like there's a 1 minute overlap between 08:00-10:00 and 10:00-16:00 |
Just to highlight a couple of areas we think could do with some more consideration Determinant of peakness@isabelle-dr Thanks for highlighting the use-case where the peakness might be related to the trip rather than the time at which the rider joins a trip. The other case we have raised previously is where the peakness depends upon the time at which the rider enters the fare area of a station - for example the time the rider "touches in" at their origin station on the London Tube. So we see three cases;
Fare_leg_rules or Fare productsShould these time discriminating factors be used to determine the correct fare via the fare_leg_rules or the fare_products table ? One approach may be to constrain the fare_leg_rules table to be concerned only with the physical journey taken (stops, distance , routes etc ). The fare_products table would then combine this with the peakness, the containers, the rider_category etc. This is a big topic I suspect that would be best discussed at the upcoming round-table |
Isn't case 1 (joins a trip) and 2 (enters a station) basically the same thing, just with different timefarme_type_id? |
@flocsy Yes ! Previous discussions on this have debated whether the timeframe_type_id sits in timeframes.txt or in fare_leg_rules |
Which is a hard question. I can imagine that in most if not all places in the world the situation is something like: 8:00-09:59 peak hour. However depending on the vehicle type (bus, tram vs subway,train for example) the point of validation might be different (bus, tram: at boarding time vs subway,train: at station entrance) So the question is what we prefer to "duplicate" in this case. If we add timeframe_type_id to timeframes, then you duplicate lines BOTH in timeframes.txt AND in fare_leg_rules.txt IMHO. If we add timeframe_type_id to fare_leg_rules.txt then we only duplicate lines there. And I think this also makes more sense because "timeframes" is about the time frames, and not where you measure it... However, maybe, there's an even better place where we could add timeframe_type_id. In my above example it could go to the networks.txt or something like that, and then we wouldn't need to duplicate lines anywhere... |
Hey all, trying to bring myself up to speed on this proposal. I wanted to re-open a different potentially fraught subject: empty-entry semantics. The current language:
seems particularly fraught, if I understand it correctly? I know there was a bit of discussion around this in original PR, but I believe it was highlighted that the second you have two different fare networks in the same feed who both want to use "empty" semantics for their "default" rule and then use different timeframes for their "specific" rules, you'll have a conflict and the fares won't compute as expected. As discussed, this is generally a problem with "empty" matching in Curious if you have specific thoughts on the timeframe proposal regarding this issue. |
@bdferris-v2 I agree with you. This also bothers me every time I see it. It's confusing that usually empty matches anything, but not in this case. If you have a better (less confusing) idea, I'll most probably vote fore it. |
Hello everyone, MobilityData will host a roundtable discussion this week on Thursday 1 December 11:00 AM ET to discuss the open items in this PR. You can access both events via this calendar, and you can reach out to [email protected] to get an invite on your e-mail. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
not stale |
Gavriel pointed out in the proposal document that "initial" is un-necessary https://docs.google.com/document/d/1N3WpgAh2OxPuE5Vvjbd6mjvKK42M7mSVdxscVvzP8SU/edit
Some of you discussed whether it's less confusing for consumers if the times are agency or stop timezone. I think there's another side of this question: on 363 days of the year probably either would work. But on the 2 days when there's the daylight saving time change it might be "crucial" to choose the "better" one and also because it only happens twice a year it's harder to test these edge cases. I'm not sure how much this happens in real world, but in theory there are many things could go wrong during the DST change night(mare): the 2 neighbouring countries might change DST on a different date (which would make 4 though days per year) but even if they are on the same day there is probably a 1 hour gap between when it occurs in the 2 countries. So I'm not sure which timezone is better to be used, but when discussing this we should consider the edge cases and the possibility to make implementation bugs. |
Hello everyone, the working group had a final discussion on this proposal and reached consensus (see meeting notes).
As per the GTFS Amendment process, the requirements to open a vote are met. Voting ends on 2023-07-24 at 23:59:59 UTC. |
If possible please amend the descriptions for the sake of clarity (see my comments), but you get my vote |
+1 OpenGeo (not a producer) |
Comment google#357 (comment) 1. Specify "time of day" of fare leg's start/end time 2. Clarify the start_time/end_time are in timeframes.txt Additional: change "row" to " "record" to synchronize the rest of GTFS.
+1 Apple |
+1 Ito World Would it be worth changing the empty wordings from |
Based on Hal's suggestion - google#357 (comment)
+1 Trillium |
+1 Google |
+1 from the @mbta in Boston. Excited to see consensus built on this important addition to Fares v2—the MBTA has a couple of near-term use cases where we may implement timeframes. |
+1 for Cityway |
+1 Transit |
The voting period ended on 2023-07-24 at 23:59:59 UTC. With 9 votes in favour and no votes against, the vote to extend GTFS with Variable fares by time or day passes!
Many thanks to everyone who participated in this Pull Request and in the working group meetings, and we would like to extend a special recognition to ITO World and Apple Maps for their commitment to implementing the changes proposed in this PR, which is required for every GTFS addition. |
* Added timeframes * Add date-based fares * Update timeframes.txt description * Change end time from required to optional * Records with the same timeframe id must cover a 24h period * no overlap * remove requirement on 24h coverage and overlapping * fix typo * Revert changes in timeframes.end_time * move service_id to timeframes.txt * Move timeframes to the fares v2 section * rename timeframe_id to timeframe_group_id * place timeframes.txt with other Fares v2 files * Rename from/to fields + change empty semantics - Rename from_timeframe_id and to_timeframe_id to start_timeframe_group_id and to_timeframe_group_id - Change empty semantics so that an empty entry means the fare isn't affected (as opposed to the "empty means everything except") * add line break * Add timeframes description * Make timeframe fields required * service_id references calendar or calendar_dates * Add requirements - the whole day must be covered with timeframes if one is defined - there should not be overlapping time frames with the same timeframe_group_id and service_id * typo * Update timeframe fields description * end time is not included in the interval * Add timeframe_type field * Overlapping time frames must not be defined for the same timeframe_group_id and service_id * introduce override Introduce an override field in fare_leg_rules and remove the requirement of needing the whole day covered with timeframes if one is defined. * improve override description * Revert "improve override description" This reverts commit d4afc6e. * improve override description * update timeframe fields description changes "a row" to "one row" * remove timeframe fields for no exact matched found * Update descriptions for empty values: - removed the "If there are no matching `fare_leg_rules.start_timeframe_group_id` values to the `timeframe_group_id` being filtered..." - added "that rule will match a particular leg if either start_timeframe_group_id is empty, or if there exists at least a row in `timeframes.txt` where all..." * Both values need to be empty or neither should be empty as discussed in the last working group meeting * Change to local time semantics As discussed in the working group meeting * Changed name start/end_timeframe_group_id As discussed in working group meeting * Remove timeframe_type & priority fields Changes as discussed in working group meeting * revise "start" to "end" * Remove "initial" after Gavriel's comment Gavriel pointed out in the proposal document that "initial" is un-necessary https://docs.google.com/document/d/1N3WpgAh2OxPuE5Vvjbd6mjvKK42M7mSVdxscVvzP8SU/edit * Remove unnecessary empty description * Changes based on Jeremy's feedback Comment google#357 (comment) 1. Specify "time of day" of fare leg's start/end time 2. Clarify the start_time/end_time are in timeframes.txt Additional: change "row" to " "record" to synchronize the rest of GTFS. * Modify empty wording Based on Hal's suggestion - google#357 (comment) * Move overlapping requirement out of service_id description --------- Co-authored-by: omar-kabbani <[email protected]> Co-authored-by: Tzu-Jen Chan <[email protected]>
Fares can vary based on the time of day (described using
timeframe_id
) and day of week/year (described usingservice_id
).This pull request covers fares that vary by time and day, which is a section of the entire GTFS-Fares v2 proposal.
The changes in this pull request are:
timeframes.txt
, to define moments in time where the fare applies.fare_leg_rules.txt
withfrom_timeframe_id
, andto_timeframe_id
to specify that a fare leg rule applies only if the beginning or end of the leg is in a specified timeframe.Here's a quick example
Define service days and New Year's using
calendar.txt.
andcalendar_dates.txt
Define the discounted timeframe using
timeframes.txt
Define the time and date-based fares using
fare_leg_rules.txt
[Original message posted by @isabelle-dr on November 2, 2022. OUTDATED]
Hi everyone!
I am opening this Pull Request as part of the second implementation of Fares v2. I am opening it in the exact same state PR #343 was when closed, and I will update the proposal based on feedback already received so we can resume where we left off. For more information on the plan, please refer to #341 (comment).
This pull request covers fares that vary by time and day, which is a section of the entire GTFS-Fares v2 proposal.
Fares can vary based on the time of day (described using
timeframe_id
) and day of week/year (described usingservice_id
).The changes in this pull request are:
timeframes.txt
, to define timeframes.fare_leg_rules.txt
withfrom_timeframe_id
,to_timeframe_id
, andservice_id
to describe time-dependant fares.The time-dependant variables (timeframe and day information) are modelled into fare legs (and not fare products) since in GTFS-Fares v2,
fare_leg_rules.txt
models the location and time variables (from/to area, from/to timeframe, and service ID). All other factors are modelled in fare products.Here's a quick example
Define service days and New Year's using
calendar.txt.
andcalendar_dates.txt
Define the discounted timeframe using
timeframes.txt
Define the time and date-based fares using
fare_leg_rules.txt
Data consumer: Apple
Data producer: ITO World
Please go through the changes and share your thoughts here!
Looking forward to feedback and contribution on this proposal.
For other questions/concerns, don’t hesitate to reach out to [email protected].