public boolean needsTurnCostsSupport() { for (FlagEncoder encoder : edgeEncoders) { if (encoder.supports(TurnWeighting.class)) return true; } return false; } }
public Collection<TurnCostTableEntry> analyzeTurnRelation(FlagEncoder encoder, OSMTurnRelation turnRelation) { if (!encoder.supports(TurnWeighting.class)) return Collections.emptyList(); EdgeExplorer edgeOutExplorer = outExplorerMap.get(encoder); EdgeExplorer edgeInExplorer = inExplorerMap.get(encoder); if (edgeOutExplorer == null || edgeInExplorer == null) { edgeOutExplorer = graph.createEdgeExplorer(DefaultEdgeFilter.outEdges(encoder)); outExplorerMap.put(encoder, edgeOutExplorer); edgeInExplorer = graph.createEdgeExplorer(DefaultEdgeFilter.inEdges(encoder)); inExplorerMap.put(encoder, edgeInExplorer); } return turnRelation.getRestrictionAsEntries(encoder, edgeOutExplorer, edgeInExplorer, this); }
/** * Potentially wraps the specified weighting into a TurnWeighting instance. */ public Weighting createTurnWeighting(Graph graph, Weighting weighting, TraversalMode tMode) { FlagEncoder encoder = weighting.getFlagEncoder(); if (encoder.supports(TurnWeighting.class) && !tMode.equals(TraversalMode.NODE_BASED)) return new TurnWeighting(weighting, (TurnCostExtension) graph.getExtension()); return weighting; }
Weighting weighting = null; if (encoder.supports(GenericWeighting.class)) { weighting = new GenericWeighting((DataFlagEncoder) encoder, hintsMap); } else if ("shortest".equalsIgnoreCase(weightingStr)) { weighting = new ShortestWeighting(encoder); } else if ("fastest".equalsIgnoreCase(weightingStr) || weightingStr.isEmpty()) { if (encoder.supports(PriorityWeighting.class)) weighting = new PriorityWeighting(encoder, hintsMap); else weighting = new FastestWeighting(encoder, hintsMap); } else if ("curvature".equalsIgnoreCase(weightingStr)) { if (encoder.supports(CurvatureWeighting.class)) weighting = new CurvatureWeighting(encoder, hintsMap);
AlgorithmOptions opts = algoEntry.getAlgorithmOptions(); FlagEncoder encoder = opts.getWeighting().getFlagEncoder(); if (encoder.supports(TurnWeighting.class)) { if (!opts.getTraversalMode().isEdgeBased()) { errors.add("Cannot use TurnWeighting with a node based traversal");
public boolean needsTurnCostsSupport() { for (FlagEncoder encoder : edgeEncoders) { if (encoder.supports(TurnWeighting.class)) return true; } return false; }
public boolean needsTurnCostsSupport() { for (FlagEncoder encoder : edgeEncoders) { if (encoder.supports(TurnWeighting.class)) return true; } return false; } }
public boolean needsTurnCostsSupport() { for (FlagEncoder encoder : edgeEncoders) { if (encoder.supports(TurnWeighting.class)) return true; } return false; } }
public Collection<TurnCostTableEntry> analyzeTurnRelation(FlagEncoder encoder, OSMTurnRelation turnRelation) { if (!encoder.supports(TurnWeighting.class)) return Collections.emptyList(); EdgeExplorer edgeOutExplorer = outExplorerMap.get(encoder); EdgeExplorer edgeInExplorer = inExplorerMap.get(encoder); if (edgeOutExplorer == null || edgeInExplorer == null) { edgeOutExplorer = graph.createEdgeExplorer(new DefaultEdgeFilter(encoder, false, true)); outExplorerMap.put(encoder, edgeOutExplorer); edgeInExplorer = graph.createEdgeExplorer(new DefaultEdgeFilter(encoder, true, false)); inExplorerMap.put(encoder, edgeInExplorer); } return turnRelation.getRestrictionAsEntries(encoder, edgeOutExplorer, edgeInExplorer, this); }
public Collection<TurnCostTableEntry> analyzeTurnRelation(FlagEncoder encoder, OSMTurnRelation turnRelation) { if (!encoder.supports(TurnWeighting.class)) return Collections.emptyList(); EdgeExplorer edgeOutExplorer = outExplorerMap.get(encoder); EdgeExplorer edgeInExplorer = inExplorerMap.get(encoder); if (edgeOutExplorer == null || edgeInExplorer == null) { edgeOutExplorer = graph.createEdgeExplorer(new DefaultEdgeFilter(encoder, false, true)); outExplorerMap.put(encoder, edgeOutExplorer); edgeInExplorer = graph.createEdgeExplorer(new DefaultEdgeFilter(encoder, true, false)); inExplorerMap.put(encoder, edgeInExplorer); } return turnRelation.getRestrictionAsEntries(encoder, edgeOutExplorer, edgeInExplorer, this); }
public Collection<TurnCostTableEntry> analyzeTurnRelation( FlagEncoder encoder, OSMTurnRelation turnRelation ) { if (!encoder.supports(TurnWeighting.class)) return Collections.emptyList(); EdgeExplorer edgeOutExplorer = outExplorerMap.get(encoder); EdgeExplorer edgeInExplorer = inExplorerMap.get(encoder); if (edgeOutExplorer == null || edgeInExplorer == null) { edgeOutExplorer = graph.createEdgeExplorer(new DefaultEdgeFilter(encoder, false, true)); outExplorerMap.put(encoder, edgeOutExplorer); edgeInExplorer = graph.createEdgeExplorer(new DefaultEdgeFilter(encoder, true, false)); inExplorerMap.put(encoder, edgeInExplorer); } return turnRelation.getRestrictionAsEntries(encoder, edgeOutExplorer, edgeInExplorer, this); }
/** * Potentially wraps the specified weighting into a TurnWeighting instance. */ public Weighting createTurnWeighting( Graph graph, FlagEncoder encoder, Weighting weighting, TraversalMode tMode ) { if (encoder.supports(TurnWeighting.class) && !tMode.equals(TraversalMode.NODE_BASED)) return new TurnWeighting(weighting, encoder, (TurnCostExtension) graph.getExtension()); return weighting; }
} else if ("fastest".equalsIgnoreCase(weighting) || weighting.isEmpty()) if (encoder.supports(PriorityWeighting.class)) return new PriorityWeighting(encoder, weightingMap); else } else if ("curvature".equalsIgnoreCase(weighting)) if (encoder.supports(CurvatureWeighting.class)) return new CurvatureWeighting(encoder, weightingMap); else
/** * Potentially wraps the specified weighting into a TurnWeighting instance. */ public Weighting createTurnWeighting(Graph graph, Weighting weighting, TraversalMode tMode) { FlagEncoder encoder = weighting.getFlagEncoder(); if (encoder.supports(TurnWeighting.class) && !tMode.equals(TraversalMode.NODE_BASED)) return new TurnWeighting(weighting, (TurnCostExtension) graph.getExtension()); return weighting; }
/** * Potentially wraps the specified weighting into a TurnWeighting instance. */ public Weighting createTurnWeighting(Graph graph, Weighting weighting, TraversalMode tMode) { FlagEncoder encoder = weighting.getFlagEncoder(); if (encoder.supports(TurnWeighting.class) && !tMode.equals(TraversalMode.NODE_BASED)) return new TurnWeighting(weighting, (TurnCostExtension) graph.getExtension()); return weighting; }
String weighting = hintsMap.getWeighting().toLowerCase(); if (encoder.supports(GenericWeighting.class)) { DataFlagEncoder dataEncoder = (DataFlagEncoder) encoder; ConfigMap cMap = dataEncoder.readStringMap(hintsMap); return new ShortestWeighting(encoder); } else if ("fastest".equalsIgnoreCase(weighting) || weighting.isEmpty()) { if (encoder.supports(PriorityWeighting.class)) return new PriorityWeighting(encoder, hintsMap); else return new FastestWeighting(encoder, hintsMap); } else if ("curvature".equalsIgnoreCase(weighting)) { if (encoder.supports(CurvatureWeighting.class)) return new CurvatureWeighting(encoder, hintsMap);
Weighting weighting = null; if (encoder.supports(GenericWeighting.class)) { weighting = new GenericWeighting((DataFlagEncoder) encoder, hintsMap); } else if ("shortest".equalsIgnoreCase(weightingStr)) { weighting = new ShortestWeighting(encoder); } else if ("fastest".equalsIgnoreCase(weightingStr) || weightingStr.isEmpty()) { if (encoder.supports(PriorityWeighting.class)) weighting = new PriorityWeighting(encoder, hintsMap); else weighting = new FastestWeighting(encoder, hintsMap); } else if ("curvature".equalsIgnoreCase(weightingStr)) { if (encoder.supports(CurvatureWeighting.class)) weighting = new CurvatureWeighting(encoder, hintsMap);
AlgorithmOptions opts = algoEntry.getAlgorithmOptions(); FlagEncoder encoder = opts.getWeighting().getFlagEncoder(); if (encoder.supports(TurnWeighting.class)) { if (!opts.getTraversalMode().isEdgeBased()) { errors.add("Cannot use TurnWeighting with a node based traversal");
AlgorithmOptions opts = algoEntry.opts; FlagEncoder encoder = opts.getFlagEncoder(); if (encoder.supports(TurnWeighting.class)) algoEntry.setAlgorithmOptions(AlgorithmOptions.start(opts).weighting(new TurnWeighting(opts.getWeighting(), opts.getFlagEncoder(), (TurnCostExtension) queryGraph.getExtension())).build());
AlgorithmOptions opts = algoEntry.getAlgorithmOptions(); FlagEncoder encoder = opts.getWeighting().getFlagEncoder(); if (encoder.supports(TurnWeighting.class)) { if (!opts.getTraversalMode().isEdgeBased()) { errors.add("Cannot use TurnWeighting with a node based traversal");