Coder Social home page Coder Social logo

Different times, same results about r5r HOT 3 CLOSED

ipeagit avatar ipeagit commented on August 25, 2024
Different times, same results

from r5r.

Comments (3)

mvpsaraiva avatar mvpsaraiva commented on August 25, 2024

Hi @mortewle. Thanks for trying our package.
If you are using our sample data, please have in mind that the GTFS provided contains just a few routes. Hence, when calculating a travel time matrix, many travel times will come from walking trips, which should not be affected by the departure time.

I did a small test and, if you look closely, you can see that many travel times are different. Can you try the code below and report the results back, please?

options(java.parameters = "-Xmx4G")

library("r5r")
library("dplyr")

# Start R5R core
r5r_core <- setup_r5(system.file("extdata", package = "r5r"), verbose = FALSE)

# Load points
points_hex <- read.csv(system.file("extdata/poa_hexgrid.csv", package = "r5r"))


# Testing trip date and time
max_walk_distance = 800L
max_trip_duration = 120L

# 8 am
trip_date_time <- lubridate::as_datetime("2019-03-22 08:27:00")
ttm_8am <- travel_time_matrix(r5r_core, points_hex, points_hex, 
                              mode = c("WALK", "BUS"), 
                              departure_datetime = trip_date_time, max_walk_dist = max_walk_distance,
                              max_trip_duration = max_trip_duration, verbose = FALSE)

# 11 am
trip_date_time <- lubridate::as_datetime("2019-03-22 11:13:00")
ttm_11am <- travel_time_matrix(r5r_core, points_hex, points_hex, 
                              mode = c("WALK", "BUS"), 
                              departure_datetime = trip_date_time, max_walk_dist = max_walk_distance,
                              max_trip_duration = max_trip_duration, verbose = FALSE)

# Checking results
full_join(ttm_8am, ttm_11am, by=c("fromId", "toId")) %>% 
  filter(travel_time.x != travel_time.y) %>% 
  View()

full_join(ttm_8am, ttm_11am, by=c("fromId", "toId")) %>% 
  filter(travel_time.x == travel_time.y) %>% 
  View()

from r5r.

mortewle avatar mortewle commented on August 25, 2024

Hi. Looking closer at my results, it seems like all the trips I checked earlier were walking only or had the exact same waiting time for the times I chose, because now I see some divergence. It works with the code you provided as well. Thank you!

Great package by the way!

from r5r.

mvpsaraiva avatar mvpsaraiva commented on August 25, 2024

Thanks @mortewle!
All feedback is appreciated.

from r5r.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.