Giter Site home page Giter Site logo

Comments (1)

mpadge avatar mpadge commented on August 16, 2024
library (m4ra)
packageVersion ("m4ra")
#> [1] '0.1.0.193'

net_sc <- "/<path>/<to>/mannheim-sc.Rds"
gtfs <- "/<path>/<to>/mannheim-gtfs-with-transfers.Rds"
city <- city_name <- "mannheim"
from <- c ("1216123389", "4187247393", "1178997830", "4502052112", "659273998",
           "1386088239", "273373473", "269713455", "1742645215", "5045799953")
from_initial <- from
initial_mode <- final_mode <- "bicycle"
quiet <- FALSE
day <- start_time_limits <- NULL
fast <- FALSE

# Initial call to set up caching
x <- m4ra_times_multi_mode (net_sc = net_sc, gtfs = gtfs,
        city_name = city_name, initial_mode = initial_mode,
        final_mode = final_mode, from = from, quiet = TRUE)

system.time ({
    x1 <- m4ra_times_multi_mode (
        net_sc = net_sc,
        gtfs = gtfs,
        city_name = city_name,
        initial_mode = initial_mode,
        final_mode = final_mode,
        from = from
    )
})
#> ✔ Total time for data preparation: 00:00:00.37
#> ℹ Calculating single-mode travel times for bicycle
#> ✔ Calculated single-mode travel times for bicycle
#> ℹ Calculating multi-mode travel times
#> ✔ Calculated multi-mode travel times
#>    user  system elapsed 
#>  45.724   0.807   8.221
dim (x1)
#> [1]    10 62403
system.time ({
    x2 <- m4ra_times_multi_mode (
        net_sc = net_sc,
        gtfs = gtfs,
        city_name = city_name,
        initial_mode = initial_mode,
        final_mode = final_mode,
        from = from,
        duration_max = 900 # 15 minutes
    )
})
#> ✔ Total time for data preparation: 00:00:00.28
#> ℹ Calculating single-mode travel times for bicycle
#> ✔ Calculated single-mode travel times for bicycle
#> ℹ Calculating multi-mode travel times
#> ✔ Calculated multi-mode travel times
#>    user  system elapsed 
#>  31.249   0.473   5.646
dim (x2)
#> [1]    10 62354

Created on 2023-04-24 with reprex v2.0.2

And passing a value for duration_max trims a few destination points off the final matrix which are reached with the full routine, but that example amounts to < 0.08% of all points, so can easily be ignored for general use.

from m4ra.

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.