Commit Graph

188 Commits

Author SHA1 Message Date
Dustin Carlino
ee0d73847e Add more small Seattle maps for the experiment -- and who knows, maybe also useful for traffic sim
And unbreak the importer, cargo check doesn't build with features! Argh.
2020-12-18 11:00:15 -08:00
Dustin Carlino
5aecff3b9e Regularly import Salzburg. #366 2020-12-15 06:02:06 -08:00
Michael Kirk
8b9b3ce2b1
census areas import (#425)
#424
2020-12-14 17:48:47 -08:00
Dustin Carlino
aa5010f2d0 Import part of Manhattan. Need to adjust the boundary to fix water
polygons, but this is a start.
2020-12-09 16:15:08 -08:00
Dustin Carlino
c8a37a27a0 Create 3 new small maps of Seattle for the experiment. Notably, 2 of
them simulate fully with --infinite_parking, and SLU makes it to about
4pm, so these might have some other interesting use...
2020-12-07 20:58:04 -08:00
Dustin Carlino
57963126fa Fold number of housing units into Building; ditch the extra file approach. 2020-12-01 12:43:19 -08:00
Dustin Carlino
aa4d848a0e Figure out the number of single family and multi-family units per OSM building, from parcel data. Just store it in an extra system file for now. 2020-11-30 10:58:47 -08:00
Dustin Carlino
ff829db8f1 Expanding the boundary of huge_seattle, and creating a new north_seattle map 2020-11-25 08:56:55 -08:00
Dustin Carlino
ab88010ed0
Refactor PathRequest creators that go between two buildings. #176 (#404) 2020-11-24 13:21:44 -08:00
Dustin Carlino
fb07e35200 Just download a KML file of Seattle zoning codes, for #393 2020-11-21 08:55:58 -08:00
Dustin Carlino
308eb90956 Bring in Seattle parcel data to experiment with filling the negative
space on maps with "private area around houses".

And a few tweaks to the KML viewer to make it more useful:

- optionally save the clipped file
- click an object to view all attributes in a scrollable popup
2020-11-20 10:30:13 -08:00
Dustin Carlino
915e12ff7e Remove PersonID from Scenario; the simulation will assign IDs sequentially. They're redundant. #258
Slightly reduces scenario file size, and simpler code to construct
scenarios.
2020-11-18 14:13:25 -08:00
Dustin Carlino
6a2c391b8b Add a tool to convert maps from JSON back to binary, to enable experiments with modifying parking per buildings. Except... apparently we can't read back in JSON maps?! 2020-11-18 11:34:38 -08:00
Dustin Carlino
4ab98b1477 Compact the schedule in Scenario by just storing each TripEndpoint. #258
The schedule validation changes slightly. No-op trips between the same
origin/destination are now an error and get filtered out.

huge_seattle scenario goes from 129MB to 110MB with the redundant
endpoints removed.
2020-11-18 11:13:09 -08:00
Dustin Carlino
7741ea79b5 Refactor starting trips -- caller passes in TripInfo. Stop inferring
TripEndpoints from TripLegs. #258

NOW regenerate scenarios. I'm confident this sweeping refactor didn't
break behavior, because prebaked data didn't budge. huge_seattle
scenario went from 147MB to 129MB. Not bad!
2020-11-17 16:59:37 -08:00
Dustin Carlino
5ea3c2ba6f Remove support for remote trips, and stop plumbing off-map locations. A
remote trip goes between two locations off-map, specified just by a GPS
coordinate. The trips aren't simulated at all. They were originally
added to support Orestis's pandemic model, to handle transmission
off-map in shared buildings. This work has died off, there are no other
anticipated use cases for remote trips, and they complicate bigger
refactorings. #258

This also has the nice side effect of substantially reducing scenario
size -- huge_seattle from 177MB to 147MB. That unused metadata was
expensive!
2020-11-17 10:14:23 -08:00
Dustin Carlino
b6be9c81d5 Generate city picker maps from a bunch of small maps, instead of one huge map. Use for Paris. One giant map covering everything there is going to be too large. 2020-11-13 18:22:46 -08:00
Dustin Carlino
d43bf2c869 Import Paris, for helping the OSM community visualize all the awesome pop-up bike lanes there 2020-11-13 17:23:36 -08:00
Dustin Carlino
6fe49ce0fa Some preps for importing Paris: avoid crashing on some previously unseen
OSM things, and making geojson_to_osmosis handle multiple polygons in
one input file.
2020-11-13 16:31:22 -08:00
Dustin Carlino
4b557fa6de Bring in fresh OSM for Seattle. Because it's so annoying to manually
repair proposals when roads change upstream, make the test dump a
repaired file before failing. Manually inspect/amend that.
2020-11-11 15:16:06 -08:00
Dustin Carlino
aa966d7533 Upgrade a bunch of dependencies 2020-11-11 12:02:53 -08:00
Dustin Carlino
07ac288e72 Refactor: rename Pt2D::from_gps to just gps.to_pt(bounds) 2020-11-10 12:00:43 -08:00
Dustin Carlino
104c987edd Import Seattle collision data and convert to the common format. #87 2020-11-06 13:16:50 -08:00
Dustin Carlino
b0bdbf6c1f Change some cities to just use JSON config for importing, instead of boilerplate-filled code. #326 2020-11-06 10:56:36 -08:00
Dustin Carlino
e0a8d82b61 Reorganize polygon files to importer/config, instead of data/input.
Nothing in data/input should be under version control; all of it is
managed by the updater. #326
2020-11-06 10:10:03 -08:00
Dustin Carlino
ad7a25f7f2 Prototype a simple data format for collision data. Import data for Leeds and London. #87 2020-11-05 16:16:40 -08:00
Dustin Carlino
ac6eff31ef Rename some maps to remove the now-redundant city. #326 2020-11-05 15:24:02 -08:00
Dustin Carlino
cda586dfc9 Cleanup by moving some methods to belong to MapName. #326 2020-11-05 14:18:13 -08:00
Dustin Carlino
4f2cda8d53 Reorganize data/system/ files by city! The only interesting change is
abstutil::path_all_maps becoming abstutil::list_all_maps. #326
2020-11-05 14:05:48 -08:00
Dustin Carlino
67530bec07 Future-proof file organization by changing map_name from a string to a
struct. Whatever choices we make next about naming cities hierarchially
or not can be managed in just one place. #326

This is a pretty huge change, but the compiler gives reasonable
confidence it's correct. More bugs are likely to crop up in the next
step, when filenames start being namespaced by the city too.
2020-11-04 17:26:32 -08:00
Dustin Carlino
e99dd5bba7 Use inferred sidewalks for Leeds, after detecting another geometry bug
when building sidewalk corners. Raw sidewalks from OSM aren't suitable
for traffic simulation yet.
2020-11-04 08:46:06 -08:00
Dustin Carlino
21cd7a197d Run the experimental cycleway snapper phase for Leeds, after adding a
check to skip ways like https://www.openstreetmap.org/way/429285996,
which're unexpectedly loops.
2020-11-03 15:57:21 -08:00
Robin
edf5d0d8a9
Add Leeds (#375) 2020-11-03 10:53:14 -08:00
Dustin Carlino
4cd18047bd Fix the random_scenario tool by adding --scenario_name and saving a
binary scenario file
2020-11-02 12:01:37 -08:00
Dustin Carlino
b46c3d26eb Don't infer sidewalks for the plethora of demo maps 2020-10-31 17:06:48 -07:00
Dustin Carlino
ca2ff08d71 Don't render intersections between footways with a special color. Also
cut Kraków over to using the new experimental footpath support. #161
2020-10-30 14:11:00 -07:00
Dustin Carlino
bf0dce2c18 Optionally import sidewalks and separate footpaths exactly as they're in OSM, instead of attempting any inference. This is a way to move forward on #161 without having to cutover to it all at once. 2020-10-30 13:27:45 -07:00
Dustin Carlino
3ed7e73aa8 Use a u64 RNG seed, not a u8 2020-10-29 09:25:07 -07:00
Dustin Carlino
fda4c4da7b Refactor a few utilities, and use convex hull of the city boundaries to simplify them considerably. #326 2020-10-26 14:15:25 -07:00
Dustin Carlino
34b41a909e Optionally keep building OSM tags. Display in info panels and the new viewer, when present.
Don't keep the tags by default. File size increase from the empty map is
negligible.
2020-10-24 14:19:22 -07:00
Dustin Carlino
f258c50595 Organize import blocks using https://github.com/dabreegster/organize_rust_imports 2020-10-05 20:29:22 -07:00
Dustin Carlino
27d94945c6 Manually move mod block after the use block, to match what CLion does. 2020-10-05 20:29:22 -07:00
Dustin Carlino
ac5aa927db Test turn generation via goldenfiles instead. Revert the "import from a
raw string" stuff from the previous commit.

Add tests of a few interesting intersections. The results right now
aren't ideal, but this sets things up for fast iteraton.
2020-10-01 15:34:43 -07:00
Dustin Carlino
ec114e51e1 Prototype an idea for unit testing the turn generation code. Hardcode a
simple .osm, turn it into a full Map, and inspect the results.
2020-09-30 16:30:28 -07:00
Dustin Carlino
2c63a485cc Undo some uses of impl trait. Originally added for performance in a big
refactor, they complicate the function signatures significantly and have
no observable perf impact, since all of the methods just happen in map
importing.
2020-09-29 15:53:08 -07:00
Dustin Carlino
597ef473f2 Upgrade most dependencies 2020-09-24 09:36:26 -07:00
Dustin Carlino
8faab3592a Refactor RawMap saving 2020-09-22 15:49:02 -07:00
Michael Kirk
66220e0a57 persist raw map artifact during oneshot import 2020-09-22 15:31:40 -07:00
Dustin Carlino
4a07164394 Add the concept of trip purpose. Seed it from Soundcast data, or assign
it for the prolet robot model. Expose it in the trip info panel.

Total scenario size from 385MB to 412MB, but that's not so bad, and this
seems worth it.
2020-09-19 13:02:36 -07:00
Michael Kirk
08f330cfad track worker capacity of commercial buildings 2020-09-16 16:43:11 -07:00
Dustin Carlino
edbc674970 Fix stop sign placement for left-handed maps. #311 2020-09-11 11:03:59 -07:00
Dustin Carlino
5be4c2ca84 Add an API to add a new trip in the middle of the simulation. Fixes #313
[rebuild]
2020-09-06 13:53:31 -07:00
Dustin Carlino
4367c03a7d Add a tool to generate a random proletariat robot scenario given an RNG seed, for the forecasting group. #313 2020-09-04 11:10:38 -07:00
Dustin Carlino
65e07d9cc7 Read/write scenarios in JSON, so people can manipulate them in any language. #313 2020-09-04 10:57:52 -07:00
Dustin Carlino
4576e9c1d0 Start importing a tiny slice of London, to start working on left-hand driving again 2020-09-03 16:09:17 -07:00
Dustin Carlino
b13f5b0f4a Move iotool things into the importer package, but keep separate binaries 2020-09-03 11:49:53 -07:00
Dustin Carlino
6a9d55b7f5 Since the first line of the osmosis file doesn't matter, more clearly rename it 2020-09-02 22:12:43 -07:00
Michael Kirk
6482f8b0a4
util to convert geojson to osmosis polygon (#309) 2020-09-02 15:29:25 -07:00
Dustin Carlino
651b4f5ec9 Some code style cleanups after #296 2020-08-27 09:10:39 -07:00
Kyle Huston
90cf38a522
Fail importer immediately if dependencies are missing and make gunzip etc. configurable (#296)
* Read ImporterConfiguration from .toml file if present. Also check for presence of dependency programs.

* Actually use config.osmconvert instead of hard-coded 'osmconvert'

* Add curl to checked dependencies

* Don't require all fields to be present in importer.toml configuration. Fill in defaults.

* Remove unneeded slice

* Use json for importer config and use serde(default) attribute to simplify application of defaults

* Extract re_dependencies_callable from main.rs and remove dependency on Job

* Revert change to abstutil, use struct-level default attribute

* Add importer.json to .gitignore

* Make gunzip_args string instead of Option<string>
2020-08-27 09:06:14 -07:00
Dustin Carlino
4e25a22cd0 actually, tel aviv has lots of street parking, so randomly assign 50% [rebuild] 2020-08-26 10:33:29 -07:00
Dustin Carlino
8b7ad86647 Regularly import Tel Aviv! 2020-08-26 10:25:45 -07:00
Dustin Carlino
5528f19f87 Split pathfinder struct into an enum to make room for a variation that
just does Dijkstra's. This has a few uses:

- When you import with --skip_ch, the resulting map will still work,
  just more slowly
- For congestion capping experiments, we sometimes want to route around
  a zone. Regenerating the contraction hierarchy for every combination
  of zone being open/closed is likely more complex and expensive than
  just falling back to A* for trips that cut through at least one closed
  zone.

Not regenerating yet
2020-08-22 09:54:02 -07:00
Dustin Carlino
9a350b7568 Regularly import Xi'an 2020-08-17 19:37:34 -07:00
Dustin Carlino
49ea9f2d54 Faster London:
- wire up the flag to skip building contraction hierarchies in one-shot
  importer. 406s to import london without, 230s by skipping CH
- lazily render zoomed parking lot details. 72s and laggy X11 mouse
  before, 42s and no GPU melting after
- add my script for stress-testing the importer
2020-08-14 20:50:22 -07:00
Dustin Carlino
843d24b6ed Refactor: OriginalBuilding should just be OsmID. The purpose of
OriginalBuilding was to refer to buildings in a stable way across
different maps and across OSM updates. Recently, OsmID and friends
appeared. The double layer of wrapping is an annoying API.

Not regenerating map data yet; about to do the same thing for
OriginalIntersection
2020-08-13 11:37:06 -07:00
Dustin Carlino
d1e9e38e82 refactor for #231: use typed OSM IDs everywhere, dedupe URL code
have to regen, the binary format has changed
2020-08-08 16:09:36 -07:00
Dustin Carlino
3c24b7aa5a pull in spawn times for seattle from gtfs. looks wrong, but it's a
start.
2020-08-05 14:46:37 -07:00
Dustin Carlino
22afb60421 woops, parcels.bin wasnt deterministic. kept seeing a diff in data/MANIFEST. 2020-08-03 11:31:56 -07:00
Dustin Carlino
d22aa87139 rearrange Building internals for #176. edits can affect building
connections to driving/biking. just store the immutable stuff -- whether
there's parking in the building, the connection to the sidewalk, and the
physical driveway line. compute all the rest dynamically, so it responds
to edits without effort.

shouldn't be major behavior changes yet (besides maybe fixing some bugs
involving edits)
2020-07-31 12:49:33 -07:00
Dustin Carlino
e1e265db14 tighten up Polygon constructors to enforce an outer ring... in most
cases now.
2020-07-27 14:03:55 -07:00
Dustin Carlino
7a00839553 ditch osm-xml, make a new osm parser from scratch based on roxmltree.
skip unreferenced objects, make the output extremely easy to consume.
also fix timers in importer. this helps with #212, although the actual
problem there is weird.

regen everything. some parking lots change a bit, but not horribly, and
that code needs some attention anyway.
2020-07-25 13:52:41 -07:00
Dustin Carlino
fc761ae032 stop bringing in railway=rail for seattle. it's cosmetic only, and it messes up some geometry in south seattle and causes gridlock. not worth it yet. 2020-07-24 20:22:33 -07:00
Dustin Carlino
328cbcd1f1 stop melting my laptop when generating scenarios 2020-07-23 09:15:25 -07:00
Dustin Carlino
0f0860b4b5 make the importer depend less on external unix commands for #119. still need to handle unzip and curl. 2020-07-22 22:51:45 -07:00
Dustin Carlino
4fb7e008c0 scale num_residents for polygons near the map boundary, for #119 2020-07-22 13:24:56 -07:00
Dustin Carlino
bbe06c6075 randomly distribute residents to buildings in the planning area for #119 2020-07-21 14:00:59 -07:00
Dustin Carlino
82dd1fd01a spawn a new bus for every route every hour 2020-07-16 11:58:09 -07:00
Dustin Carlino
1d89d4b85f tie population count to planning areas in berlin, for #119 [rebuild] 2020-07-16 11:34:46 -07:00
Dustin Carlino
e2d478340b bring in planning area KML for berlin, #119 2020-07-16 11:15:22 -07:00
Dustin Carlino
4a118c8103 import berlin city centre for #119 2020-07-15 09:42:45 -07:00
Dustin Carlino
7341c0189a plumb through which trips (and people) are affected by an experiment. no
UI exposure yet.
2020-07-14 14:49:04 -07:00
Dustin Carlino
b4b8556f46 just get a few new traffic signals and add parking to south seattle, to
try to make progress
2020-07-13 16:07:35 -07:00
Dustin Carlino
0f82c21560 - manually fix a few crazy signals downtown.
- interpret tags to make 3rd Ave bus-only. cars technically allowed
  sometimes, but bus-only is more accurate for now.
- also remove austin from bundled maps. maintaining it has a cost, and
  the point was just to have at least one non-seattle city kept up to
  date.  krakow now satisfies that.
2020-07-13 13:40:46 -07:00
Dustin Carlino
b058d5d926 cargo fmt and regenerate map data 2020-07-13 10:11:48 -07:00
Mateusz Konieczny
885fdefb5d
playing with processing modifications (#183)
* WIP set up plumbing for calculating building info in the Raw layer and using it later for #154

* WIP playing with processing modifications

* experiment with some possibilities for tag processing

* fix an embarassing typo

* enable busses in work-home traffic

* refactor, add multiuse

* seed more parking in Kraków

* parse integers properly - thanks for a help!

* rebalance generated trips

* add hack providing some background traffic

more realistic traffic

even mess realistic people

* attempt to further reduce parking deficit

* add TODO

Co-authored-by: Dustin Carlino <dabreegster@gmail.com>
2020-07-13 09:56:05 -07:00
Dustin Carlino
0dd3199f7a cut down variations of pt2d<->gps. mostly we want to forcibly convert.
possible semantic change: soundcast border matching now includes ALL
borders, even if the center is slightly OOB
2020-07-11 12:02:12 -07:00
Dustin Carlino
f8ace3c0ab per-city config to let bikes use bus lanes, for #184
while I'm regenerating maps anyway, grab fresh seattle osm with more
lane fixes. and parallelize a slow point matching step -- 10x speedup
for austin
2020-07-11 11:08:23 -07:00
Dustin Carlino
3639379313 importer option to assume onstreet parking on some residential roads, if OSM doesnt say anything. give 50% of residential roads in krakow some parking. fixes #171
also clean up the seattle sidewalks dataset for now; the matching code
is quite bad, and not planning to use this anytime soon
2020-07-09 15:14:08 -07:00
Dustin Carlino
19409dfc8c add krakow as an optional city. need to specify more customization for #171, and given how much work is focused here, using the one-shot importer no longer makes sense 2020-07-09 14:33:39 -07:00
Dustin Carlino
9f72b3dd51 cleanup after the relative dir fix, and add support for hardcoding the
data dir, for #137
2020-07-07 12:14:02 -07:00
Dustin Carlino
6919c24bf8 detect the data/ dir more intelligently. fixes #73. still need to
- consider collapsing the directory structure in the releases
- fix wasm

[rebuild]
2020-07-07 11:09:35 -07:00
Dustin Carlino
c1f752730c woops, needed to regenerate scenarios a few commits ago, the laneids are off 2020-07-06 16:47:41 -07:00
Dustin Carlino
56cb59c3ac rip out gtfs code, cutover to osm. will revisit this later; gtfs and osm probably disagree on routes and stops, and gtfs has schedule. but for now, just osm. 2020-07-03 17:33:32 -07:00
Dustin Carlino
c97bd0fe4b some cleanup after #106. unbreak importer 2020-06-28 11:13:35 -07:00
Dustin Carlino
a6b90d00d8 very simple modifier to cancel all trips for some percentage of people 2020-06-27 14:20:25 -07:00
Dustin Carlino
455b17faef start playing around with manchester 2020-06-27 12:32:03 -07:00
Dustin Carlino
16bc96c401 try adjusting the offstreet spots in downtown to be a fraction of the
initial demand
2020-06-13 15:38:04 -07:00
Dustin Carlino
42ea64a680 changing parking seeding to fill in private spots first. makes progress
in larger maps. i made sure the optimize challenge is still interesting
after this change.
2020-06-13 15:14:23 -07:00
Dustin Carlino
aceadef79f refactoring some trip spawning stuff from importer, using it in the new agent spawner too 2020-06-01 17:37:54 -07:00