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
WARNING - THIS FILE NEEDS EXTENSIVE REVIEW AND CORRECTION
Fares can be quite complex. This page illustrates examples of how to specify them.
Single leg, no transfer, flat fare
The example below illustrates how the fare for a single leg transit trip using a service
that has flat fare system. First fare_rules.txt is queried on route_id, origin_zone &
destination_zone to return it’s fare_id. In this case, Origin and destination zones
have values of None, which represent cases where stops are never used in a zonal fee
structure. Fare_rules_ft.txt is then queried on fare_id and the time of departure (>= to
start_time, <= end_time) to return fare_period. Fare_attributes_ft.txt is then queried
on fare_period, and the cost of the fare is returned by the price field.
To capture the cost of this scenario, the cost of each leg is calculated using the same
method proposed for a single leg trip. We then use the from fare_period and the to
fare_period to get the is_flat_fee and transfer_rule attributes from
fare_transfer_rules.txt. is_flat_fee is a boolean that indicates if the transfer is
percentage- or flat-fee based. For example, if is_flat_fee is True, the fare for the
second leg of the trip is the amount in tranfer_rule (e.g., 1.50). To indicate a free
transfer, reduced_rate is set to True and tranfer_rule is set to 0.
Systemwide Fare
The following two-leg (one transfer) trip demonstrates how a system-wide fare would be
calculated using Pierce Transit as an example. First, fare_rules.txt is queried on the
route_id, origin_zone and destination_zone of the first leg to return it’s fare_id. In
this case, Origin and destination have zones but are the same because these stops need
zones for Sound Transit, our regional express bus service. Fare_rules_ft.txt is then
queried on fare_id and the time of departure (>= to start_time, <= end_time) to return
fare_period. Fare_attributes_ft.txt is then queried on fare_period, and the cost of the fare
is returned by the price field.
The next step is to determine the transfer rule for this particular transfer. We use the
route_id of the second leg to get the fare_id which, along with departure time, is used
to get fare_period from fare_rules_ft.txt. The from_fare_period and the to_fare_period are used
to get reduced_rate and transfer_cost from fare_transfer_rules.txt. In this case
reduced_rate is True the and fare_cost is 0 indicating that there is no fee for the second
leg of this trip.
Origin-destination based fares are common on heavy rail systems, such as BART. They are
a special case of zone-based fares, where every station has its own zone, and could be
specified as follows. This example also shows the use of peak fares.