don't spawn bikes on tiny lanes, it causes queue spillover

This commit is contained in:
Dustin Carlino 2020-07-20 10:38:56 -07:00
parent 10f8ddde48
commit 9be94f9a70

View File

@ -440,9 +440,19 @@ impl SidewalkSpot {
// Don't start biking on a blackhole! // Don't start biking on a blackhole!
// TODO Maybe compute a separate blackhole graph that includes bike lanes. // TODO Maybe compute a separate blackhole graph that includes bike lanes.
if let Some(redirect) = map.get_l(driving_lane).parking_blackhole { if let Some(redirect) = map.get_l(driving_lane).parking_blackhole {
// Make sure the driving lane is at least long enough to spawn on. Bikes spawn in the
// middle, so it needs to be double.
if map.get_l(redirect).length() < 2.0 * BIKE_LENGTH {
return None;
}
let new_sidewalk = map.get_parent(redirect).bike_to_sidewalk(redirect)?; let new_sidewalk = map.get_parent(redirect).bike_to_sidewalk(redirect)?;
SidewalkSpot::bike_rack(new_sidewalk, map) SidewalkSpot::bike_rack(new_sidewalk, map)
} else { } else {
if map.get_l(driving_lane).length() < 2.0 * BIKE_LENGTH {
return None;
}
SidewalkSpot::bike_rack(sidewalk, map) SidewalkSpot::bike_rack(sidewalk, map)
} }
} }