@Override protected double calcWeight(EdgeIteratorState iter, SPTEntry currEdge, boolean reverse) { // TODO performance: check if the node is already existent in the opposite direction // then we could avoid the approximation as we already know the exact complete path! return super.calcWeight(iter, currEdge, reverse); }
private void fillEdges(SPTEntry currEdge, PriorityQueue<SPTEntry> prioQueue, IntObjectMap<SPTEntry> bestWeightMap, EdgeExplorer explorer, boolean reverse) { EdgeIterator iter = explorer.setBaseNode(currEdge.adjNode); while (iter.next()) { if (!accept(iter, currEdge, reverse)) continue; final int origEdgeId = getOrigEdgeId(iter, reverse); final int traversalId = getTraversalId(iter, origEdgeId, reverse); final double weight = calcWeight(iter, currEdge, reverse); if (Double.isInfinite(weight)) continue; SPTEntry entry = bestWeightMap.get(traversalId); if (entry == null) { entry = createEntry(iter, weight, currEdge, reverse); bestWeightMap.put(traversalId, entry); prioQueue.add(entry); } else if (entry.getWeightOfVisitedPath() > weight) { prioQueue.remove(entry); updateEntry(entry, iter, weight, currEdge, reverse); prioQueue.add(entry); } else continue; if (updateBestPath) updateBestPath(iter, entry, traversalId, reverse); } }
@Override protected double calcWeight(EdgeIteratorState iter, SPTEntry currEdge, boolean reverse) { // TODO performance: check if the node is already existent in the opposite direction // then we could avoid the approximation as we already know the exact complete path! return super.calcWeight(iter, currEdge, reverse); }
private void fillEdges(SPTEntry currEdge, PriorityQueue<SPTEntry> prioQueue, IntObjectMap<SPTEntry> bestWeightMap, EdgeExplorer explorer, boolean reverse) { EdgeIterator iter = explorer.setBaseNode(currEdge.adjNode); while (iter.next()) { if (!accept(iter, currEdge, reverse)) continue; final int origEdgeId = getOrigEdgeId(iter, reverse); final int traversalId = getTraversalId(iter, origEdgeId, reverse); final double weight = calcWeight(iter, currEdge, reverse); if (Double.isInfinite(weight)) continue; SPTEntry entry = bestWeightMap.get(traversalId); if (entry == null) { entry = createEntry(iter, weight, currEdge, reverse); bestWeightMap.put(traversalId, entry); prioQueue.add(entry); } else if (entry.getWeightOfVisitedPath() > weight) { prioQueue.remove(entry); updateEntry(entry, iter, weight, currEdge, reverse); prioQueue.add(entry); } else continue; if (updateBestPath) updateBestPath(iter, entry, traversalId, reverse); } }