@Override public void process( ActivityFacility quelle, ActivityFacility ziel, int quantity, String mode, String destinationActivityType, double departureTimeOffset) { Node quellNode = NetworkUtils.getNearestNode(((Network) network), quelle.getCoord()); Node zielNode = NetworkUtils.getNearestNode(((Network) network), ziel.getCoord()); Path path = dijkstra.calcLeastCostPath(quellNode, zielNode, 0.0, null, null); double travelTimeToWork = calculateFreespeedTravelTimeToNode(this.network, path, zielNode); // if(quelle.id == 9375 && ziel.id == 9162){ System.out.println( "from zone " + quelle.getId() + " to zone " + ziel.getId() + ", it takes " + travelTimeToWork + " seconds to travel."); sink.process( quelle, ziel, quantity, mode, destinationActivityType, departureTimeOffset - travelTimeToWork); // } }
public void runAccessibilityComputation() { final Network network = (Network) this.scenario.getNetwork(); ProgressBar bar = new ProgressBar(this.measuringPoints.getZones().size()); for (Zone<Id<Zone>> measurePoint : this.measuringPoints.getZones()) { bar.update(); Coord coord = MGC.point2Coord(measurePoint.getGeometry().getCentroid()); Point p = measurePoint.getGeometry().getCentroid(); final Coord coord1 = coord; Link nearestLink = NetworkUtils.getNearestLinkExactly(network, coord1); final Coord coord2 = coord; Node nearestNode = NetworkUtils.getNearestNode(network, coord2); Distances distance = NetworkUtil.getDistances2NodeViaGivenLink(coord, nearestLink, nearestNode); double distanceMeasuringPoint2Road_meter = distance.getDistancePoint2Intersection(); double walkTravelTime_h = distanceMeasuringPoint2Road_meter / this.walkSpeedMeterPerHour; // travel time from coord to network (node or link) if (boundary.contains(p)) this.freeSpeedGrid.setValue(walkTravelTime_h, p); } }