Closed mvpsaraiva closed 3 years ago
What exactly means to have CAR as access and egress mode? How does a CAR direct trip with WALK as access and egress mode differs from the same trip, but with CAR as access and egress?
From what I can see in the paths_df
it looks like that acess and egress are only relevant when the options refers to a transit route. Which leads me to think that we don't need to set CAR as a access and egress mode at all, since it won't affect CAR direct trips, and would solve the issue.
Do you agree?
PS: I created a test-utils
file with some tests for the supporting functions. Once we agree on this I'll create some tests to check the output of select_mode
.
I have added a quick and (hopefully) temporary fix to this. Now in the case the algorithm selects CAR and BICYCLE as possible egress modes, those are removed in the end.
I'm leaving this issue open because we have to understand some nuances of the modes better to refine select_mode
:
max_drive_distance
and max_bike_distance
(or something like that). Those are not changed anywhere in our functions, so I think we should look at them if we plan to allow CAR and BIKE acess/egress legs.A bit of research on the modes:
To use BICYCLE_RENT, we have to:
Place a .xml with bike stations info inside the graph directory and add/edit the "bikeRentalFile" field in the build-config.json with:
There's also the "staticBikeRental" field in the build-config.json, which would allow us to read the bike rent stations from OSM instead of the .xml. The field defaults to "false" (which means it reads from xml), so changing it to "true" would suffice our needs, but this field is not used anywhere in the java code.
OSM ways and nodes must have tag "park_ride"
. Glimpsed through some garages and parking spots located within our sample pbf and I don't think any of them have it, so we'll need to find some data to test this.
Time to stop with CAR_PARK mode equals to:
These can be found here.
I've done some tests (see primary input below). Belor are the trave time estimates for the following combination of modes.
The take away message is that both access
and egress
modes are important for pretty much all combinations. I suggest we use as the default simple combinations of modes (assuming egress
is always walking), but we also giver users the flexibility to choose a more complex combinations. The question is how to keep this simple for the user.
Simple combinations (DEFAULT): (assumes the person will always walk after hopping off from the public transport)
More complex combinations (assumes the person will have access to another mode after hopping off from the public transport)
:walking: = 154 minutes 'direct_modes' = "WALK" 'transit_mode' = "" 'access_mode' = "WALK" 'egress_mode' = "WALK"
:walking: + :bus: + :walking: = 66 minutes 'direct_modes' = "WALK" 'transit_mode' = "TRANSIT..." 'access_mode' = "WALK" 'egress_mode' = "WALK"
:walking: + :bus: + :bicyclist: = 62 minutes 'direct_modes' = "WALK" 'transit_mode' = "TRANSIT..." 'access_mode' = "WALK" 'egress_mode' = "BICYCLE"
:bicyclist: + :bus: + :walking: = 51 minutes 'direct_modes' = "BICYCLE" 'transit_mode' = "TRANSIT..." 'access_mode' = "BICYCLE" 'egress_mode' = "WALK"
:bicyclist: + :bus: + :bicyclist: = 48 minutes 'direct_modes' = "BICYCLE" 'transit_mode' = "TRANSIT..." 'access_mode' = "BICYCLE" 'egress_mode' = "WALK"
:walking: + :bus: + :car: = 28 minutes 'direct_modes' = "WALK" 'transit_mode' = "TRANSIT..." 'access_mode' = "WALK" 'egress_mode' = "CAR"
:car: + :bus: + :walking: = 18 minutes 'direct_modes' = "CAR" 'transit_mode' = "TRANSIT..." 'access_mode' = "CAR" 'egress_mode' = "WALK"
:car: + :bus: + :car: = 18 minutes 'direct_modes' = "CAR" 'transit_mode' = "TRANSIT..." 'access_mode' = "CAR" 'egress_mode' = "CAR"
# load origin/destination points
data_path <- system.file("extdata/poa", package = "r5r")
points <- read.csv(file.path(data_path, "poa_hexgrid.csv"))
r5r_core <- setup_r5(data_path = data_path)
departure_datetime <- as.POSIXct("13-05-2019 14:00:00", format = "%d-%m-%Y %H:%M:%S")
# estimate travel time matrix
travel_time_matrix(r5r_core,
origins = points[120,],
destinations = points[10,],
departure_datetime = departure_datetime,
max_walk_dist = Inf,
max_trip_duration = 1200L)
# variations of mode combinations
mode_list <- list('direct_modes' = "WALK",
'transit_mode' = "TRANSIT;TRAM;SUBWAY;RAIL;BUS;FERRY;CABLE_CAR;GONDOLA;FUNICULAR",
'access_mode' = "WALK",
'egress_mode' = "WALK")
Our heuristic for turning one parameter
mode
into the 4 parameters R5 uses (direct_mode, transit_mode, access_mode and egress_mode) sometimes generates odd path options. For example, should we consider options such as driving to the bus stop, then taking the bus, and then driving again to the destination?Example: