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

Error in fareto debug #403

Open
rafapereirabr opened this issue Oct 9, 2024 · 2 comments
Open

Error in fareto debug #403

rafapereirabr opened this issue Oct 9, 2024 · 2 comments

Comments

@rafapereirabr
Copy link
Member

@mattwigway , you pushed to the repo the function fareto_debug() some time ago. Only now I've found some time to have a look at it and to add some documentation to the function. However, I cannot create a simple reproducible example. See the error below. Could you give me a hand? perhaps I'm missing something here.

library(r5r)

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

# load origin/destination points
points <- read.csv(file.path(data_path, "poa_hexgrid.csv"))[1:5,]

# load fare structure object
fare_structure_path <- system.file("extdata/poa/fares/fares_poa.zip", package = "r5r")

fare_structure <- read_fare_structure(fare_structure_path)

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

# fareto debug 
fd <- fareto_debug(
  r5r_core,
  origins = points[1,],
  destinations = points[10,],
  mode = c("WALK", "TRANSIT"),
  departure_datetime = departure_datetime,
  fare_structure = fare_structure
  )

Error in FUN(X[[i]], ...) : java.lang.NullPointerException: Cannot read field "value" because "original" is null

@mattwigway
Copy link
Contributor

Yes, thanks for flagging this. I'm swamped up through mid next week but will look after that. Feel free to bug me if I don't.

@rafapereirabr
Copy link
Member Author

Thanks! In the meantime, I moved it to a separate branch.

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

2 participants