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
I am using R5R in my research on transport equity, focusing on aerial cable cars in Colombia. As part of my study, I am working on implementing the fare structure for Bogotá’s BRT system. I have been following the R5R tutorial on fare structures, which uses Porto Alegre as an example (https://ipeagit.github.io/r5r/articles/fare_structure.html).
However, Bogotá’s fare system has some particularities that differ from Porto Alegre's. For instance, Bogotá’s BRT combined BRT buses, Gondolas (Aerial cable-cars-ACC), and traditional buses with different fare rules. The system allows up to 2 discounted transfers (for free) in 125 minutes. Besides, there are Feeder Buses (ALIMENTADOR), which are for free working as a first and last-mile connector.
To implement the fare structure, I assume BRT buses and ACC work as RAIL systems in Porto Alegre's example, with unlimited transfers. On the other hand, I assume traditional buses work as BUS in Porto Alegre.
These are my few questions about the implementation:
1. Unlimited Transfers Between BRT Buses and Gondolas: Bogotá’s system allows unlimited transfers between BRT buses and gondolas. Should I delete the fare combinations for BRT–Gondola and Gondola–BRT in my fare configuration, assuming they operate under the same unlimited transfer rule? I already deleted BRT-BRT and GONDOLA-GONDOLA, as was explained in the tutorial (see my code below for all the fare structures implemented).
2. Transfers Involving Traditional Buses: Traditional buses operate under a different fare rule, with up to two discounted transfers allowed within the 125-minute time window. Should I explicitly define the costs for combinations like BUS–BUS or BUS–BRT in my configuration? Are the first two transfers (which are allowed for free) automatically accounted for? Will the subsequent transfers be considered following the transfer rules BUS-BUS and BUS-BRT?
3. Computational time: I have tried implementing this fare structure, and the calculation time is high. For instance, for an Origin-Destination pair using travel_time_matrix the running time was 4 minutes. Do you have the same problems, or maybe it is because the fare structure is too complex? I tried with detailed_itineraries, and despite being more complex, the running time is lower, allowing the implementation. Do you have suggestions to run this O-D calculation massively?
Fare structure code
The Bogotá's fare structure was implemented considering AGENCY_NAME, divided into the following:
BRT: Transmilenio-Troncal, TRANSMILENIO-DUAL
ACC: CABLE
Traditional bus: TRANSMILENIO-URBANA, TRANSMILENIO-ESPECIAL, TRANSMILENIO-COMPLEMENTARIA.
Feeder bus: ALIMENTADOR
# Fare Structure Bogotá
fare_structure <- setup_fare_structure(r5r_core,
base_fare = 2950,
by = "AGENCY_NAME")
#### The rider can have a discount in maximum 2 transfers
fare_structure$max_discounted_transfers <- 2 # update max discounted
#### Transfer time allowance of 125 minutes
fare_structure$transfer_time_allowance <- 125 # update
### Costs and transfers per mode of transport
#### Cable has unlimited transfer and allow same route transfer
fare_structure$fares_per_type[type == "CABLE", unlimited_transfers := TRUE]
fare_structure$fares_per_type[type == "CABLE", fare := 2950]
fare_structure$fares_per_type[type == "CABLE", allow_same_route_transfer := TRUE]
#### Alimentador is free, and it works at bus stops and enters the BRT stations. We set the unlimited transfers to FALSE and FARE to 0 because the passenger does not pay, and it does not allow same route transfer.
fare_structure$fares_per_type[type == "TRANSMILENIO-ALIMENTADORA", unlimited_transfers := FALSE]
fare_structure$fares_per_type[type == "TRANSMILENIO-ALIMENTADORA", fare := 0]
fare_structure$fares_per_type[type == "TRANSMILENIO-ALIMENTADORA", allow_same_route_transfer := FALSE]
#### BRT troncal has unlimited transfer and allows the same route transfer
#### https://www.transmilenio.gov.co/publicaciones/151035/troncal/
fare_structure$fares_per_type[type == "Transmilenio-Troncal", unlimited_transfers := TRUE]
fare_structure$fares_per_type[type == "Transmilenio-Troncal", fare := 2950]
fare_structure$fares_per_type[type == "Transmilenio-Troncal", allow_same_route_transfer := TRUE]
#### BRT DUAL has unlimited transfer and allows same route transfer
#### https://www.transmilenio.gov.co/publicaciones/151035/troncal/
fare_structure$fares_per_type[type == "TRANSMILENIO-DUAL", unlimited_transfers := TRUE]
fare_structure$fares_per_type[type == "TRANSMILENIO-DUAL", fare := 2950]
fare_structure$fares_per_type[type == "TRANSMILENIO-DUAL", allow_same_route_transfer := TRUE]
#### Transmilenio urbana
fare_structure$fares_per_type[type == "TRANSMILENIO-URBANA", unlimited_transfers := FALSE]
fare_structure$fares_per_type[type == "TRANSMILENIO-URBANA", fare := 2950]
fare_structure$fares_per_type[type == "TRANSMILENIO-URBANA", allow_same_route_transfer := FALSE]
#### TRANSMILENIO-ESPECIAL
#### https://www.transmilenio.gov.co/publicaciones/151040/especial/
fare_structure$fares_per_type[type == "TRANSMILENIO-ESPECIAL", unlimited_transfers := FALSE]
fare_structure$fares_per_type[type == "TRANSMILENIO-ESPECIAL", fare := 2950]
fare_structure$fares_per_type[type == "TRANSMILENIO-ESPECIAL", allow_same_route_transfer := FALSE]
#### TRANSMILENIO-ESPECIAL
#### TRANSMILENIO-COMPLEMENTARIA
#### https://www.transmilenio.gov.co/publicaciones/151039/complementarios/
fare_structure$fares_per_type[type == "TRANSMILENIO-COMPLEMENTARIA", unlimited_transfers := FALSE]
fare_structure$fares_per_type[type == "TRANSMILENIO-COMPLEMENTARIA", fare := 2950]
fare_structure$fares_per_type[type == "TRANSMILENIO-COMPLEMENTARIA", allow_same_route_transfer := FALSE]
####Accounting for transfers costs
We need to remove agencies with unlimited transfers: Transmilenio Troncal, Alimentadora, and Cable; otherwise, the maximum discounted rate and time transfers will be applied.
The rest of the agencies work with the maximum discount and time allowance for transfers
fare_structure$fares_per_transfer <- fare_structure$fares_per_transfer[!(first_leg == "TRANSMILENIO-ALIMENTADORA" & second_leg == "TRANSMILENIO-ALIMENTADORA")]
fare_structure$fares_per_transfer <- fare_structure$fares_per_transfer[!(first_leg == "Transmilenio-Troncal" & second_leg == "Transmilenio-Troncal")]
fare_structure$fares_per_transfer <- fare_structure$fares_per_transfer[!(first_leg == "CABLE" & second_leg == "CABLE")]
### Accounting for the cost of transfers
#### The cost is a second fare of 5900. The cost considering Alimentador is set to the first fare or 0
#### The basic cost of transfer
fare_structure$fares_per_transfer$fare <- 5900
####Accounting for specific costs
####If the first leg is ALIMENTADOR the cost to the second leg is 2950
fare_structure$fares_per_transfer <- fare_structure$fares_per_transfer[first_leg == "TRANSMILENIO-ALIMENTADORA", fare := 2950]
####If the second leg is ALIMENTADOR the cost to the second leg is 0
fare_structure$fares_per_transfer <- fare_structure$fares_per_transfer[second_leg == "TRANSMILENIO-ALIMENTADORA", fare := 0`]
The text was updated successfully, but these errors were encountered:
Hello
I am using R5R in my research on transport equity, focusing on aerial cable cars in Colombia. As part of my study, I am working on implementing the fare structure for Bogotá’s BRT system. I have been following the R5R tutorial on fare structures, which uses Porto Alegre as an example (https://ipeagit.github.io/r5r/articles/fare_structure.html).
However, Bogotá’s fare system has some particularities that differ from Porto Alegre's. For instance, Bogotá’s BRT combined BRT buses, Gondolas (Aerial cable-cars-ACC), and traditional buses with different fare rules. The system allows up to 2 discounted transfers (for free) in 125 minutes. Besides, there are Feeder Buses (ALIMENTADOR), which are for free working as a first and last-mile connector.
To implement the fare structure, I assume BRT buses and ACC work as RAIL systems in Porto Alegre's example, with unlimited transfers. On the other hand, I assume traditional buses work as BUS in Porto Alegre.
These are my few questions about the implementation:
1. Unlimited Transfers Between BRT Buses and Gondolas: Bogotá’s system allows unlimited transfers between BRT buses and gondolas. Should I delete the fare combinations for BRT–Gondola and Gondola–BRT in my fare configuration, assuming they operate under the same unlimited transfer rule? I already deleted BRT-BRT and GONDOLA-GONDOLA, as was explained in the tutorial (see my code below for all the fare structures implemented).
2. Transfers Involving Traditional Buses: Traditional buses operate under a different fare rule, with up to two discounted transfers allowed within the 125-minute time window. Should I explicitly define the costs for combinations like BUS–BUS or BUS–BRT in my configuration? Are the first two transfers (which are allowed for free) automatically accounted for? Will the subsequent transfers be considered following the transfer rules BUS-BUS and BUS-BRT?
3. Computational time: I have tried implementing this fare structure, and the calculation time is high. For instance, for an Origin-Destination pair using travel_time_matrix the running time was 4 minutes. Do you have the same problems, or maybe it is because the fare structure is too complex? I tried with detailed_itineraries, and despite being more complex, the running time is lower, allowing the implementation. Do you have suggestions to run this O-D calculation massively?
Fare structure code
The Bogotá's fare structure was implemented considering AGENCY_NAME, divided into the following:
####Accounting for transfers costs
We need to remove agencies with unlimited transfers: Transmilenio Troncal, Alimentadora, and Cable; otherwise, the maximum discounted rate and time transfers will be applied.
The rest of the agencies work with the maximum discount and time allowance for transfers
The text was updated successfully, but these errors were encountered: