calcMillis in does not respect the “Time” property from the custom weighting class

calcMillis in does not respect the “Time” property from a custom weighting class.
This leads to directions with incorrect times.

Maybe this needs to be done in Graphhopper route(), doWork().
doWork uses Path.getTime(), so no… go back to updating Path with Weight.
I think this is a defect - because the instructions do not match the response getTime and getDistance.

Would you consider this a bug?

I think I know what you mean, but I don’t think this is a bug rather a limitation :wink:

See the related issues 393 and 311

And the weight is just the weight, no unit and so it cannot be used for time, instead we need another way to take time penalties etc into account

Ah, yes… Good point, as I was focused on my use case.
Perhaps a feature, or a specialized weighting class type, such that it implements a calcMillis interface? That way if custom weighting results in time, its accounted for, and if not, then not - i.e. optimize for car MPG or something like that. The route is different, but the times are still all the same.

Both linked items look good.