I’m new to GH code and probably I am missing something, however checking on the GH source code I found something that I cannot explain.
I’m moving GH from the 6.2 version to the 8 version checking the new custom models to ensure backward compatibility to what I had before.
Analyzing the code I found that despite being included in the calcEdgeWeight in CustomWeighting calculation the priority seems to be always getting the value of 1 as you can see here and here .
My suspect are reinforced by the fact that in the last class there is a getRawPriority method that would expose the priority_enc fields seems not to be used by any reference.
Doesn’t this mean that despite the priority set in a custom model or given to an edge by a VehicleParser the priority will be always be equal to 1? Am I missing some other relevant pieces of code?
The CustomWeightingHelper is not directly used, only a subclass of it. The magic involves using Janino which creates this subclass at runtime. Have a look into CustomModelParser.createGetPriorityStatements where the code is created to overwrite CustomWeightingHelper.getPriority to run the statement list in customModel.getPriority.
I have a blog post that explains this in more detail but need to polish it a bit further
Tried to make a test with the following configuration and compared with the old version and I found out there’s a significant difference with the car and motorbike estimation.
As I said I was starting with a very similar profile with the fastest_weight enabled for all profiles, so in having 0 distance influence should be in principle the same.
Also about the motorbike, is it good to reuse the car profile? Should I go with a more custom profile like the one shown here?