Make the one-mode path guesses more precise in their start/end locations. Noticeable effect is in the freeform agent spawner, the paths actually go between buildings now, instead of lane starts.

This commit is contained in:
Dustin Carlino 2020-12-16 15:49:03 -08:00
parent 7c973ecacf
commit d4fa67ac87
4 changed files with 17 additions and 5 deletions

View File

@ -637,15 +637,15 @@
"size_bytes": 59144729
},
"data/system/seattle/prebaked_results/lakeslice/weekday.bin": {
"checksum": "06f5cf09a3c67d9487eb35823f95a920",
"checksum": "451dfa40686cc5111922f5905ce03197",
"size_bytes": 66439671
},
"data/system/seattle/prebaked_results/montlake/car vs bike contention.bin": {
"checksum": "1f8cd9511798d39539f4e6feb933d645",
"checksum": "d1bb6deda465f6ff1705034ba41ff806",
"size_bytes": 5277
},
"data/system/seattle/prebaked_results/montlake/weekday.bin": {
"checksum": "0bff5ccfad021b99b3266886ba3aafa8",
"checksum": "6a8b47cb8afe5cf44ccd77e7e4fdfb00",
"size_bytes": 8533785
},
"data/system/seattle/scenarios/ballard/weekday.bin": {

View File

@ -393,6 +393,8 @@ struct AgentPosition {
/// transit stop.
/// - The value might be slightly undercounted or overcounted if the path crosses into or out
/// of an access-restricted or capped zone.
/// - At the very end of a driving trip, the agent may wind up crossing slightly more or less
/// than the total path length, due to where they park along that last road.
distance_crossed: Distance,
/// None for buses
person: Option<PersonID>,

View File

@ -363,7 +363,13 @@ impl DrivingGoal {
match self {
DrivingGoal::ParkNear(b) => match constraints {
PathConstraints::Car => {
Some(Position::start(map.find_driving_lane_near_building(*b)))
let driving_lane = map.find_driving_lane_near_building(*b);
let sidewalk_pos = map.get_b(*b).sidewalk_pos;
if map.get_l(driving_lane).parent == map.get_l(sidewalk_pos.lane()).parent {
Some(sidewalk_pos.equiv_pos(driving_lane, map))
} else {
Some(Position::start(driving_lane))
}
}
PathConstraints::Bike => Some(map.get_b(*b).biking_connection(map)?.0),
PathConstraints::Bus | PathConstraints::Train | PathConstraints::Pedestrian => {

View File

@ -306,6 +306,10 @@ pub enum TripEndpoint {
}
impl TripEndpoint {
/// Figure out a single PathRequest that goes between two TripEndpoints. Assume a single mode
/// the entire time -- no walking to a car before driving, for instance. The result probably
/// won't be exactly what would happen on a real trip between the endpoints because of this
/// assumption.
pub fn path_req(
from: TripEndpoint,
to: TripEndpoint,
@ -361,7 +365,7 @@ impl TripEndpoint {
}
}
pub(crate) fn pos(self, mode: TripMode, from: bool, map: &Map) -> Option<Position> {
fn pos(self, mode: TripMode, from: bool, map: &Map) -> Option<Position> {
match mode {
TripMode::Walk | TripMode::Transit => (if from {
self.start_sidewalk_spot(map)