Adjust speed penalty and add dimensions to autocost#5627
Adjust speed penalty and add dimensions to autocost#5627chrstnbwnkl merged 36 commits intovalhalla:masterfrom
Conversation
|
|
||
| // Default speed penalty factor (increase the cost of an edge if the edge speed is faster than the top speed) | ||
| constexpr float kDefaultSpeedPenaltyFactor = 0.05f; | ||
| constexpr ranged_default_t<float> kSpeedPenaltyFactorRange{0.0f, kDefaultSpeedPenaltyFactor, 1.0f}; |
There was a problem hiding this comment.
the lower bound needs to be kMinFactor to avoid zero edge cost
There was a problem hiding this comment.
Ah nevermind, I was under the impression this was multiplied with the edge cost directly, but in this case we want to be able to set the speed penalty to 0.
| midgard::ranged_default_t<float> height_; | ||
| midgard::ranged_default_t<float> width_; | ||
| midgard::ranged_default_t<float> length_; | ||
| midgard::ranged_default_t<float> weight_; |
There was a problem hiding this comment.
If these are now present in the BaseCostingOptions, shouldn't they be removed from TruckCost, and then TruckCost would simply override the defaults?
Lines 107 to 114 in 8a0ae9d
There was a problem hiding this comment.
Wouldn't this prevent us from having different ranges? For example, TruckLength currenlty has a range of 0 to 50 m, while the range for cars is 0 to 20 m.
If this is not needed i can change it.
There was a problem hiding this comment.
Mh, I didn't think about that. But generally I favor opening up ranges, because it's hard to make assumptions about edge cases (makes me think of Falsehoods Programmers Believe About Names) . Also I'd say widening these ranges comes with hardly any performance penalty.
| constexpr float kDefaultAutoHeight = 1.6f; // Meters (62.9921 inches) | ||
| constexpr float kDefaultAutoWidth = 1.9f; // Meters (74.8031 inches) | ||
| constexpr float kDefaultAutoLength = 5.3f; // Meters (208,661 inches) | ||
| constexpr float kDefaultAutoWeight = 3.0f; // Metric Tons (6613,87 lbs) |
There was a problem hiding this comment.
The default weight seems a little high maybe? I don't know too much about cars, but this looks more like the weight of a SUV. I think we'd be better off by setting it to an optimistically low value in order not to have routes failing that previously wouldn't have failed.
There was a problem hiding this comment.
Yeah agree. IMO we don't even need defaults at all (or very low ones, passing the smallest car). That'd keep it as it currently is. Roads with car access are 99.99% built with cars in mind. The main point is that now you can modify that for costing. If anyone drives a monster like the dimensions here, they'll need to pass them.
There was a problem hiding this comment.
Agree 100% ill change it to the size of a smaller car.
Co-authored-by: Nils <nilsnolde@proton.me>
|
For me this is good to go if you just format the code again and resolve the changelog conflicts (we just released 3.6.0, so this needs to go in the new section now) |
| constexpr float kDefaultHeight = 1.6f; // Meters (62.9921 inches) | ||
| constexpr float kDefaultWidth = 1.9f; // Meters (74.8031 inches) | ||
| constexpr float kDefaultLength = 2.7f; // Meters (208,661 inches) | ||
| constexpr float kDefaultWeight = 0.8f; // Metric Tons (6613,87 lbs) |
There was a problem hiding this comment.
just skimming again: is this the same default for truck? that'd be a change we probably shouldn't do. not that I really agree with the defaults there, but default truck should stay the same regardless
There was a problem hiding this comment.
The truck profile overwrites the defaults with the truck defaults, so the default values for trucks remain the same.
|
@johannes-no fyi, CI is failing, smth relevant to this PR on osx |
|
and you'll need to run format.sh |
…tocost # Conflicts: # valhalla/sif/dynamiccost.h
|
Hello, sorry, due to vacation, this has taken an unnecessarily long time. |
|
Cool, thanks! For me it'd be easier to keep the other PRs on the old fork, so comments etc are preserved. |
# Conflicts: # proto/options.proto
|
@chrstnbwnkl do you guys have your sync today? Maybe we can merg this |
chrstnbwnkl
left a comment
There was a problem hiding this comment.
I think the code looks good now, could you also move the costing parameters description from the truck section to the table above it ("Vehicle Options")?
|
Can you update it as well (replace truck with vehicle and add diverging defaults for truck)? |
chrstnbwnkl
left a comment
There was a problem hiding this comment.
I just realize I have edit privileges on this branch, so could've done this myself 😄 thanks!
As discussed in #5595, this pull request extends autocosting to include the dimensions of length and weight.
In addition, the speed penalty for set top speeds has been adjusted. This can now be controlled via the input parameter “speed_penalty_factor” so it can be ignored entirely by setting it to 0.
I am open for suggestions and also nitpicks as I am looking to improve my C++ coding.
Johannes Nonnenmacher on behalf of Mercedes-Benz Tech Innovation GmbH.
Provider Information