If you enable contraction hierarchies you currently cannot do on-demand weighting. So disable CH in config.properties (prepare.chShortcuts=no) or via hopper.setCHEnable(false)
If that is too slow, I fear you have to wait until we build the more flexible but still fast routing algorithm. Regards, Peter On 09.12.2014 18:34, Александр Черепанов wrote: > > ---------- Forwarded message ---------- > From: *Александр Черепанов* <[email protected] > <mailto:[email protected]>> > Date: 2014-12-09 17:31 GMT+05:00 > Subject: Cannot change weighting mechanism > To: [email protected] <mailto:[email protected]> > > > 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? > > > > _______________________________________________ > GraphHopper mailing list > [email protected] > https://lists.openstreetmap.org/listinfo/graphhopper
_______________________________________________ GraphHopper mailing list [email protected] https://lists.openstreetmap.org/listinfo/graphhopper
