Skip to content

Commit

Permalink
fix gtfs_next_intervals calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Sep 28, 2023
1 parent d10681e commit 3e77504
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: m4ra
Title: Many-to-Many Multi-Modal Routing Aggregator
Version: 0.1.1.024
Version: 0.1.1.025
Authors@R:
person(given = "Mark",
family = "Padgham",
Expand Down
3 changes: 2 additions & 1 deletion R/gtfs.R
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,11 @@ gtfs_next_intervals <- function (gtfs, stops, res, start_time_limits) {
start_times,
diff (start_time_limits)
)
next_starts [next_starts <= 0] <- NA_integer_

first_starts <- lapply (res, function (i) as.vector (i [, 1]))
first_starts <- do.call (rbind, first_starts)
first_starts [first_starts == .Machine$integer.max] <- NA_integer_
first_starts [first_starts == .Machine$integer.max | first_starts <= 0] <- NA_integer_
next_interval <- next_starts - first_starts

# diagonals set in prepare-data routines:
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"codeRepository": "https://github.com/UrbanAnalyst/m4ra",
"issueTracker": "https://github.com/UrbanAnalyst/m4ra/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.1.1.024",
"version": "0.1.1.025",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit 3e77504

Please sign in to comment.