@Override public RoutingAlgorithm createAlgo(Graph g, AlgorithmOptions opts) { RoutingAlgorithm algo = tmpFactory.createAlgo(g, opts); if (algo instanceof AStarBidirection) { return new DebugAStarBi(g, opts.getWeighting(), opts.getTraversalMode(), mg). setApproximation(((AStarBidirection) algo).getApproximation()); } else if (algo instanceof AStar) { return new DebugAStar(g, opts.getWeighting(), opts.getTraversalMode(), mg); } else if (algo instanceof DijkstraBidirectionRef) { return new DebugDijkstraBidirection(g, opts.getWeighting(), opts.getTraversalMode(), mg); } else if (algo instanceof Dijkstra) { return new DebugDijkstraSimple(g, opts.getWeighting(), opts.getTraversalMode(), mg); } return algo; } };
String algoStr = opts.getAlgorithm(); if (DIJKSTRA_BI.equalsIgnoreCase(algoStr)) { ra = new DijkstraBidirectionRef(g, opts.getWeighting(), opts.getTraversalMode()); } else if (DIJKSTRA.equalsIgnoreCase(algoStr)) { ra = new Dijkstra(g, opts.getWeighting(), opts.getTraversalMode()); opts.getTraversalMode()); aStarBi.setApproximation(getApproximation(ASTAR_BI, opts, g.getNodeAccess())); ra = aStarBi; ra = new DijkstraOneToMany(g, opts.getWeighting(), opts.getTraversalMode()); AStar aStar = new AStar(g, opts.getWeighting(), opts.getTraversalMode()); aStar.setApproximation(getApproximation(ASTAR, opts, g.getNodeAccess())); ra = aStar; AlternativeRoute altRouteAlgo = new AlternativeRoute(g, opts.getWeighting(), opts.getTraversalMode()); altRouteAlgo.setMaxPaths(opts.getHints().getInt(MAX_PATHS, 2)); altRouteAlgo.setMaxWeightFactor(opts.getHints().getDouble(MAX_WEIGHT, 1.4));
/** * This method clones the specified AlgorithmOption object with the possibility for further * changes. */ public static Builder start(AlgorithmOptions opts) { Builder b = new Builder(); if (opts.algorithm != null) b.algorithm(opts.getAlgorithm()); if (opts.traversalMode != null) b.traversalMode(opts.getTraversalMode()); if (opts.weighting != null) b.weighting(opts.getWeighting()); if (opts.maxVisitedNodes >= 0) b.maxVisitedNodes(opts.maxVisitedNodes); if (!opts.hints.isEmpty()) b.hints(opts.hints); return b; }
FlagEncoder encoder = opts.getWeighting().getFlagEncoder(); if (encoder.supports(TurnWeighting.class)) { if (!opts.getTraversalMode().isEdgeBased()) { errors.add("Cannot use TurnWeighting with a node based traversal"); return this;
String algoStr = opts.getAlgorithm(); if (DIJKSTRA_BI.equalsIgnoreCase(algoStr)) { ra = new DijkstraBidirectionRef(g, opts.getWeighting(), opts.getTraversalMode()); } else if (DIJKSTRA.equalsIgnoreCase(algoStr)) { ra = new Dijkstra(g, opts.getWeighting(), opts.getTraversalMode()); opts.getTraversalMode()); aStarBi.setApproximation(getApproximation(ASTAR_BI, opts, g.getNodeAccess())); ra = aStarBi; ra = new DijkstraOneToMany(g, opts.getWeighting(), opts.getTraversalMode()); AStar aStar = new AStar(g, opts.getWeighting(), opts.getTraversalMode()); aStar.setApproximation(getApproximation(ASTAR, opts, g.getNodeAccess())); ra = aStar; AlternativeRoute altRouteAlgo = new AlternativeRoute(g, opts.getWeighting(), opts.getTraversalMode()); altRouteAlgo.setMaxPaths(opts.getHints().getInt(MAX_PATHS, 2)); altRouteAlgo.setMaxWeightFactor(opts.getHints().getDouble(MAX_WEIGHT, 1.4));
String algoStr = opts.getAlgorithm(); if (DIJKSTRA_BI.equalsIgnoreCase(algoStr)) { ra = new DijkstraBidirectionRef(g, opts.getWeighting(), opts.getTraversalMode()); } else if (DIJKSTRA.equalsIgnoreCase(algoStr)) { ra = new Dijkstra(g, opts.getWeighting(), opts.getTraversalMode()); opts.getTraversalMode()); aStarBi.setApproximation(getApproximation(ASTAR_BI, opts, g.getNodeAccess())); ra = aStarBi; ra = new DijkstraOneToMany(g, opts.getWeighting(), opts.getTraversalMode()); AStar aStar = new AStar(g, opts.getWeighting(), opts.getTraversalMode()); aStar.setApproximation(getApproximation(ASTAR, opts, g.getNodeAccess())); ra = aStar; AlternativeRoute altRouteAlgo = new AlternativeRoute(g, opts.getWeighting(), opts.getTraversalMode()); altRouteAlgo.setMaxPaths(opts.getHints().getInt(MAX_PATHS, 2)); altRouteAlgo.setMaxWeightFactor(opts.getHints().getDouble(MAX_WEIGHT, 1.4));
if (DIJKSTRA_BI.equalsIgnoreCase(algoStr)) ra = new DijkstraBidirectionRef(g, opts.getFlagEncoder(), opts.getWeighting(), opts.getTraversalMode()); } else if (DIJKSTRA.equalsIgnoreCase(algoStr)) ra = new Dijkstra(g, opts.getFlagEncoder(), opts.getWeighting(), opts.getTraversalMode()); opts.getTraversalMode()); aStarBi.setApproximation(getApproximation(ASTAR_BI, opts, g.getNodeAccess())); ra = aStarBi; ra = new DijkstraOneToMany(g, opts.getFlagEncoder(), opts.getWeighting(), opts.getTraversalMode()); AStar aStar = new AStar(g, opts.getFlagEncoder(), opts.getWeighting(), opts.getTraversalMode()); aStar.setApproximation(getApproximation(ASTAR, opts, g.getNodeAccess())); ra = aStar; AlternativeRoute altRouteAlgo = new AlternativeRoute(g, opts.getFlagEncoder(), opts.getWeighting(), opts.getTraversalMode()); altRouteAlgo.setMaxPaths(opts.getHints().getInt(MAX_PATHS, 2)); altRouteAlgo.setMaxWeightFactor(opts.getHints().getDouble(MAX_WEIGHT, 1.4));
/** * This method clones the specified AlgorithmOption object with the possibility for further * changes. */ public static Builder start(AlgorithmOptions opts) { Builder b = new Builder(); if (opts.algorithm != null) b.algorithm(opts.getAlgorithm()); if (opts.traversalMode != null) b.traversalMode(opts.getTraversalMode()); if (opts.weighting != null) b.weighting(opts.getWeighting()); if (opts.maxVisitedNodes >= 0) b.maxVisitedNodes(opts.maxVisitedNodes); if (!opts.hints.isEmpty()) b.hints(opts.hints); return b; }
/** * This method clones the specified AlgorithmOption object with the possibility for further * changes. */ public static Builder start(AlgorithmOptions opts) { Builder b = new Builder(); if (opts.algorithm != null) b.algorithm(opts.getAlgorithm()); if (opts.traversalMode != null) b.traversalMode(opts.getTraversalMode()); if (opts.weighting != null) b.weighting(opts.getWeighting()); if (opts.maxVisitedNodes >= 0) b.maxVisitedNodes(opts.maxVisitedNodes); if (!opts.hints.isEmpty()) b.hints(opts.hints); return b; }
/** * This method clones the specified AlgorithmOption object with the possibility for further * changes. */ public static Builder start( AlgorithmOptions opts ) { Builder b = new Builder(); if (opts.algorithm != null) b.algorithm(opts.getAlgorithm()); if (opts.flagEncoder != null) b.flagEncoder(opts.getFlagEncoder()); if (opts.traversalMode != null) b.traversalMode(opts.getTraversalMode()); if (opts.weighting != null) b.weighting(opts.getWeighting()); if (opts.maxVisitedNodes >= 0) b.maxVisitedNodes(opts.maxVisitedNodes); return b; }
FlagEncoder encoder = opts.getWeighting().getFlagEncoder(); if (encoder.supports(TurnWeighting.class)) { if (!opts.getTraversalMode().isEdgeBased()) { errors.add("Cannot use TurnWeighting with a node based traversal"); return this;
FlagEncoder encoder = opts.getWeighting().getFlagEncoder(); if (encoder.supports(TurnWeighting.class)) { if (!opts.getTraversalMode().isEdgeBased()) { errors.add("Cannot use TurnWeighting with a node based traversal"); return this;