Codota Logo
PrepareContractionHierarchies$Shortcut
Code IndexAdd Codota to your IDE (free)

How to use
PrepareContractionHierarchies$Shortcut
in
com.graphhopper.routing.ch

Best Java code snippets using com.graphhopper.routing.ch.PrepareContractionHierarchies$Shortcut (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: com.rgi-corp/graphhopper

  @Override
  public void foundShortcut(int u_fromNode, int w_toNode,
               double existingDirectWeight, double existingDistSum,
               EdgeIterator outgoingEdges,
               int skippedEdge1, int incomingEdgeOrigCount) {
    // FOUND shortcut
    // but be sure that it is the only shortcut in the collection
    // and also in the graph for u->w. If existing AND identical weight => update setProperties.
    // Hint: shortcuts are always one-way due to distinct level of every node but we don't
    // know yet the levels so we need to determine the correct direction or if both directions
    Shortcut sc = new Shortcut(u_fromNode, w_toNode, existingDirectWeight, existingDistSum);
    if (shortcuts.containsKey(sc))
      return;
    Shortcut tmpSc = new Shortcut(w_toNode, u_fromNode, existingDirectWeight, existingDistSum);
    Shortcut tmpRetSc = shortcuts.get(tmpSc);
    if (tmpRetSc != null) {
      // overwrite flags only if skipped edges are identical
      if (tmpRetSc.skippedEdge2 == skippedEdge1 && tmpRetSc.skippedEdge1 == outgoingEdges.getEdge()) {
        tmpRetSc.flags = PrepareEncoder.getScDirMask();
        return;
      }
    }
    Shortcut old = shortcuts.put(sc, sc);
    if (old != null)
      throw new IllegalStateException("Shortcut did not exist (" + sc + ") but was overwriting another one? " + old);
    sc.skippedEdge1 = skippedEdge1;
    sc.skippedEdge2 = outgoingEdges.getEdge();
    sc.originalEdges = incomingEdgeOrigCount + getOrigEdgeCount(outgoingEdges.getEdge());
  }
}
origin: com.graphhopper/graphhopper

Shortcut sc = new Shortcut(u_fromNode, w_toNode, existingDirectWeight, existingDistSum);
if (shortcuts.containsKey(sc))
  return;
Shortcut tmpSc = new Shortcut(w_toNode, u_fromNode, existingDirectWeight, existingDistSum);
Shortcut tmpRetSc = shortcuts.get(tmpSc);
if (tmpRetSc != null)
com.graphhopper.routing.chPrepareContractionHierarchies$Shortcut

Most used methods

  • <init>

Popular in Java

  • Making http post requests using okhttp
  • compareTo (BigDecimal)
  • setContentView (Activity)
  • putExtra (Intent)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • ImageIO (javax.imageio)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now