Score search stategies


First, thanks for jsprit (and graphhopper) that are impressive pieces of work!

I would like to score the search methods (strategies) in order to modified continuously their weights. My goal is to implement an adaptive weights adjustment procedure as it is done in the Pisinger and Ropke ALNS heuristic.

I need to know which strategy was chosen and the cost of the new solution that I compare with the best stored solutions. Where could i implement that? What is the easiest way to do that?

Thanks in advance!

PS: I already had a look to the “BuildAlgorithmFromScratch” example. I do not see where I could access to the required information to construct the score function.


Thanks for your kind words.

Interesting project!

There are various ways to hook into the algorithm. For example, look at the StrategySelectedListener. This gives you access to the selected strategy and the quality of the resulting solution. Just implement it and add this to the algorithm with this method.

Let me know if you need further help.



thanks for your answer. it is exactly what I was looking for.