mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 09:24:26 +03:00
Make the 15m tool respect access-restricted zones.
This commit is contained in:
parent
3060f94989
commit
204d13177d
@ -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() {
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user