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

fix prob routing algorithm #17

Closed
mpadge opened this issue May 2, 2017 · 5 comments
Closed

fix prob routing algorithm #17

mpadge opened this issue May 2, 2017 · 5 comments
Assignees

Comments

@mpadge
Copy link
Contributor

mpadge commented May 2, 2017

compare the current version which seems to give some odd results with the code of gdistance.

@mpadge mpadge self-assigned this May 2, 2017
@mpadge mpadge added this to the Finish R part of the package milestone May 2, 2017
@mpadge
Copy link
Contributor Author

mpadge commented May 10, 2017

@karpfen so i've managed to get the toy examples from the paper roughly working but:

  1. Even they don't precisely reproduce the results given in the paper (although close enough to probably be okay), and
  2. It doesn't work at all when scaled up to your street network example.
    I'll have to keep digging around ...

@karpfen
Copy link
Member

karpfen commented May 10, 2017

Okay, cool! I didn't manage to break up the functions in a way that actually fixes any issues yet, but if you're feeling adventurous, here's a way that allows you to make a compact graph and pass it to the generic osm_router () function. Maybe that could be useful for you.

devtools::load_all (export_all = FALSE)
library (magrittr)
dat <- readRDS ("tests/compact-ways-munich.Rda") %>% makeCompactGraph %>%
    extract2 ("compact") %>% extract (c ("from_id", "to_id", "d_weighted"))

dat$from_id %<>% as.character %>% as.numeric
dat$to_id %<>% as.character %>% as.numeric
allids <- c (dat$from_id, dat$to_id) %>% sort %>% unique 
dat$from_id <- vapply (dat$from_id, function (x) { which (allids == x) -1 }, 0.)
dat$to_id <- vapply (dat$to_id, function (x) { which (allids == x) -1 }, 0.)

st <- dat$from_id [1]
en <- dat$to_id [30]
osm_router (dat, st, en)

@mpadge
Copy link
Contributor Author

mpadge commented May 18, 2017

@karpfen check it out:
munchen-test
👍

@mpadge
Copy link
Contributor Author

mpadge commented May 18, 2017

and then some using the full graph, first with no entropy
munchen-test-low-entropy
and then one with some randomness
munchen-test-high-entropy
😄 🎆 🍾 👍 💯 🍻 emoji fever!

@mpadge
Copy link
Contributor Author

mpadge commented Jun 2, 2017

all done but sole remaining issue regarding the actual routing algorithm of #30

@mpadge mpadge closed this as completed Jun 2, 2017
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