/** * Extracts the Path from the shortest-path-tree determined by sptEntry. */ public Path extract() { if (isFound()) throw new IllegalStateException("Extract can only be called once"); extractSW.start(); SPTEntry currEdge = sptEntry; setEndNode(currEdge.adjNode); boolean nextEdgeValid = EdgeIterator.Edge.isValid(currEdge.edge); int nextEdge; while (nextEdgeValid) { // the reverse search needs the next edge nextEdgeValid = EdgeIterator.Edge.isValid(currEdge.parent.edge); nextEdge = nextEdgeValid ? currEdge.parent.edge : EdgeIterator.NO_EDGE; processEdge(currEdge.edge, currEdge.adjNode, nextEdge); currEdge = currEdge.parent; } setFromNode(currEdge.adjNode); reverseOrder(); extractSW.stop(); return setFound(true); }
@Override public void processEdge(int edgeId, int adjNode) { super.processEdge(edgeId, adjNode); } };
/** * Extracts the Path from the shortest-path-tree determined by sptEntry. */ public Path extract() { if (isFound()) throw new IllegalStateException("Extract can only be called once"); extractSW.start(); SPTEntry goalEdge = sptEntry; setEndNode(goalEdge.adjNode); while (EdgeIterator.Edge.isValid(goalEdge.edge)) { processEdge(goalEdge.edge, goalEdge.adjNode); goalEdge = goalEdge.parent; } setFromNode(goalEdge.adjNode); reverseOrder(); extractSW.stop(); return setFound(true); }
/** * Extracts the Path from the shortest-path-tree determined by sptEntry. */ public Path extract() { if (isFound()) throw new IllegalStateException("Extract can only be called once"); extractSW.start(); SPTEntry goalEdge = sptEntry; int prevEdge = EdgeIterator.NO_EDGE; setEndNode(goalEdge.adjNode); while (EdgeIterator.Edge.isValid(goalEdge.edge)) { processEdge(goalEdge.edge, goalEdge.adjNode, prevEdge); prevEdge = goalEdge.edge; goalEdge = goalEdge.parent; } setFromNode(goalEdge.adjNode); reverseOrder(); extractSW.stop(); return setFound(true); }
/** * Extracts the Path from the shortest-path-tree determined by sptEntry. */ public Path extract() { if (isFound()) throw new IllegalStateException("Extract can only be called once"); extractSW.start(); SPTEntry currEdge = sptEntry; setEndNode(currEdge.adjNode); boolean nextEdgeValid = EdgeIterator.Edge.isValid(currEdge.edge); int nextEdge; while (nextEdgeValid) { // the reverse search needs the next edge nextEdgeValid = EdgeIterator.Edge.isValid(currEdge.parent.edge); nextEdge = nextEdgeValid ? currEdge.parent.edge : EdgeIterator.NO_EDGE; processEdge(currEdge.edge, currEdge.adjNode, nextEdge); currEdge = currEdge.parent; } setFromNode(currEdge.adjNode); reverseOrder(); extractSW.stop(); return setFound(true); }