@@ -38,6 +38,7 @@ public class RoadRouterService {
3838
3939 private final QuadTree <? extends Link > linkIndex ;
4040
41+ private final SpeedyALTFactory routerFactory = new SpeedyALTFactory ();
4142 private final ConcurrentLinkedQueue <LeastCostPathCalculator > routerPool = new ConcurrentLinkedQueue <>();
4243
4344 RoadRouterService (Network network , QuadTree <? extends Link > linkIndex , WalkParameters walkParameters , int threads ) {
@@ -50,7 +51,7 @@ public class RoadRouterService {
5051 }
5152
5253 private LeastCostPathCalculator createRouterInstance (Network network ) {
53- return new SpeedyALTFactory () .createPathCalculator (network , travelDisutility , travelTime );
54+ return routerFactory .createPathCalculator (network , travelDisutility , travelTime );
5455 }
5556
5657 public RoadRouterResponse processRequest (RoadRouterRequest request ) {
@@ -63,7 +64,8 @@ public RoadRouterResponse processRequest(RoadRouterRequest request) {
6364 List <Link > toLinks = new LinkedList <>();
6465
6566 if (request .accessEgressRadius_km != null ) {
66- fromLinks .addAll (linkIndex .getDisk (fromCoord .getX (), fromCoord .getY (), request .accessEgressRadius_km * 1e3 ));
67+ fromLinks
68+ .addAll (linkIndex .getDisk (fromCoord .getX (), fromCoord .getY (), request .accessEgressRadius_km * 1e3 ));
6769 toLinks .addAll (linkIndex .getDisk (toCoord .getX (), toCoord .getY (), request .accessEgressRadius_km * 1e3 ));
6870 }
6971
0 commit comments