- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {Connection c =
DataSource dataSource;dataSource.getConnection()
String url;DriverManager.getConnection(url)
IdentityDatabaseUtil.getDBConnection()
- Smart code suggestions by Codota
}
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; }
/** * 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; }