@Override protected boolean finished() { if (finishedFrom || finishedTo) return true; return currFrom.weight + currTo.weight >= bestPath.getWeight(); }
@Override public boolean finished() { // we need to finish BOTH searches identical to CH if (finishedFrom && finishedTo) return true; if (isMaxVisitedNodesExceeded()) return true; // The following condition is necessary to avoid traversing the full graph if areas are disconnected // but it is only valid for none-CH e.g. for CH it can happen that finishedTo is true but the from-SPT could still reach 'to' if (!bestPath.isFound() && (finishedFrom || finishedTo)) return true; // increase overlap of both searches: return currFrom.weight + currTo.weight > explorationFactor * bestPath.getWeight(); // This is more precise but takes roughly 20% longer: return currFrom.weight > bestPath.getWeight() && currTo.weight > bestPath.getWeight(); // For bidir A* and AStarEdge.getWeightOfVisitedPath see comment in AStarBidirection.finished }
final double maxShareFactor, final double shareInfluence, final double minPlateauFactor, final double plateauInfluence) { final double maxWeight = maxWeightFactor * bestPath.getWeight(); final GHIntObjectHashMap<IntSet> traversalIDMap = new GHIntObjectHashMap<>(); final AtomicInteger startTID = addToMap(traversalIDMap, bestPath); double bestPlateau = bestPath.getWeight(); double bestShare = 0; double sortBy = calcSortBy(weightInfluence, bestPath.getWeight(), shareInfluence, bestShare, plateauInfluence, bestPlateau);
SPTEntry toEE = getFirstShareEE(toSPTEntry.parent, false); double shareWeight = fromEE.getWeightOfVisitedPath() + toEE.getWeightOfVisitedPath(); boolean smallShare = shareWeight / bestPath.getWeight() < maxShareFactor; if (smallShare) { List<String> altNames = getAltNames(graph, fromSPTEntry);
protected void updateBestPath(EdgeIteratorState edgeState, SPTEntry entry, int traversalId, boolean reverse) { SPTEntry entryOther = bestWeightMapOther.get(traversalId); if (entryOther == null) return; // update μ double weight = entry.getWeightOfVisitedPath() + entryOther.getWeightOfVisitedPath(); if (traversalMode.isEdgeBased()) { if (entryOther.edge != entry.edge) throw new IllegalStateException("cannot happen for edge based execution of " + getName()); if (entryOther.adjNode != entry.adjNode) { // prevents the path to contain the edge at the meeting point twice and subtracts the weight (excluding turn weight => no previous edge) entry = entry.getParent(); weight -= weighting.calcWeight(edgeState, reverse, EdgeIterator.NO_EDGE); } else if (!traversalMode.hasUTurnSupport()) // we detected a u-turn at meeting point, skip if not supported return; } if (weight < bestPath.getWeight()) { bestPath.setSwitchToFrom(reverse); bestPath.setSPTEntry(entry); bestPath.setSPTEntryTo(entryOther); bestPath.setWeight(weight); } }
@Override protected boolean finished() { if (finishedFrom || finishedTo) return true; return currFrom.weight + currTo.weight >= bestPath.getWeight(); }
@Override protected boolean finished() { if (finishedFrom || finishedTo) return true; // using 'weight' is important and correct here e.g. approximation can get negative and smaller than 'weightOfVisitedPath' return currFrom.weight + currTo.weight >= bestPath.getWeight(); }
@Override public boolean finished() { if (finishedFrom || finishedTo) return true; return currFrom.weight + currTo.weight >= bestPath.getWeight(); }
@Override public boolean finished() { if (finishedFrom || finishedTo) return true; return currFrom.weight + currTo.weight >= bestPath.getWeight(); }
@Override protected boolean finished() { if (finishedFrom || finishedTo) return true; // using 'weight' is important and correct here e.g. approximation can get negative and smaller than 'weightOfVisitedPath' return currFrom.weight + currTo.weight >= bestPath.getWeight(); }
@Override public boolean finished() { // we need to finish BOTH searches identical to CH if (finishedFrom && finishedTo) return true; if (isMaxVisitedNodesExceeded()) return true; // The following condition is necessary to avoid traversing the full graph if areas are disconnected // but it is only valid for none-CH e.g. for CH it can happen that finishedTo is true but the from-SPT could still reach 'to' if (!bestPath.isFound() && (finishedFrom || finishedTo)) return true; // increase overlap of both searches: return currFrom.weight + currTo.weight > explorationFactor * bestPath.getWeight(); // This is more precise but takes roughly 20% longer: return currFrom.weight > bestPath.getWeight() && currTo.weight > bestPath.getWeight(); // For bidir A* and AStarEdge.getWeightOfVisitedPath see comment in AStarBidirection.finished }
@Override public boolean finished() { // we need to finish BOTH searches identical to CH if (finishedFrom && finishedTo) return true; if (isMaxVisitedNodesExceeded()) return true; // The following condition is necessary to avoid traversing the full graph if areas are disconnected // but it is only valid for none-CH e.g. for CH it can happen that finishedTo is true but the from-SPT could still reach 'to' if (!bestPath.isFound() && (finishedFrom || finishedTo)) return true; // increase overlap of both searches: return currFrom.weight + currTo.weight > explorationFactor * bestPath.getWeight(); // This is more precise but takes roughly 20% longer: return currFrom.weight > bestPath.getWeight() && currTo.weight > bestPath.getWeight(); // For bidir A* and AStarEdge.getWeightOfVisitedPath see comment in AStarBidirection.finished }