/** * Initializes the first node of a route. * * @param fromNode * The Node to be initialized. * @param toNode * The Node at which the route should end. * @param startTime * The time we start routing. * @param pendingNodes * The pending nodes so far. */ /*package*/ void initFromNode(final Node fromNode, final Node toNode, final double startTime, final RouterPriorityQueue<Node> pendingNodes) { DijkstraNodeData data = getData(fromNode); visitNode(fromNode, data, pendingNodes, startTime, 0, null); }
/** * Inserts the given Node n into the pendingNodes queue and updates its time and cost information. * * @param n The Node that is revisited. * @param data The data for node. * @param pendingNodes The nodes visited and not processed yet. * @param time The time of the visit of n. * @param cost The accumulated cost at the time of the visit of n. * @param expectedRemainingCost The expected remaining travel cost when * traveling from n to the target node of the route. * @param outLink The link from which we came visiting n. */ private void visitNode(final Node n, final AStarNodeData data, final RouterPriorityQueue<Node> pendingNodes, final double time, final double cost, final double expectedRemainingCost, final Link outLink) { data.setExpectedRemainingCost(expectedRemainingCost); super.visitNode(n, data, pendingNodes, time, cost, outLink); }
final DijkstraNodeData data = getData(n); if (!data.isVisited(getIterationId())) { visitNode(n, data, pendingNodes, currTime + travelTime, currCost + travelCost, l); return true;