Skip to content
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

Explain in time window vignette/documentation affects the result when using McRaptor even if the GTFS doesn't include frequencies #282

Open
dhersz opened this issue Jun 21, 2022 · 2 comments

Comments

@dhersz
Copy link
Member

dhersz commented Jun 21, 2022

e.g.

test_that("works in travel_time_matrix() - poa", {
basic_expr <- call(
"travel_time_matrix",
r5r_core = r5r_core,
origins = pois,
destinations = pois,
mode = c("TRANSIT", "WALK"),
departure_datetime = departure_datetime,
max_trip_duration = 60,
time_window = 30,
percentiles = c(1, 50, 99)
)
small_draws_expr <- big_draws_expr <- basic_expr
small_draws_expr$draws_per_minute <- 1
big_draws_expr$draws_per_minute <- 5
small_draws <- eval(small_draws_expr)
big_draws <- eval(big_draws_expr)
expect_identical(small_draws, big_draws)
mcrap_basic_expr <- basic_expr
mcrap_basic_expr$fare_structure <- fare_structure
mcrap_basic_expr$max_fare <- 5
mcrap_small_draws_expr <- mcrap_big_draws_expr <- mcrap_basic_expr
mcrap_small_draws_expr$draws_per_minute <- 1
mcrap_big_draws_expr$draws_per_minute <- 5
mcrap_small_draws <- eval(mcrap_small_draws_expr)
mcrap_big_draws <- eval(mcrap_big_draws_expr)
expect_false(identical(mcrap_small_draws, mcrap_big_draws))
})

@rafapereirabr rafapereirabr added this to the Release v1.0.0 milestone Sep 7, 2022
@rafapereirabr rafapereirabr removed this from the Release v1.0.0 milestone Dec 2, 2022
@Hussein-Mahfouz
Copy link

Hi! I think my question is directly related to this issue (sorry if it isn't - I can open a separate issue!)

I was using travel_time_matrix() function with the time_window() parameter on a stop_times based gtfs feed (no frequency.txt). I then read the time_window() vignette and realized that the argument should only be used for feeds with a frequency.txt file. During this process my results gave me questions on the time_window parameter, and how r5/r5r handle it when using a stop_times based feed (I've written the questions in more detail below)

For context, I was exploring the effect of different combinations of: time_window, max_walk_time, and percentiles. When I was passing different time_window arguments, the results had a lot of NA values, as you can see in the first figure. However, when I removed the time window argument, the results had no NA values

Figure 1: time_window USED

time_window_yes

Figure 2: time_window NOT USED

Please ignore time_window in the legend. I had many scenarios but I didn't actually use the time_window parameters here

time_window_no

My questions

  1. What does r5 / r5r do in the case of a time_window() argument being passed on a gtfs feed with no frequency.txt? What if I have multiple feeds and some have a frequency.txt and some don't? Should r5r throw a warning / error if you are trying to use time_window and (one of) the feeds doesn't have a frequency.txt?
  2. Is the percentiles argument only used along with the time_window() argument? Or can it be used with a stop_times based feed as well?
  3. How are travel times calculated when you are using a feed with stop_times.txt but no frequency.txt? Does the routing engine return one (the fastest) result for the exact departure time specified? Or is there something similar to time_window where it is getting the median of a number of different options?

Thank you!

@rafapereirabr
Copy link
Member

Hi @mattwigway. Perhaps you could help with this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants