protected Path createEmptyPath() { return new Path(graph, weighting); }
@Override protected Path extractPath() { return new Path(graph, weighting). setWeight(currEdge.weight).setSPTEntry(currEdge).extract(); }
@Override protected Path extractPath() { if (currEdge == null || !finished()) { return createEmptyPath(); } return new Path(graph, weighting).setSPTEntry(currEdge).extract(); }
@Override protected Path extractPath() { if (currEdge == null || !finished()) return createEmptyPath(); return new Path(graph, weighting). setWeight(currEdge.weight).setSPTEntry(currEdge).extract(); }
edge2.setWayGeometry(Helper.createPointList(11, 1, 10, 1)); Path path = new Path(g, new FastestWeighting(encoder)); SPTEntry e1 = new SPTEntry(edge2.getEdge(), 2, 1); e1.parent = new SPTEntry(edge1.getEdge(), 1, 1); EdgeIteratorState edge3 = g.edge(1, 3).setDistance(1000).setFlags(encoder.setProperties(10, true, true)); path = new Path(g, new FastestWeighting(encoder)); e1 = new SPTEntry(edge2.getEdge(), 2, 1); e1.parent = new SPTEntry(edge1.getEdge(), 1, 1); path = new Path(g, new FastestWeighting(encoder)); e1 = new SPTEntry(edge1.getEdge(), 0, 1); e1.parent = new SPTEntry(edge2.getEdge(), 1, 1);
@Test public void testFound() { GraphHopperStorage g = new GraphBuilder(carManager).create(); Path p = new Path(g, new FastestWeighting(encoder)); assertFalse(p.isFound()); assertEquals(0, p.getDistance(), 1e-7); assertEquals(0, p.calcNodes().size()); g.close(); }
protected Path createEmptyPath() { return new Path(graph, flagEncoder); }
protected Path createEmptyPath() { return new Path(graph, weighting); }
protected Path createEmptyPath() { return new Path(graph, weighting); }
g.edge(3, 5).setDistance(100000).setFlags(encoder.setProperties(50, true, true)); Path path = new Path(g, new FastestWeighting(encoder)); SPTEntry e1 = new SPTEntry(edge4.getEdge(), 4, 1); e1.parent = new SPTEntry(edge3.getEdge(), 3, 1);
@Override protected Path extractPath() { return new Path(graph, weighting). setWeight(currEdge.weight).setSPTEntry(currEdge).extract(); }
@Override protected Path extractPath() { return new Path(graph, weighting). setWeight(currEdge.weight).setSPTEntry(currEdge).extract(); }
@Override protected Path extractPath() { return new Path(graph, flagEncoder).setWeight(currEdge.weight).setSPTEntry(currEdge).extract(); }
@Override protected Path extractPath() { if (currEdge == null || !finished()) { return createEmptyPath(); } return new Path(graph, weighting).setSPTEntry(currEdge).extract(); }
@Override protected Path extractPath() { if (currEdge == null || !finished()) return createEmptyPath(); return new Path(graph, flagEncoder).setWeight(currEdge.weight).setSPTEntry(currEdge).extract(); }
@Override protected Path extractPath() { if (currEdge == null || !finished()) return createEmptyPath(); return new Path(graph, weighting). setWeight(currEdge.weight).setSPTEntry(currEdge).extract(); }
@Override protected Path extractPath() { if (currEdge == null || !finished()) return createEmptyPath(); return new Path(graph, weighting). setWeight(currEdge.weight).setSPTEntry(currEdge).extract(); }
public Path extractPath(Collection<QueryResult> endQRs) { // pick QueryResult closest to last GPX entry // => prefer QueryResults close to the edge double bestWeight = Double.MAX_VALUE; for (QueryResult qr : endQRs) { int node = qr.getClosestNode(); SPTEntry tmp1 = fromMap.get(node); double w = weighting.getMinWeight(qr.getQueryDistance() * maxSearchWeightMultiplier); if (tmp1 != null && bestWeight > tmp1.weight + w) { currEdge = tmp1; bestWeight = tmp1.weight + w; } } return new Path(graph, flagEncoder).setWeight(currEdge.weight).setSPTEntry(currEdge).extract(); } }