Skip to content

Commit 03a0c26

Browse files
committed
Return bidirectional algorithm from CH algo factory
1 parent 0eb174b commit 03a0c26

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

core/src/main/java/com/graphhopper/routing/ch/CHRoutingAlgorithmFactory.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ public CHRoutingAlgorithmFactory(CHGraph chGraph) {
3535
this.chConfig = chGraph.getCHConfig();
3636
}
3737

38-
public RoutingAlgorithm createAlgo(Graph graph, PMap opts) {
38+
public BidirRoutingAlgorithm createAlgo(Graph graph, PMap opts) {
3939
// todo: This method does not really fit for CH: We get a graph, but really we already know which
4040
// graph we have to use: the CH graph. Same with opts.weighting: The CHConfig already contains a weighting
4141
// and we cannot really use it here. The real reason we do this the way its done atm is that graph might be
4242
// a QueryGraph that wraps (our) CHGraph.
43-
RoutingAlgorithm algo = doCreateAlgo(graph, opts);
43+
BidirRoutingAlgorithm algo = doCreateAlgo(graph, opts);
4444
if (opts.has(MAX_VISITED_NODES))
4545
algo.setMaxVisitedNodes(opts.getInt(MAX_VISITED_NODES, Integer.MAX_VALUE));
4646
return algo;
4747
}
4848

49-
private RoutingAlgorithm doCreateAlgo(Graph graph, PMap opts) {
49+
private BidirRoutingAlgorithm doCreateAlgo(Graph graph, PMap opts) {
5050
if (chConfig.isEdgeBased()) {
5151
// important: do not simply take the turn cost storage from ghStorage, because we need the wrapped storage from
5252
// query graph!
@@ -62,7 +62,7 @@ private RoutingAlgorithm doCreateAlgo(Graph graph, PMap opts) {
6262
}
6363
}
6464

65-
private RoutingAlgorithm createAlgoEdgeBased(RoutingCHGraph g, PMap opts) {
65+
private BidirRoutingAlgorithm createAlgoEdgeBased(RoutingCHGraph g, PMap opts) {
6666
// todo: AStar is much faster for edge-based but currently we cannot make it the default because
6767
// of #2061
6868
String defaultAlgo = DIJKSTRA_BI;
@@ -81,7 +81,7 @@ private RoutingAlgorithm createAlgoEdgeBased(RoutingCHGraph g, PMap opts) {
8181
}
8282
}
8383

84-
private RoutingAlgorithm createAlgoNodeBased(RoutingCHGraph g, PMap opts) {
84+
private BidirRoutingAlgorithm createAlgoNodeBased(RoutingCHGraph g, PMap opts) {
8585
// use dijkstra by default for node-based (its faster)
8686
String defaultAlgo = DIJKSTRA_BI;
8787
String algo = opts.getString(ALGORITHM, defaultAlgo);

0 commit comments

Comments
 (0)