Make the 15m tool respect access-restricted zones.

This commit is contained in:
Dustin Carlino 2021-04-08 10:28:52 -07:00
parent 3060f94989
commit 204d13177d
2 changed files with 4 additions and 2 deletions

View File

@ -81,6 +81,7 @@ pub fn all_vehicle_costs_from(
let graph = build_graph_for_vehicles(map, constraints);
let cost_per_road = petgraph::algo::dijkstra(&graph, *start_road, None, |(_, _, mvmnt)| {
vehicle_cost(mvmnt.from, *mvmnt, constraints, map.routing_params(), map)
+ zone_cost(*mvmnt, constraints, map)
});
for (b, road) in bldg_to_road {
if let Some(duration) = cost_per_road.get(&road).cloned() {

View File

@ -3,7 +3,7 @@ use std::collections::{BinaryHeap, HashMap};
use geom::{Duration, Speed};
use crate::pathfind::WalkingNode;
use crate::pathfind::{zone_cost, WalkingNode};
use crate::{BuildingID, LaneType, Map, PathConstraints, Traversable};
#[derive(Clone)]
@ -118,7 +118,8 @@ pub fn all_walking_costs_from(
Some(opts.walking_speed),
PathConstraints::Pedestrian,
map,
),
)
+ zone_cost(turn.id.to_movement(map), PathConstraints::Pedestrian, map),
node: WalkingNode::SidewalkEndpoint(
map.get_l(turn.id.dst).get_directed_parent(),
map.get_l(turn.id.dst).dst_i == turn.id.parent,