private double getWalkTime(Person person, Coord coord, Coord toCoord) { return this.ttCalculator.getWalkTravelTime(person, coord, toCoord); }
@Override public double getWalkTravelTime(Person person, Coord coord, Coord toCoord) { return routerDisutility.getWalkTravelTime(person, coord, toCoord); }
@Override public double getWalkTravelDisutility(Person person, Coord coord, Coord toCoord) { // getMarginalUtilityOfTravelTimeWalk INCLUDES the opportunity cost of time. kai, dec'12 double timeCost = - getWalkTravelTime(person, coord, toCoord) * config.getMarginalUtilityOfTravelTimeWalk_utl_s() ; // (sign: margUtl is negative; overall it should be positive because it is a cost.) double distanceCost = - CoordUtils.calcEuclideanDistance(coord,toCoord) * config.getBeelineDistanceFactor() * config.getMarginalUtilityOfTravelDistanceWalk_utl_m(); // (sign: same as above) return timeCost + distanceCost ; }
/** * 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; }