private AbstractBidirAlgo doCreateAlgo(Graph graph, AlgorithmOptions opts) { if (ASTAR_BI.equals(opts.getAlgorithm())) { return new AStarBidirectionCH(graph, prepareWeighting, traversalMode) .setApproximation(RoutingAlgorithmFactorySimple.getApproximation(ASTAR_BI, opts, graph.getNodeAccess())); } else if (DIJKSTRA_BI.equals(opts.getAlgorithm())) { if (opts.getHints().getBool("stall_on_demand", true)) { return new DijkstraBidirectionCH(graph, prepareWeighting, traversalMode); } else { return new DijkstraBidirectionCHNoSOD(graph, prepareWeighting, traversalMode); } } else { throw new IllegalArgumentException("Algorithm " + opts.getAlgorithm() + " not supported for Contraction Hierarchies. Try with ch.disable=true"); } }
AStarBidirection aStarBi = new AStarBidirection(g, opts.getWeighting(), opts.getTraversalMode()); aStarBi.setApproximation(getApproximation(ASTAR_BI, opts, g.getNodeAccess())); ra = aStarBi; aStar.setApproximation(getApproximation(ASTAR, opts, g.getNodeAccess())); ra = aStar;
private AbstractBidirAlgo doCreateAlgo(Graph graph, AlgorithmOptions opts) { if (ASTAR_BI.equals(opts.getAlgorithm())) { return new AStarBidirectionCH(graph, prepareWeighting, traversalMode) .setApproximation(RoutingAlgorithmFactorySimple.getApproximation(ASTAR_BI, opts, graph.getNodeAccess())); } else if (DIJKSTRA_BI.equals(opts.getAlgorithm())) { if (opts.getHints().getBool("stall_on_demand", true)) { return new DijkstraBidirectionCH(graph, prepareWeighting, traversalMode); } else { return new DijkstraBidirectionCHNoSOD(graph, prepareWeighting, traversalMode); } } else { throw new IllegalArgumentException("Algorithm " + opts.getAlgorithm() + " not supported for Contraction Hierarchies. Try with ch.disable=true"); } }
@Override public RoutingAlgorithm createAlgo(Graph graph, AlgorithmOptions opts) { AbstractBidirAlgo algo; if (ASTAR_BI.equals(opts.getAlgorithm())) { AStarBidirection tmpAlgo = new AStarBidirectionCH(graph, prepareWeighting, traversalMode); tmpAlgo.setApproximation(RoutingAlgorithmFactorySimple.getApproximation(ASTAR_BI, opts, graph.getNodeAccess())); algo = tmpAlgo; } else if (DIJKSTRA_BI.equals(opts.getAlgorithm())) { algo = new DijkstraBidirectionCH(graph, prepareWeighting, traversalMode); } else { throw new IllegalArgumentException("Algorithm " + opts.getAlgorithm() + " not supported for Contraction Hierarchies. Try with ch.disable=true"); } algo.setMaxVisitedNodes(opts.getMaxVisitedNodes()); algo.setEdgeFilter(levelFilter); return algo; }
AStarBidirection aStarBi = new AStarBidirection(g, opts.getWeighting(), opts.getTraversalMode()); aStarBi.setApproximation(getApproximation(ASTAR_BI, opts, g.getNodeAccess())); ra = aStarBi; aStar.setApproximation(getApproximation(ASTAR, opts, g.getNodeAccess())); ra = aStar;
AStarBidirection aStarBi = new AStarBidirection(g, opts.getWeighting(), opts.getTraversalMode()); aStarBi.setApproximation(getApproximation(ASTAR_BI, opts, g.getNodeAccess())); ra = aStarBi; aStar.setApproximation(getApproximation(ASTAR, opts, g.getNodeAccess())); ra = aStar;
aStarBi.setApproximation(getApproximation(ASTAR_BI, opts, g.getNodeAccess())); ra = aStarBi; aStar.setApproximation(getApproximation(ASTAR, opts, g.getNodeAccess())); ra = aStar;