GithubHelp home page GithubHelp logo

Comments (5)

osbornejr avatar osbornejr commented on May 27, 2024

Hi @dhixsingh I am trying to look into this issue at the moment, the main hurdle I think is in the MatsimModel (~line 480).

I have setup a REQUEST_DRIVING_DISTANCE case that would most likely have two location coordinates as input args-- one that was obtained using REQUEST_LOCATION, and the other coming from the list of evacuation point locations.

But I will need some matsim mechanism to get a travel time estimate between the two locations. Do you know which that would be? I am looking at something like LeastCostPath but am unsure how to implement it.

Or is this kind of thing on the MATSim side best left to Kai?

Cheers

from bdi-abm-integration.

dhixsingh avatar dhixsingh commented on May 27, 2024

@kainagel is there an easy way to query MATSim for the driving distance (not beeline) between two nodes on the network? I guess we will first want to find the route between the nodes given some routing mode (like freespeed), and then the distance (and maybe also estimated time) covered by that route.

from bdi-abm-integration.

kainagel avatar kainagel commented on May 27, 2024

See 1df1786 and later in queryPercept. Can't say if it will work; please try around a bit with it. One issue is that you need to define the EvacRoutingMode; it will thus return the length associated with the routing mode, not the shortest path by distance. If you need the latter, you/we will need to set up a shortest path router.

from bdi-abm-integration.

dhixsingh avatar dhixsingh commented on May 27, 2024

Thanks @kainagel. Requiring the EvacRoutingMode is fine. Will try and it out and let you know if we have more questions.

from bdi-abm-integration.

dhixsingh avatar dhixsingh commented on May 27, 2024

Available since ee66066.

Usage example is here:

double distanceToSafePlace = (double)getQueryPerceptInterface().queryPercept(String.valueOf(getId()),
PerceptList.REQUEST_DRIVING_DISTANCE_TO, getShelterLocation().getCoordinates());
writer.println(prefix + "estimated driving distance to shelter accounting for detour is " + String.format("%.1f",distanceToSafePlace/1000) + "km");

Example output from scenarios/mount-alexander-shire/campbells-creek-1/jill.out looks like this:

Time 00286 Resident 0    : received fire alert
Time 00286 Resident 0    : will start driving to shelter in (Castlemaine, coords=252145.230968,5894310.30443) at time 291.0
Time 00405 Resident 0    : is blocked at link 51823
Time 00405 Resident 0    : is currently between locations (321543051, coords=251458.994864993,5892667.574804958) and (60303155, coords=251444.56941373763,5892815.969128571)
Time 00405 Resident 0    : estimated driving distance to shelter accounting for detour is 3.9km
Time 00405 Resident 0    : will reevaluate route to destination (attempt 2 of 5)
Time 00405 Resident 0    : will start driving to shelter in (Castlemaine, coords=252145.230968,5894310.30443) at time 410.0
Time 00848 Resident 0    : arrived at shelter in (Castlemaine, coords=252145.230968,5894310.30443)

/cc @osbornejr

from bdi-abm-integration.

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.