graphhopper / jsprit

jsprit is a java based, open source toolkit for solving rich vehicle routing problems
https://www.graphhopper.com/open-source/
Apache License 2.0
1.64k stars 605 forks source link

Fix check to evaluate if stateUpdaters should be added in AlgorithmUtil #512

Closed quiqua closed 3 years ago

quiqua commented 3 years ago

Currently when there is an initial route that has jobs without any locations and the default AlgorithmUtil class is used, the computation of transport costs will fail as some locations are still null.

This happens as the current check only evaluates new jobs that should be added, but not the existing ones.

I've provided a reproducible example ( 7805a89 ) and a fix for this problem ( 09afd21 ).

Happy for any feedback.

oblonski commented 3 years ago

Cool. Thanks a lot @quiqua. I will have a look at this asap.