mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-27 00:12:55 +03:00
try adjusting the offstreet spots in downtown to be a fraction of the
initial demand
This commit is contained in:
parent
42ea64a680
commit
16bc96c401
@ -365,7 +365,7 @@ data/input/seattle/sidewalks.kml,94d385ba03ef1b57a5ba10965913ec6c,https://www.dr
|
||||
data/input/seattle/trips_2014.csv,d4a8e733045b28c0385fb81359d6df03,https://www.dropbox.com/s/5ppravwmk6bf20d/trips_2014.csv.zip?dl=0
|
||||
data/system/cities/seattle.bin,018968486daedf1b69a1b3be5a3749bf,https://www.dropbox.com/s/eupzog6iw7wtaas/seattle.bin.zip?dl=0
|
||||
data/system/maps/ballard.bin,84075fe9b2920cf45a20318a71cc67f7,https://www.dropbox.com/s/u4rvz50she3yrk0/ballard.bin.zip?dl=0
|
||||
data/system/maps/downtown.bin,54318d20d768ad7d76c422612456b359,https://www.dropbox.com/s/4do5cg4vc17lafo/downtown.bin.zip?dl=0
|
||||
data/system/maps/downtown.bin,7aac2dc62f5127f48036512b5602ebcb,https://www.dropbox.com/s/4do5cg4vc17lafo/downtown.bin.zip?dl=0
|
||||
data/system/maps/downtown_atx.bin,d46819d53a47b7628fbfb947f17bd790,https://www.dropbox.com/s/5avnbkd4oxby2hs/downtown_atx.bin.zip?dl=0
|
||||
data/system/maps/huge_austin.bin,884294efce5154c483a976c390089d15,https://www.dropbox.com/s/khy0m6v9yt0gjnt/huge_austin.bin.zip?dl=0
|
||||
data/system/maps/huge_seattle.bin,ad8b5a5ea710b0524741a800e5703060,https://www.dropbox.com/s/btvr3qajshnivhb/huge_seattle.bin.zip?dl=0
|
||||
@ -378,7 +378,7 @@ data/system/prebaked_results/lakeslice/weekday.bin,3b646ecf92e16df3c33bf7dbf3013
|
||||
data/system/prebaked_results/montlake/car vs bike contention.bin,8c1c883a5dcd6daa042740033c0c18c4,https://www.dropbox.com/s/jefg0ikjy9dsrdd/car%20vs%20bike%20contention.bin.zip?dl=0
|
||||
data/system/prebaked_results/montlake/weekday.bin,ae43e474b1ab111615e2efde90135491,https://www.dropbox.com/s/1aq7n9ow8tfqb5d/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/ballard/weekday.bin,60d3eb1cdb8672e2d29cf3acf23ccabe,https://www.dropbox.com/s/67hys1v7m7oe979/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/downtown/weekday.bin,8821147124da650f975483ed1e5bbb69,https://www.dropbox.com/s/pstvu4p7xj3gaoi/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/downtown/weekday.bin,c3d252010b69e973f20b2cd8022e0fe5,https://www.dropbox.com/s/pstvu4p7xj3gaoi/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/huge_seattle/weekday.bin,31bfc23f39bb54bef939119f6cfbd2e2,https://www.dropbox.com/s/u3pmsshwnf13g83/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/lakeslice/weekday.bin,f33ade15eb1a177610c58d839d01620b,https://www.dropbox.com/s/858wxml3z0qlhxd/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/montlake/everyone_weekday.bin,6806c7788fb71471e142287c44991eb3,https://www.dropbox.com/s/44s818fimpu53v1/everyone_weekday.bin.zip?dl=0
|
||||
|
@ -12,15 +12,16 @@ Details below. Many limitations are mentioned; improvements are ongoing. I'll
|
||||
add pictures to explain better when I get time.
|
||||
|
||||
<!--ts-->
|
||||
* [How A/B Street works](#how-ab-street-works)
|
||||
* [Driving](#driving)
|
||||
* [Parking](#parking)
|
||||
* [Biking](#biking)
|
||||
* [Walking](#walking)
|
||||
* [Transit](#transit)
|
||||
* [Intersections](#intersections)
|
||||
* [People and trips](#people-and-trips)
|
||||
* [Map edits](#map-edits)
|
||||
|
||||
- [How A/B Street works](#how-ab-street-works)
|
||||
- [Driving](#driving)
|
||||
- [Parking](#parking)
|
||||
- [Biking](#biking)
|
||||
- [Walking](#walking)
|
||||
- [Transit](#transit)
|
||||
- [Intersections](#intersections)
|
||||
- [People and trips](#people-and-trips)
|
||||
- [Map edits](#map-edits)
|
||||
|
||||
<!-- Added by: dabreegster, at: Mon Jun 8 12:17:13 PDT 2020 -->
|
||||
|
||||
@ -48,6 +49,8 @@ add pictures to explain better when I get time.
|
||||
[manually mapped](https://dabreegster.github.io/abstreet/map_parking.html)
|
||||
- Off-street: most buildings have at least a few parking spots in a driveway
|
||||
or carport
|
||||
- Currently experimenting in the downtown map: set the number of available
|
||||
spots based on number of cars seeded at midnight
|
||||
- Parking lots: the number of spots is inferred
|
||||
- Restrictions
|
||||
- All spots are public except for the few spots associated with each building
|
||||
|
@ -105,7 +105,7 @@ fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
let maybe_map = if job.raw_to_map {
|
||||
let mut maybe_map = if job.raw_to_map {
|
||||
Some(utils::raw_to_map(&name, !job.skip_ch, &mut timer))
|
||||
} else if job.scenario || job.scenario_everyone {
|
||||
Some(map_model::Map::new(abstutil::path_map(&name), &mut timer))
|
||||
@ -116,14 +116,21 @@ fn main() {
|
||||
#[cfg(feature = "scenarios")]
|
||||
if job.scenario {
|
||||
timer.start(format!("scenario for {}", name));
|
||||
soundcast::make_weekday_scenario(
|
||||
let scenario = soundcast::make_weekday_scenario(
|
||||
maybe_map.as_ref().unwrap(),
|
||||
maybe_popdat.as_ref().unwrap(),
|
||||
maybe_huge_map.as_ref().unwrap(),
|
||||
&mut timer,
|
||||
)
|
||||
.save();
|
||||
);
|
||||
scenario.save();
|
||||
timer.stop(format!("scenario for {}", name));
|
||||
|
||||
// This is a strange ordering.
|
||||
if name == "downtown" {
|
||||
timer.start(format!("adjust parking for {}", name));
|
||||
seattle::adjust_private_parking(maybe_map.as_mut().unwrap(), &scenario);
|
||||
timer.stop(format!("adjust parking for {}", name));
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "scenarios")]
|
||||
|
@ -1,4 +1,6 @@
|
||||
use crate::utils::{download, osmconvert};
|
||||
use map_model::Map;
|
||||
use sim::Scenario;
|
||||
|
||||
fn input() {
|
||||
download(
|
||||
@ -99,3 +101,10 @@ pub fn ensure_popdat_exists(
|
||||
|
||||
(crate::soundcast::import_data(&huge_map), huge_map)
|
||||
}
|
||||
|
||||
pub fn adjust_private_parking(map: &mut Map, scenario: &Scenario) {
|
||||
for (b, count) in scenario.count_parked_cars_per_bldg().consume() {
|
||||
map.hack_override_offstreet_spots_individ(b, count);
|
||||
}
|
||||
map.save();
|
||||
}
|
||||
|
@ -763,13 +763,20 @@ impl Map {
|
||||
pub fn hack_override_offstreet_spots(&mut self, spots_per_bldg: usize) {
|
||||
for b in &mut self.buildings {
|
||||
if let Some(ref mut p) = b.parking {
|
||||
// Leave the parking garages alone
|
||||
if p.num_spots == 1 {
|
||||
if p.public_garage_name.is_none() {
|
||||
p.num_spots = spots_per_bldg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
pub fn hack_override_offstreet_spots_individ(&mut self, b: BuildingID, spots: usize) {
|
||||
let b = &mut self.buildings[b.0];
|
||||
if let Some(ref mut p) = b.parking {
|
||||
if p.public_garage_name.is_none() {
|
||||
p.num_spots = spots;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Map {
|
||||
|
Loading…
Reference in New Issue
Block a user