MATSIM
SpeedyALTFactory.java
Go to the documentation of this file.
1 package org.matsim.core.router.speedy;
2 
8 
9 import java.util.Map;
10 import java.util.concurrent.ConcurrentHashMap;
11 
16 
17  private final Map<Network, SpeedyGraph> graphs = new ConcurrentHashMap<>();
18  private final Map<SpeedyGraph, SpeedyALTData> landmarksData = new ConcurrentHashMap<>();
19 
20  @Override
22  SpeedyGraph graph = this.graphs.get(network);
23  if (graph == null) {
24  graph = SpeedyGraphBuilder.build(network);
25  this.graphs.put(network, graph);
26  }
27  SpeedyALTData landmarks = this.landmarksData.get(graph);
28  if (landmarks == null) {
29  int landmarksCount = Math.min(16, graph.nodeCount);
30  landmarks = new SpeedyALTData(graph, landmarksCount, travelCosts);
31  this.landmarksData.put(graph, landmarks);
32  }
33  return new SpeedyALT(landmarks, travelTimes, travelCosts);
34  }
35 
36 }
LeastCostPathCalculator createPathCalculator(Network network, TravelDisutility travelCosts, TravelTime travelTimes)
final Map< SpeedyGraph, SpeedyALTData > landmarksData
final Map< Network, SpeedyGraph > graphs