use of com.graphhopper.routing.AStarBidirection in project graphhopper by graphhopper.
the class MapMatching method createRouter.
private BidirRoutingAlgorithm createRouter() {
BidirRoutingAlgorithm router;
if (landmarks != null) {
AStarBidirection algo = new AStarBidirection(queryGraph, weighting, TraversalMode.EDGE_BASED) {
@Override
protected void initCollections(int size) {
super.initCollections(50);
}
};
int activeLM = Math.min(8, landmarks.getLandmarkCount());
algo.setApproximation(LMApproximator.forLandmarks(queryGraph, landmarks, activeLM));
algo.setMaxVisitedNodes(maxVisitedNodes);
router = algo;
} else {
router = new DijkstraBidirectionRef(queryGraph, weighting, TraversalMode.EDGE_BASED) {
@Override
protected void initCollections(int size) {
super.initCollections(50);
}
};
router.setMaxVisitedNodes(maxVisitedNodes);
}
return router;
}
Aggregations