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

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: graphhopper/graphhopper

/**
 * Queries the ch graph and checks if the graph's shortcuts match the given expected shortcuts.
 */
private void checkShortcuts(Shortcut... expectedShortcuts) {
  Set<Shortcut> expected = setOf(expectedShortcuts);
  if (expected.size() != expectedShortcuts.length) {
    fail("was given duplicate shortcuts");
  }
  AllCHEdgesIterator iter = lg.getAllEdges();
  Set<Shortcut> given = new HashSet<>();
  while (iter.next()) {
    if (iter.isShortcut()) {
      given.add(new Shortcut(
          iter.getBaseNode(), iter.getAdjNode(), iter.getWeight(), iter.getDistance(),
          iter.isForward(encoder), iter.isBackward(encoder),
          iter.getSkippedEdge1(), iter.getSkippedEdge2()));
    }
  }
  assertEquals(expected, given);
}
origin: graphhopper/graphhopper

private Shortcut expectedShortcut(int baseNode, int adjNode, EdgeIteratorState edge1, EdgeIteratorState edge2,
                 boolean fwd, boolean bwd) {
  //todo: weight calculation might have to be adjusted for different encoders/weightings/reverse speed
  double weight = weighting.calcWeight(edge1, false, EdgeIterator.NO_EDGE) +
      weighting.calcWeight(edge2, false, EdgeIterator.NO_EDGE);
  double distance = edge1.getDistance() + edge2.getDistance();
  return new Shortcut(baseNode, adjNode, weight, distance, fwd, bwd, edge1.getEdge(), edge2.getEdge());
}
com.graphhopper.routing.chNodeBasedNodeContractorTest$Shortcut

Most used methods

  • <init>

Popular in Java

  • Creating JSON documents from java classes using gson
  • putExtra (Intent)
  • findViewById (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
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