congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
TurnCostEncoder
Code IndexAdd Tabnine to your IDE (free)

How to use
TurnCostEncoder
in
com.graphhopper.routing.util

Best Java code snippets using com.graphhopper.routing.util.TurnCostEncoder (Showing top 10 results out of 315)

origin: graphhopper/graphhopper

entry.edgeFrom = edgeIdFrom;
entry.edgeTo = iter.getEdge();
entry.flags = encoder.getTurnFlags(true, 0);
entries.add(entry);
origin: graphhopper/graphhopper

/**
 * This method calculates the turn weight separately.
 */
public double calcTurnWeight(int edgeFrom, int nodeVia, int edgeTo) {
  long turnFlags = turnCostExt.getTurnCostFlags(edgeFrom, nodeVia, edgeTo);
  if (turnCostEncoder.isTurnRestricted(turnFlags))
    return Double.POSITIVE_INFINITY;
  return turnCostEncoder.getTurnCost(turnFlags);
}
origin: com.graphhopper/graphhopper-core

/**
 * This method calculates the turn weight separately.
 */
public double calcTurnWeight(int edgeFrom, int nodeVia, int edgeTo) {
  long turnFlags = turnCostExt.getTurnCostFlags(edgeFrom, nodeVia, edgeTo);
  if (turnCostEncoder.isTurnRestricted(turnFlags))
    return Double.POSITIVE_INFINITY;
  return turnCostEncoder.getTurnCost(turnFlags);
}
origin: graphhopper/graphhopper

private void blockNode3(Graph g, TurnCostExtension tcs, TurnCostEncoder tEncoder) {
  // Totally block this node (all 9 turn relations)
  final long BLOCK = tEncoder.getTurnFlags(true, 0);
  tcs.addTurnInfo(getEdge(g, 2, 3).getEdge(), 3, getEdge(g, 3, 1).getEdge(), BLOCK);
  tcs.addTurnInfo(getEdge(g, 2, 3).getEdge(), 3, getEdge(g, 3, 4).getEdge(), BLOCK);
  tcs.addTurnInfo(getEdge(g, 4, 3).getEdge(), 3, getEdge(g, 3, 1).getEdge(), BLOCK);
  tcs.addTurnInfo(getEdge(g, 4, 3).getEdge(), 3, getEdge(g, 3, 2).getEdge(), BLOCK);
  tcs.addTurnInfo(getEdge(g, 6, 3).getEdge(), 3, getEdge(g, 3, 1).getEdge(), BLOCK);
  tcs.addTurnInfo(getEdge(g, 6, 3).getEdge(), 3, getEdge(g, 3, 4).getEdge(), BLOCK);
  tcs.addTurnInfo(getEdge(g, 1, 3).getEdge(), 3, getEdge(g, 3, 6).getEdge(), BLOCK);
  tcs.addTurnInfo(getEdge(g, 1, 3).getEdge(), 3, getEdge(g, 3, 2).getEdge(), BLOCK);
  tcs.addTurnInfo(getEdge(g, 1, 3).getEdge(), 3, getEdge(g, 3, 4).getEdge(), BLOCK);
}
origin: com.graphhopper/graphhopper

public double calcTurnWeight( int edgeFrom, int nodeVia, int edgeTo )
{
  long turnFlags = turnCostExt.getTurnCostFlags(edgeFrom, nodeVia, edgeTo);
  if (turnCostEncoder.isTurnRestricted(turnFlags))
    return Double.POSITIVE_INFINITY;
  return turnCostEncoder.getTurnCost(turnFlags);
}
origin: graphhopper/graphhopper

private void initTurnRestrictions(Graph g, TurnCostExtension tcs, TurnCostEncoder tEncoder) {
  long tflags = tEncoder.getTurnFlags(true, 0);
  // only forward from 2-3 to 3-4 => limit 2,3->3,6 and 2,3->3,1
  tcs.addTurnInfo(getEdge(g, 2, 3).getEdge(), 3, getEdge(g, 3, 6).getEdge(), tflags);
  tcs.addTurnInfo(getEdge(g, 2, 3).getEdge(), 3, getEdge(g, 3, 1).getEdge(), tflags);
  // only right   from 5-2 to 2-3 => limit 5,2->2,0
  tcs.addTurnInfo(getEdge(g, 5, 2).getEdge(), 2, getEdge(g, 2, 0).getEdge(), tflags);
  // only right   from 7-6 to 6-3 => limit 7,6->6,5
  tcs.addTurnInfo(getEdge(g, 7, 6).getEdge(), 6, getEdge(g, 6, 5).getEdge(), tflags);
  // no 5-6 to 6-3
  tcs.addTurnInfo(getEdge(g, 5, 6).getEdge(), 6, getEdge(g, 6, 3).getEdge(), tflags);
  // no 4-3 to 3-1
  tcs.addTurnInfo(getEdge(g, 4, 3).getEdge(), 3, getEdge(g, 3, 1).getEdge(), tflags);
  // no 4-3 to 3-2
  tcs.addTurnInfo(getEdge(g, 4, 3).getEdge(), 3, getEdge(g, 3, 2).getEdge(), tflags);
  // no u-turn at 6-7
  tcs.addTurnInfo(getEdge(g, 6, 7).getEdge(), 7, getEdge(g, 7, 6).getEdge(), tflags);
  // no u-turn at 3-6
  tcs.addTurnInfo(getEdge(g, 3, 6).getEdge(), 6, getEdge(g, 6, 3).getEdge(), tflags);
}
origin: com.rgi-corp/graphhopper

/**
 * This method calculates the turn weight separately.
 */
public double calcTurnWeight(int edgeFrom, int nodeVia, int edgeTo) {
  long turnFlags = turnCostExt.getTurnCostFlags(edgeFrom, nodeVia, edgeTo);
  if (turnCostEncoder.isTurnRestricted(turnFlags))
    return Double.POSITIVE_INFINITY;
  return turnCostEncoder.getTurnCost(turnFlags);
}
origin: com.graphhopper/graphhopper

entry.edgeFrom = edgeIdFrom;
entry.edgeTo = iter.getEdge();
entry.flags = encoder.getTurnFlags(true, 0);
entries.add(entry);
origin: com.rgi-corp/graphhopper-reader-osm

entry.edgeFrom = edgeIdFrom;
entry.edgeTo = iter.getEdge();
entry.flags = encoder.getTurnFlags(true, 0);
entries.add(entry);
origin: com.rgi-corp/graphhopper-reader-osm

entry.edgeFrom = edgeIdFrom;
entry.edgeTo = iter.getEdge();
entry.flags = encoder.getTurnFlags(true, 0);
entries.add(entry);
com.graphhopper.routing.utilTurnCostEncoder

Javadoc

Encodes and decodes a turn restriction and turn costs within a integer flag

Most used methods

  • getTurnFlags
  • getTurnCost
  • isTurnRestricted

Popular in Java

  • Start an intent from android
  • runOnUiThread (Activity)
  • startActivity (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now