-
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 #343
Add variable fares by time or day #343
Conversation
I suggest to make a change and don't mention a 24h period, but keep it in line with the rest of the GTFS spec (hence 24+h) formats. |
Need to clarify the start_time/end_time formats: do we require to have them be between 00:00 and 23:59? Do we allow timeframe like: start_time: 07:00, end_time: 06:00? Or is tomorrow's 06:00 represented as 30:00? Or we don't allow this and it has to be like in the example that we have it cut in two: 00:00-06:00 and 07:00-23:00? Currently the proposal has "24-hour format" so maybe we should add "allowed values: 00:00 - 23:59" It'll be beneficial IMHO (easier to look at the data) if instead of: [06:00-07:59], [08:00-15:59] we could use [06:00-08:00).[08:00-16:00) IMHO we need to have a constraint that the timeframes are distinct. (You can't have both: 06:00-06:59 and 05:00-07:59, and depending what we decide about the end of the timeframe: 06:59] vs 07:00) we should not allow both: 06:00-07:00 and 07:00-18:00 because 07:00 is listed in 2 timeframes) Though it's not clear to me if we want this constraint in timeframes.txt (probably not) or somehow on the data in fare_leg_rules.txt (probably yes, but it'll be very complicated and it should also incorporate service_id) [We might also need to have a constraint that if there are timeframes then they need to cover all the 24 hours (you can't have peak-hour: 06:00-07:59 without also having the 00:00-05:59 and 08:00-23:59). Looks like it's not needed because empty timeframe_id covers the "rest", but might not be that simple, see below] The problem with what empty timeframe_id means: "all timeframes defined in Maybe we could add timeframes.service_id as an optional field? That way the constraint could be that timeframes having the same service_id must be distinct. Do we really need seconds? To me it sounds unrealistic and unnecessary. fare_leg_rules.txt: IMHO we only need to add service_id, timeframe_id. While I can see what it could be used to if we had from/to timeframe_id, it also makes it probably too complex and error prone (or needs some sentences to constrain them to consecutive timeframes, but then that is probably something that can't be enforced either...) |
Great to see this conversation started. We have a few comments.
I would take this a step further and propose that these time discriminating elements should go into another table ("time_rules.txt") that would yield a single key to be matched in the product table. As well as providing a stronger semantic modelling this also avoids the fare_products table (or fare_leg_rules) from exploding in size when one needs to model the more complicated peak definitions in a context of (say) a complex zonal system.
We would therefore propose further attributes: from_timeframe_type and to_timeframe_type with values of trip, leg, station (and potentially others).
|
Thanks @skinkie, @flocsy, and @davidlewis-ito for your input! I have responded to your comments below - please let me know if something is outstanding.
Good catch! For fare calculation purposes, the start/end of a trip is not clear. Since this is specific to fares, the start time is when a fare is validated (tap on the bus, or tap to enter the station, etc.), and the end time is when a fare is validated (tap off). I can modify the wording to reflect that. |
@omar-kabbani Regarding the constraint about overlapping timeframes: you wrote above that "overlapping timeframes that are part of the same timeframe_id should be forbidden". That for sure has to be added, but is that enough? What would you make of the following rules: timeframe_id,start_time,end_time Part of the problem seems to be related to what both @davidlewis-ito and I touched that the timeframes and the service dates together define the times, so there should be something that connects between them. Either by having some explicit table for it or by having complicated constraints in the definitions. The above 3 lines look like not OK because there are 2 timeframes that include 07:00-07:59, so it's probably a bug, but on the other hand if I would change it to: timeframe_id,start_time,end_time Then it would still look strange at first sight, but when I would add that the 1st 3 lines cover the whole 24 hours for work days and the 4th line covers the whole 24 hours on weekends, then it would make sense. But then this should be somewhere explicitly defined, so the service_ids work-day and weekend should be related tho them. Of course we could also change the 4th line's timeframe_id to weekend, but that would only help humans when looking at it, but on the other hand it would probably also double the number of lines in the fare_leg_rules. Regarding the timeframe_type: I think that modifying the wording is not enough, because it would only clarify the confusion on a local level, which anyway probably would not be confusing for the locals, but it misses the whole point of GTFS Fares V2: automated fare calculations. When you have an algorithm that calculates the fares and it knows that it takes 2 minutes to walk from the station entrance to the 23rd platform then it can and should take that into account. And then it is important for the algorithm to differentiate between these nuances: start to count at the entrance of the station or when you enter the train (reach the platform) or when the train leaves... |
Hi @flocsy -
Technically, yes - this would be an off-peak trip, since the fields are based on fare validation. The examples for off-peak fares that I found online only look at when the trip starts. Hence, if the discounted pricing starts at 7:00 AM and a rider taps at 6:59 AM - they will not pay the discounted price. For example, on TfL's fare structure, it is mentioned that "Peak and off-peak fares are charged based on the time you touch in.". Hence,
Same here - if we are basing this on fare validation (tap on/tap off, etc.) both trips are-off peak. Unless we add a field From your posts, I take it that you are suggesting using one field for timeframes in For associating As for |
I am brainstorming rather than saying that there should be only 1 timerfame_id field PLUS timeframe_type. With those two we probably can handle many logical use cases (timeframe_type: station_entrance / vehicle_entrance would mean what you described, but there would also be a possibility to have trip_duration or whole_trip that would be able to disallow a trip: 05:55-06:13) Also by having timeframe_id + timeframe_type we can handle more real life use cases IMHO than with from_timeframe_id+to_timeframe_id (and in most cases from_timeframe_id would be equal to to_timeframe_id anyway) Regarding adding service_id to somewhere: well, yes, of course the proposal would put them in fare_leg_rules, but there are other places we could add it, like to the timeframes. We'll need to think about the pros and cons of these (and maybe more) possibilities. As I see it we'll have to consider the most common use cases, which I believe mostly will have these in common: However considering what I think would be the next most common use case (exceptions for holidays) then if we would add just 1 service exception for X-mas, then how would it look? If we add service_id to timeframes, then we would have probably 1 more (maybe 2 if there's still some peek/off-peek thing) lines to timeframes, but then we would also need to duplicate most rules in fare_leg_rules, wouldn't we? I'm not really sure what's best. And if some lines behave in X-mas as usual, but other lines as weekend, then things get even more complicated. |
Hey everyone - just a reminder that MobilityData is hosting a roundtable discussion on Wednesday 24 August at 11:00 AM ET to discuss the outstanding items regarding time-variable fares. If you would like to attend, please react to this message or send an email to [email protected] and we will send you the invite. For a summary and more details, please check out this post. |
I'm on a family vacation, be back in September.
…On Mon, 22 Aug 2022, 11:30 omar-kabbani, ***@***.***> wrote:
Hey everyone - just a reminder that MobilityData is hosting a roundtable
discussion on Wednesday 24 August at 11:00 AM ET to discuss the outstanding
items regarding time-variable fares. If you would like to attend, please
react to this message or send an email to ***@***.***
and we will send you the invite.
For a summary and more details, please check out this post
<#341 (comment)>.
—
Reply to this email directly, view it on GitHub
<#343 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHI4RHHYJV7RW3NFHMQLC3V2NCDHANCNFSM55WZZBOA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I'm afraid I can't make the discussion. I think there's a part of @davidlewis-ito's suggestion on timeframe_type that hasn't been picked up fully: the case when the determination of the peak-ness of a leg is determined by the time that vehicle leaves its origin (or reaches its destination) - eg LIRR in NYC. It's effectively an attribute of the trip and is not connected to the rider's timings of when they board that trip at all. This feels like something that would be worth considering if it could be captured in timeframes, or whether it would be necessary to represent in another way, such as trip-level fare attributes. |
Summary of roundtable discussion on variable fares by time or day:August 24 11:00 AM ETAttended by: @Cristhian-HA, @omar-kabbani, @skinkie, Chris Erickson (Trillium), and Scott Jackson (Apple). Number of fields
Timeframe type
File structure
|
Hey everybody, I will close this pull request since I will be leaving MobilityData and therefore I cannot remain the advocate for this proposal. In order to preserve the conversation history, I will open an issue in google/transit and reference this pull request. Please continue the discussion there, and provide feedback on how to move forward with this proposal. I also wanted to thank you all for your constant engagement in these GTFS extension proposals and for all the valuable feedback! |
Hi,
I was on vacation so I couldn't attend the meeting. Here are my thoughts:
1. I like that empty timeframe_id means "all day", it is much more
"natural" to me than the definition we usually have. However doesn't this
also mean we have to "cover" the whole day with timeframes? What I mean is
that if we have the easiest example: 06:00-08:59: "peek", and the rest of
the day: "normal", then you no longer can use empty to mean "normal" so we
have to define normal as: 09:00-29:59: normal. Which is something that I
think is good, I just think we should mention this explicitly.
2. Why timeframe_type is being added to fare_leg_rules and not to
timeframes? It doesn't seem logical to me. I would like hear the arguments
why it can't be in timeframes, and maybe think about the best place to put
it.
|
can't this be reopened? |
@flocsy I linked the issue in the post above but I meant to link to PR #357. |
Hi everyone, MobilityData is moving forward with the second iteration of GTFS-Fares v2, for more information about the overall plan, you can check issue #341.
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: (To be announced)
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].