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

Configurable live speed traffic fading time #4177

Open
janusz-anue opened this issue Jun 23, 2023 · 6 comments · May be fixed by #4340
Open

Configurable live speed traffic fading time #4177

janusz-anue opened this issue Jun 23, 2023 · 6 comments · May be fixed by #4340

Comments

@janusz-anue
Copy link
Contributor

It could be beneficial to have the live speed fading configurable in the valhalla.json. Currently it is hardcoded in the file valhalla/baldr/graphtile.h in the GetSpeed(...) function with:

constexpr double LIVE_SPEED_FADE = 1. / 3600.;

I am exploring ways to read out the value from the config and pass it to the GetSpeed-Function in a backwards compatible and contributable way that doesn't uglify the codebase. But reading the config in the cost models currently is not possible as far as I see it. Are there ways to get this value in the cost model that I am missing?

Janusz Spatz on behalf of Mercedes-Benz Tech Innovation GmbH.
Provider Information

@nilsnolde
Copy link
Member

Yeah, not having access to the config in costing makes quite a few things very ugly/hard.. @kevinkreiser had the idea to make the config a singleton which gets created first thing on startup of any process and is then easily accessible to every file. Then we remove all the code passing down the config to every small function way downstream.

Is that smth you'd be interested in as well? The singleton itself isn't much work I think..

@janusz-anue
Copy link
Contributor Author

Thanks for the quick reply. The suggestion sounds useful and I could not think about any drawbacks to this singleton, it is just the bad rep that it gets and the many little rewrites of source and tests that makes me think about other ways to achieve the solution.

Maybe it would be enough if we find a way to make the config pt available in the dynamic cost class?

@nilsnolde
Copy link
Member

if we find a way to make the config pt available in the dynamic cost class

I looked into that before, I don't think we'd like that as a project (correct me @kevinkreiser). We should really do the work for the singleton (which is totally fine IMO, if used wisely), instead of further digging that hole. 95% of the changes are mechanical I think.

@kevinkreiser
Copy link
Member

kevinkreiser commented Jun 23, 2023

yeah passing the config into every place we need costing is a refactor nightmare. we need to do the global config singleton idea and then remove config passing from vast swathes from the code base. i forget if i have an issue for this but its definitely the way to go

@kevinkreiser
Copy link
Member

its this one, just updated: #1158

@janusz-anue
Copy link
Contributor Author

Okay this will be something that we'll work on then

@johannes-no johannes-no linked a pull request Oct 17, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants