valhalla icon indicating copy to clipboard operation
valhalla copied to clipboard

Added highway and surface factor in Truck Cost

Open mr-loop-1 opened this issue 3 years ago • 2 comments

Added mssing cost calculations for Highway and Surface factors in truckcost.cc (/src/sif/truckcost.cc) which should have been present according to the docs

Issue

Fixes #3325

Testing

Added a test_truck_highway.cc file in /test/gurka. The tests pass after proposed fixes.

mr-loop-1 avatar Apr 07 '22 10:04 mr-loop-1

thanks @mr-loop-1 ! good start! few minor comments.

also, you need to run format.sh so CI passes. I prefer it as pre-commit hook but that's up to you:

cat ./scripts/format.sh > .git/hooks/pre-commit && tail -n +5 scripts/error_on_dirty.sh >> .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

nilsnolde avatar Apr 07 '22 11:04 nilsnolde

we could merge this as well actually. wdyt @kevinkreiser ? just came across this again when one of our apps wouldn't avoid highways on the truck costing. maybe needs a bit revised factors for surface penalties, IIRC it just copied it from the car model.

nilsnolde avatar Sep 12 '22 07:09 nilsnolde