@Override public Path constructPath(Node fromNode, Node toNode, double startTime) { if (toNode == null || fromNode == null) return null; if (!(fromNode instanceof RoutingNetworkNode)) fromNode = this.routingNetwork.getNodes().get(fromNode.getId()); if (!(toNode instanceof RoutingNetworkNode)) toNode = this.routingNetwork.getNodes().get(toNode.getId()); return super.constructPath(fromNode, toNode, startTime); }
/** * This method should only be called from outside after calcLeastCostPath(...) has * been executed. After that, the paths between the multiple start and/or end nodes * can be constructed using this method. * * Is there a way to check whether this method is called as intended?? * cdobler, oct'13 */ public Path constructPath(Node fromNode, Node toNode, double startTime) { if (toNode == null || fromNode == null) return null; else { DijkstraNodeData toData = getData(toNode); if (!toData.isVisited(this.getIterationId())) return null; DijkstraNodeData fromData = getData(fromNode); if (!fromData.isVisited(this.getIterationId())) return null; double arrivalTime = toData.getTime(); // now construct and return the path return constructPath(fromNode, toNode, startTime, arrivalTime); } }