Repository navigation
Conversation
There was a problem hiding this comment.
Thanks for fixing this issue so fast :).
In general this PR looks good to me.
Is there a reason we cannot define the maximum weight for each weighting? If we prepare good and "bad" weightings, it might be nice to only change the factor for the bad weighting?
I briefly tried your PR. I changed the FastestWeighting to the following (which is not a very clever thing to do ;))
@Override
public double getMinWeight(double distance) {
return .0001 * distance / maxSpeed;
}
I then tried to load a very small area.
I expected to see some warning, and I got it: landmark 15 (45.5060110354277,-73.5529020105206): too many weights were maxed out (439/440). Use a bigger factor than 8.915815424711059E-7. For example use the following in the config.properties: prepare.lm.maximum_weight=1.7831630849422118E-6.
But this is the factor * 2. This should be factor * 2 * PRECISION?
More advanced: Would it make sense to estimate a better factor than 2? Maybe we can calculate the average maxedout value and show that here (or max maxedout?)? Would not be necessary, but fancy :). As I completely messed up the min weight of the fastest weighting (see above), the log started to propose to set the max_weighting at around .1. I ended up to set it to 1000, which fixed it (as I did *.0001, 1000 made sense).
I would be fine with just changing the Log for now and fixing the other two comments in a different PR.
You mean a new method of the Weighting interface? I wanted to avoid this for now :)
What do you mean here?
My idea was to keep the minWeight but specify an absolute value in the config.properties: prepare.lm.maximum_weight=1.222
Yes, will fix!
We can determine the maximum weight ourselfs and add 50% (maybe in a different PR and if you have interests :) ?). Still this would be just a heuristic approx... |
|
Ah, now I understand what you mean here:
This is indeed important. Will think how to handle this. |
This should be possible now via |
| if ((double) maxedout.get() / map.size() > 0.1) { | ||
| LOGGER.warn("landmark " + lmIdx + " (" + nodeAccess.getLatitude(lmNodeId) + "," + nodeAccess.getLongitude(lmNodeId) + "): " + | ||
| "too many weights were maxed out (" + maxedout.get() + "/" + map.size() + "). Use a bigger factor than " + lms.factor | ||
| + ". For example use the following in the config.properties: weighting=" + weighting.getName() + "|maximum=" + finalMaxWeight.getValue() * 1.2 / PRECISION); |
There was a problem hiding this comment.
Mhm, somehow the proposal does not match here :/. Why do we divide by PRECISION?
When I set prepare.lm.weightings=fastest|maximum=100 then I get the following log landmark 15 (45.5060110354277,-73.5529020105206): too many weights were maxed out (294/440). Use a bigger factor than 0.00152587890625. For example use the following in the config.properties: weighting=fastest|maximum=0.004969158898255066.
There was a problem hiding this comment.
Why do we divide by PRECISION?
You are right ... I was still thinking in terms of factor=weight/PRECISION
There was a problem hiding this comment.
Then the suggestion makes more sense maximum=325 (2^16*0.004969158898255066)
There was a problem hiding this comment.
Yes, that makes sense. Thank you :). I just tried it with 250, the warning was only printed for one landmark now. When switching to 325 there is no warning anymore.
boldtrn
left a comment
There was a problem hiding this comment.
LGTM, thanks! Setting the maxweight only for the weightings that create issues is exactly what I meant.
Fixes #960