Codota Logo
TransitRouterNetwork.getNearestNode
Code IndexAdd Codota to your IDE (free)

How to use
getNearestNode
method
in
org.matsim.pt.router.TransitRouterNetwork

Best Java code snippets using org.matsim.pt.router.TransitRouterNetwork.getNearestNode (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: matsim-org/matsim

private Map<Node, InitialNode> locateWrappedNearestTransitNodes(Person person, Coord coord, double departureTime) {
  Collection<TransitRouterNetwork.TransitRouterNetworkNode> nearestNodes = getTransitRouterNetwork().getNearestNodes(
      coord,
      this.getConfig().getSearchRadius());
  if (nearestNodes.size() < 2) {
    // also enlarge search area if only one stop found, maybe a second one is near the border of the search area
    TransitRouterNetwork.TransitRouterNetworkNode nearestNode = this.getTransitRouterNetwork()
                                    .getNearestNode(coord);
    if (nearestNode != null) { // transit schedule might be completely empty!
      double distance = CoordUtils.calcEuclideanDistance(coord,
          nearestNode.stop.getStopFacility().getCoord());
      nearestNodes = this.getTransitRouterNetwork()
                .getNearestNodes(coord, distance + this.getConfig().getExtensionRadius());
    }
  }
  Map<Node, InitialNode> wrappedNearestNodes = new LinkedHashMap<>();
  for (TransitRouterNetwork.TransitRouterNetworkNode node : nearestNodes) {
    Coord toCoord = node.stop.getStopFacility().getCoord();
    double initialTime = getWalkTime(person, coord, toCoord);
    double initialCost = getWalkDisutility(person, coord, toCoord);
    wrappedNearestNodes.put(node, new InitialNode(initialCost, initialTime + departureTime));
  }
  return wrappedNearestNodes;
}
origin: matsim-org/matsim

/**
 * Get the very next transitNode.
 * @param person Which person we are routing for. For default leave null.
 * @param coord The origin of the tree.
 * @param departureTime The time the person departures at the origin.
 * @return the next transitNode.
 */
private Map<Node, InitialNode> locateWrappedNearestTransitNode(Person person, Coord coord, double departureTime) {
  TransitRouterNetwork.TransitRouterNetworkNode nearestNode = network.getNearestNode(coord);
  Map<Node, InitialNode> wrappedNearestNodes = new LinkedHashMap<>();
  Coord toCoord = nearestNode.stop.getStopFacility().getCoord();
  double initialTime = travelDisutility.getWalkTravelTime(person, coord, toCoord);
  double initialCost = travelDisutility.getWalkTravelDisutility(person, coord, toCoord);
  wrappedNearestNodes.put(nearestNode, new InitialNode(initialCost, initialTime + departureTime));
  return wrappedNearestNodes;
}
org.matsim.pt.routerTransitRouterNetworkgetNearestNode

Popular methods of TransitRouterNetwork

  • createFromSchedule
  • getLinks
  • <init>
  • createLink
  • createNode
  • finishInit
  • getNearestNodes
  • getNodes

Popular in Java

  • Making http post requests using okhttp
  • getSharedPreferences (Context)
  • orElseThrow (Optional)
  • addToBackStack (FragmentTransaction)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Collectors (java.util.stream)
  • JLabel (javax.swing)
  • JOptionPane (javax.swing)
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