Skip to content

Commit

Permalink
improved documentation of suboptimal_minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapereirabr committed Nov 25, 2023
1 parent ba1f15d commit 1fcf301
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
13 changes: 8 additions & 5 deletions r-package/R/detailed_itineraries.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@
#' function: `vignette("time_window", package = "r5r")`.
#' @param suboptimal_minutes A number. The difference in minutes that each
#' non-optimal RAPTOR branch can have from the optimal branch without being
#' disregarded by the routing algorithm. This argument emulates the real-life
#' behaviour that makes people want to take a path that is technically not
#' optimal (in terms of travel time, for example) for some practical reasons
#' (e.g. mode preference, safety, etc). In practice, the higher this value,
#' the more itineraries will be returned in the final result.
#' disregarded by the routing algorithm. If, for example, users set
#' `suboptimal_minutes = 10`, the routing algorithm will consider sub-optimal
#' routes that arrive up to 10 minutes after the arrival of the optimal one.
#' This argument emulates the real-life behaviour that makes people want to
#' take a path that is technically not optimal in terms of travel time, for
#' example, for some practical reasons (e.g. mode preference, safety, etc).
#' In practice, the higher this value, the more itineraries will be returned
#' in the final result.
#' @param shortest_path A logical. Whether the function should only return the
#' fastest itinerary between each origin and destination pair (the default)
#' or multiple alternatives.
Expand Down
13 changes: 8 additions & 5 deletions r-package/man/detailed_itineraries.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions r-package/vignettes/detailed_itineraries.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ poi <- fread(file.path(data_path, "poa_points_of_interest.csv"))

In this example below, we want to know some alternative routes between a single origin/destination pair. To get multiple route alternatives, we need to set `shortest_path = FALSE`.

Note that in the example below we set `suboptimal_minutes = 8`. In this case, `r5r` will consider sub-optimal routes that arrive up to 10 minutes after the arrival of the optimal route.

```{r, message = FALSE}
# set inputs
origins <- poi[10,]
Expand Down

0 comments on commit 1fcf301

Please sign in to comment.