@Override public String toString() { return "CHGraph|" + getWeighting().toString(); }
public List<Weighting> getCHWeightings() { List<Weighting> list = new ArrayList<>(chGraphs.size()); for (CHGraphImpl cg : chGraphs) { list.add(cg.getWeighting()); } return list; }
/** * This method returns the routing graph for the specified weighting, could be potentially * filled with shortcuts. */ public <T extends Graph> T getGraph(Class<T> clazz, Weighting weighting) { if (clazz.equals(Graph.class)) return (T) baseGraph; if (chGraphs.isEmpty()) throw new IllegalStateException("Cannot find graph implementation for " + clazz); if (weighting == null) throw new IllegalStateException("Cannot find CHGraph with null weighting"); List<Weighting> existing = new ArrayList<>(); for (CHGraphImpl cg : chGraphs) { if (cg.getWeighting() == weighting) return (T) cg; existing.add(cg.getWeighting()); } throw new IllegalStateException("Cannot find CHGraph for specified weighting: " + weighting + ", existing:" + existing); }
public Weighting getWeighting() { return prepareGraph.getWeighting(); }
public Weighting getWeighting() { return prepareGraph.getWeighting(); }
public Weighting getWeighting() { return prepareGraph.getWeighting(); }
@Override public String toString() { return "CHGraph|" + getWeighting().toString(); } }
@Override public String toString() { return "CHGraph|" + getWeighting().toString(); }
@Override public String toString() { return "CHGraph|" + getWeighting().toString(); }
public List<Weighting> getCHWeightings() { List<Weighting> list = new ArrayList<Weighting>(chGraphs.size()); for (CHGraphImpl cg : chGraphs) { list.add(cg.getWeighting()); } return list; }
public List<Weighting> getCHWeightings() { List<Weighting> list = new ArrayList<>(chGraphs.size()); for (CHGraphImpl cg : chGraphs) { list.add(cg.getWeighting()); } return list; }
public List<Weighting> getCHWeightings() { List<Weighting> list = new ArrayList<Weighting>(chGraphs.size()); for (CHGraphImpl cg : chGraphs) { list.add(cg.getWeighting()); } return list; }
/** * This method returns the routing graph for the specified weighting, could be potentially * filled with shortcuts. */ public <T extends Graph> T getGraph(Class<T> clazz, Weighting weighting) { if (clazz.equals(Graph.class)) return (T) baseGraph; if (chGraphs.isEmpty()) throw new IllegalStateException("Cannot find graph implementation for " + clazz); if (weighting == null) throw new IllegalStateException("Cannot find CHGraph with null weighting"); List<Weighting> existing = new ArrayList<>(); for (CHGraphImpl cg : chGraphs) { if (cg.getWeighting() == weighting) return (T) cg; existing.add(cg.getWeighting()); } throw new IllegalStateException("Cannot find CHGraph for specified weighting: " + weighting + ", existing:" + existing); }
/** * This method returns the routing graph for the specified weighting, could be potentially * filled with shortcuts. */ public <T extends Graph> T getGraph(Class<T> clazz, Weighting weighting) { if (clazz.equals(Graph.class)) return (T) baseGraph; if (chGraphs.isEmpty()) throw new IllegalStateException("Cannot find graph implementation for " + clazz); if (weighting == null) throw new IllegalStateException("Cannot find CHGraph with null weighting"); List<Weighting> existing = new ArrayList<Weighting>(); for (CHGraphImpl cg : chGraphs) { if (cg.getWeighting() == weighting) return (T) cg; existing.add(cg.getWeighting()); } throw new IllegalStateException("Cannot find CHGraph for specified weighting: " + weighting + ", existing:" + existing); }
/** * This method returns the routing graph for the specified weighting, could be potentially * filled with shortcuts. */ public <T extends Graph> T getGraph( Class<T> clazz, Weighting weighting ) { if (clazz.equals(Graph.class)) return (T) baseGraph; if (chGraphs.isEmpty()) throw new IllegalStateException("Cannot find graph implementation for " + clazz); if (weighting == null) throw new IllegalStateException("Cannot find CHGraph with null weighting"); List<Weighting> existing = new ArrayList<Weighting>(); for (CHGraphImpl cg : chGraphs) { if (cg.getWeighting() == weighting) return (T) cg; existing.add(cg.getWeighting()); } throw new IllegalStateException("Cannot find CHGraph for specified weighting: " + weighting + ", existing:" + existing); }
public PrepareContractionHierarchies(Directory dir, GraphHopperStorage ghStorage, CHGraph chGraph, TraversalMode traversalMode) { this.dir = dir; this.ghStorage = ghStorage; this.prepareGraph = (CHGraphImpl) chGraph; this.traversalMode = traversalMode; this.weighting = ((CHGraphImpl) chGraph).getWeighting(); prepareWeighting = new PreparationWeighting(weighting); this.params = Params.forTraversalMode(traversalMode); }