/** * Logic that was previously located in the calcLeastCostPath(...) method. * Can be overwritten in the MultiModalDijkstra. * Returns the last node of the path. By default this is the to-node. * The MultiNodeDijkstra returns the cheapest of all given to-nodes. */ /*package*/ Node searchLogic(final Node fromNode, final Node toNode, final RouterPriorityQueue<Node> pendingNodes) { boolean stillSearching = true; while (stillSearching) { Node outNode = pendingNodes.poll(); if (outNode == null) { log.warn("No route was found from node " + fromNode.getId() + " to node " + toNode.getId() + ". Some possible reasons:"); log.warn(" * Network is not connected. Run NetworkCleaner().") ; log.warn(" * Network for considered mode does not even exist. Modes need to be entered for each link in network.xml."); log.warn(" * Network for considered mode is not connected to starting or ending point of route. Setting insertingAccessEgressWalk to true may help."); log.warn("This will now return null, but it may fail later with a null pointer exception."); return null; } if (outNode == toNode) { stillSearching = false; } else { relaxNode(outNode, toNode, pendingNodes); } } return toNode; }