[GraphHopper] Fwd: Cannot change weighting mechanism
Александр Черепанов
lanmaster at hotmail.ru
Tue Dec 9 17:34:01 UTC 2014
---------- Forwarded message ----------
From: Александр Черепанов <lanmaster at hotmail.ru>
Date: 2014-12-09 17:31 GMT+05:00
Subject: Cannot change weighting mechanism
To: graphhopper at openstreetmap.org
Good day.
We have modificate our project with this doc:
https://github.com/graphhopper/graphhopper/blob/0.3/docs/core/weighting.md
Parameters in config file:
prepare.chShortcuts=fastest
There is our method:
@Override
public double calcWeight( EdgeIteratorState edge, boolean reverse )
{
/*
if(forbiddenEdges.contains(edge.getEdge()))
return Double.POSITIVE_INFINITY;
*/
double speed = reverse ?
encoder.getReverseSpeed(edge.getFlags()):encoder.getSpeed(edge.getFlags());
if (speed == 0)
return Double.POSITIVE_INFINITY;
double res = Math.random() * edge.getDistance() / speed;
return res;
}
We want to simulate road jamm this way with Random weighting, but there is
no changes in result track. What we are doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20141209/59fba4be/attachment.html>
More information about the GraphHopper
mailing list