@Override public synchronized LeastCostPathCalculator createPathCalculator(final Network network, final TravelDisutility travelCosts, final TravelTime travelTimes) { PreProcessLandmarks preProcessLandmarks = this.preProcessData.get(network); if (preProcessLandmarks == null) { preProcessLandmarks = new PreProcessLandmarks(travelCosts); preProcessLandmarks.setNumberOfThreads(nThreads); preProcessLandmarks.run(network); this.preProcessData.put(network, preProcessLandmarks); } final double overdoFactor = 1.0; return new AStarLandmarks(network, preProcessLandmarks, travelCosts, travelTimes, overdoFactor); } }
/** * Default constructor; sets the overdo factor to 1. * @param network Where we do the routing. * @param preProcessData The pre-process data (containing the landmarks etc.). * @param timeFunction Calculates the travel time on links. */ AStarLandmarks(final Network network, final PreProcessLandmarks preProcessData, final TravelTime timeFunction) { this(network, preProcessData, preProcessData.getCostFunction(), timeFunction, 1); }
/** * @param network Where we do the routing. * @param preProcessData The pre-process data (containing the landmarks etc.). * @param costFunction * @param timeFunction Calculates the travel time on links. * @param overdoFactor The factor which is multiplied with the output of the A* heuristic function. * The higher the overdo factor the greedier the router, i.e. it visits less nodes during routing and * is thus faster, but for an overdo factor > 1, it is not guaranteed that the router returns the * least-cost paths. Rather it tends to return distance-minimal paths. * @see #AStarLandmarks(Network, PreProcessLandmarks, TravelTime) */ AStarLandmarks(final Network network, final PreProcessLandmarks preProcessData, final TravelDisutility costFunction, final TravelTime timeFunction, final double overdoFactor) { super(network, preProcessData, costFunction, timeFunction, overdoFactor); this.landmarks = preProcessData.getLandmarks(); }
@Override public synchronized LeastCostPathCalculator createPathCalculator(final Network network, final TravelDisutility travelCosts, final TravelTime travelTimes) { RoutingNetwork routingNetwork = this.routingNetworks.get(network); PreProcessLandmarks preProcessLandmarks = this.preProcessData.get(network); if (routingNetwork == null) { routingNetwork = this.routingNetworkFactory.createRoutingNetwork(network); if (preProcessLandmarks == null) { preProcessLandmarks = new PreProcessLandmarks(travelCosts); preProcessLandmarks.setNumberOfThreads(nThreads); preProcessLandmarks.run(network); this.preProcessData.put(network, preProcessLandmarks); for (RoutingNetworkNode node : routingNetwork.getNodes().values()) { node.setDeadEndData(preProcessLandmarks.getNodeData(node.getNode())); } } this.routingNetworks.put(network, routingNetwork); } FastRouterDelegateFactory fastRouterFactory = new ArrayFastRouterDelegateFactory(); final double overdoFactor = 1.0; return new FastAStarLandmarks(routingNetwork, preProcessLandmarks, travelCosts, travelTimes, overdoFactor, fastRouterFactory); } }
@Override protected LeastCostPathCalculator getLeastCostPathCalculator(Network network) { FreespeedTravelTimeAndDisutility travelTimeCostCalculator = new FreespeedTravelTimeAndDisutility(new PlanCalcScoreConfigGroup()); PreProcessLandmarks preProcessData = new PreProcessLandmarks(travelTimeCostCalculator); preProcessData.run(network); return new AStarLandmarks(network, preProcessData, travelTimeCostCalculator); }
LandmarksData r = getNodeData(node); r.updateMinMaxTravelTimes(); LandmarksData r = getNodeData(node); for (int i = 0; i < this.landmarks.length; i++) { if (r.getMinLandmarkTravelTime(i) > r.getMaxLandmarkTravelTime(i)) {