Skip to content

Commit

Permalink
update DESCRIPTION v7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapereirabr committed Apr 10, 2024
1 parent c3a1695 commit a6edb32
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 3 deletions.
4 changes: 2 additions & 2 deletions r-package/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: r5r
Title: Rapid Realistic Routing with 'R5'
Version: 1.1.0.9000
Version: 1.1.0.9001
Authors@R: c(
person("Marcus", "Saraiva", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0001-6218-2338")),
Expand Down Expand Up @@ -32,7 +32,7 @@ Description: Rapid realistic routing on multimodal transport networks
independent update process. Hence, users should confirm the R5 version
implied by the Conveyal user manual (see
<https://docs.conveyal.com/changelog>) corresponds with the R5 version
that r5r depends on. This version of r5r depends on R5 v7.0.
that r5r depends on. This version of r5r depends on R5 v7.1.
License: MIT + file LICENSE
URL: https://github.com/ipeaGIT/r5r
BugReports: https://github.com/ipeaGIT/r5r/issues
Expand Down
2 changes: 1 addition & 1 deletion r-package/R/onLoad.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ r5r_env <- new.env(parent = emptyenv())

# JAR version
r5r_env$r5_jar_version <- "7.1.0"
r5r_env$r5_jar_size <- 63493992
r5r_env$r5_jar_size <- 63494047

# create dir to store R5 Jar
cache_d <- paste0('r5r/r5_jar_v', r5r_env$r5_jar_version)
Expand Down
81 changes: 81 additions & 0 deletions r-package/tests/tests_rafa/v7.0_vs_7.1.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
tictoc::tic()

options(java.parameters = "-Xmx10G")


library(r5r)

# build transport network
data_path <- system.file("extdata/poa", package = "r5r")
r5r_core <- setup_r5(data_path)

# load origin/destination points
points <- read.csv(file.path(data_path, "poa_hexgrid.csv"))

departure_datetime <- as.POSIXct(
"13-05-2019 14:00:00",
format = "%d-%m-%Y %H:%M:%S"
)

ttm <- travel_time_matrix(
r5r_core,
origins = points,
destinations = points,
mode = c("WALK", "TRANSIT"),
departure_datetime = departure_datetime,
max_trip_duration = 60
)
head(ttm)

# using a larger time window
ttm <- travel_time_matrix(
r5r_core,
origins = points,
destinations = points,
mode = c("WALK", "TRANSIT"),
departure_datetime = departure_datetime,
time_window = 30,
max_trip_duration = 60
)
head(ttm)

# selecting different percentiles
ttm <- travel_time_matrix(
r5r_core,
origins = points,
destinations = points,
mode = c("WALK", "TRANSIT"),
departure_datetime = departure_datetime,
time_window = 30,
percentiles = c(25, 50, 75),
max_trip_duration = 60
)
head(ttm)

# use a fare structure and set a max fare to take monetary constraints into
# account
fare_structure <- read_fare_structure(
file.path(data_path, "fares/fares_poa.zip")
)
ttm <- travel_time_matrix(
r5r_core,
origins = points,
destinations = points,
mode = c("WALK", "TRANSIT"),
departure_datetime = departure_datetime,
fare_structure = fare_structure,
max_fare = 5,
max_trip_duration = 60,
)
head(ttm)


tictoc::toc()

# 7.1 = 16.17 segundos
# 7.0 = 14.84 segundos


# 7.1 = 424.78 segundos
# 7.0 = 382.08 segundos

0 comments on commit a6edb32

Please sign in to comment.