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
Added option for country specific toll factor #4289
base: master
Are you sure you want to change the base?
Conversation
Hm, this is honestly a bit far away from being mergeable. Skimming it quickly I don’t even understand how this is supposed to be used. It’d certainly help if you’d outline the expected request parameterization and explain the design choices. Generally: we don’t modify costing stuff per algorithm. The costing class exists so all algorithms can share the costing logic and it’s one of the major principles of Valhalla. But before you modify smth, I’d appreciate a more thorough explanation. |
Hi Nils Thank you for your feedback. I'd like to outline our use case and our efforts to implement it with backward compatibility. A sample route request would look like:
'country_code' is introduced in Costing-Options and a new 'cost_per_country' message is added which can take multiple Options. The "costing_options" can parse a request like the following:
Inside "cost_per_country" list, individual avoid options can be bound to country_code list. In short, "use_tolls" = 0.4 is applied for DE and CH, "use_tolls" = 0.2 is applied for FR and "use_tolls" = 1 is applied for any other country. Dynamiccost is modified to introduce 4 new functions, these methods are overriden in the autocost. Finally in the algorithm(bidir astar) the toll_factor_per_country map is pulled and the toll_factor_is set dynamically depending on the admin iso code of the end node before calling the EdgeCost function on the costing_. We thought of having a country_based costing wrapper but costing_ is set depending on the mode in valhalla and the wrapper class does not fit. Or what do you think? I understand this might not be a good way to implement the whole thing. It would be helpful if you could give your feedback and outline the drawbacks of the approach. We can improve based on your comments. |
(talking purely for myself, not the project) This is a bigger implementation with quite a (positive) impact. It seems backwards-compatible just fine, however the implementation is itself is, as you suggest, not really inline with our general architecture IMO. To get this into master would take more effort than I'm willing to accept pro-bono. If you need assistance to make this mergeable, I'm available on enquiry@gis-ops.com. I'm not the only maintainer of course, you might have more luck with others. |
I'm a software developer colleague of @ADMUKHE and @johannes-no . @kevinkreiser can you give us some information how we can change the implementation to get it mergeable and fitting to the general architecture? We would also be interested in a short meeting if possible like you had it with our colleague @PhilippVoigt which left the company. Thank you and regards Frank Scholter Peres frank.scholter_peres@mercedes-benz.com, Mercedes-Benz Tech Innovation GmbH |
many apologies @ADMUKHE @johannes-no and @FScholPer im not dragging my feet on this on purpose its all just a matter of finding the time on my end. the original issue that is linked pretty much has all the information but i realize that some of the details might be better discussed in a meeting for sake of clarity and time. i dont have very good availability this week however next week should be fine. i'll send you guys an email to set something up |
@ADMUKHE @johannes-no @FScholPer i havent heard back from you, let me know if you would like to meet to discuss this. thanks again! |
i owe you a second pass on the code with more specitic pointers and suggestions. i'll try to get that in the next few days. make a comment here if i dont get to it soon enough sometimes i need a "bump" 😄 |
@kevinkreiser Hey, have you had a chance to look into this? |
@kevinkreiser I havent heard back from you. Should we schedule another F2F to discuss the architektural changes? |
yeah i started typing something and never finished it. i have 3 pieces to propose one of those we already discussed. they are
|
@kevinkreiser It would be very helpful if you can sketch this cache object for us. Especially its tricky as where we should initialize it? |
Associate toll factor with specific country
This PR is targetting #4161. Presently valhalla cannot apply toll factors to specific countries. These changes will allow toll factor to be set in the algorithm depending on the value of a multiple costing option flag which can be set in the request.
The program was tested solely for our own use cases, which might differ otherwise. I acknowledge that these changes have the potential to impact other use cases, and it is essential to exercise caution and thorough testing when merging them to the master. Your expert opinion is requested to help us review, test, and adapt these modifications as needed. I am also looking forward to other implementation ideas and discussions about how we can tackle this issue.
Tasklist
Adrika Mukherjee adrika.mukherjee@mercedes-benz.com, Mercedes-Benz Tech Innovation GmbH
Provider Information
Licensed under MIT