valhalla icon indicating copy to clipboard operation
valhalla copied to clipboard

defaults on exclusive numeric attributes like height, weight

Open nilsnolde opened this issue 3 years ago • 3 comments

I'm unsure if we're handling numeric defaults for exclusive attributes like weight/height etc really well.

e.g. truck has really high defaults: https://github.com/valhalla/valhalla/blob/5939f8fd32b57ddfe57cd1379d57ae8db8e47c24/src/sif/truckcost.cc#L50-L54

it might sorta reflect the average truck, but 12 tons and less than 4 m height can also be considered a truck (in Germany at least). shouldn't we rather default to 0 for these kind of exclusive attributes instead of trying to guess? if people think they need those attributes for their routes, I think they really should explicitly specify their dimensions etc.

opinions?

nilsnolde avatar Oct 29 '21 15:10 nilsnolde

a reasonable question, defaults are always hard especially when they are globally applicable :( its kind of like bikes, you have to guess what the average user will have. with trucks theres even more variation

cc @gknisely

kevinkreiser avatar Oct 29 '21 17:10 kevinkreiser

one way could be to introduce a new top-level config member defaults, similar to service_limits (again defaulting to the above values, in both the config generator and the c++ parser)? not sure right now if/what other profiles might add to that. I just feel this should be more prominent for a user.

nilsnolde avatar Oct 30 '21 09:10 nilsnolde

coming back to this, @gknisely do you have an opinion?

bicycle has bike types which are pretty meaningful and a user can sorta infer from the name what the defaults will be like (though we do of course default to bike profile). with truck I'm not sure I'd expect the service to assume any defaults on dimensions at all (or if any, only the minimum). I'd just expect it to respect hgv-specific, yet generic, access/turn restrictions etc, and any further limitations like dimensions/hazmat I'd expect to set manually. my 2c:)

nilsnolde avatar Mar 11 '22 10:03 nilsnolde