Commit Graph

5606 Commits

Author SHA1 Message Date
Dustin Carlino
f6565988c9 Let parking aisles span multiple parking lots. 2020-11-19 12:34:31 -08:00
Dustin Carlino
3905131fe4 Track and expose total trip distance in the API. #392 2020-11-19 10:40:00 -08:00
Michael Kirk
9afbe6031f speed up texture loading minimize vector alloc
It's still kind of slow in --debug wasm builds, but seemingly much
faster in release or non-wasm.
2020-11-18 22:49:49 -08:00
Dustin Carlino
cb4b84873b Refactor code into person_finished_trip for all trip transitions. #258 2020-11-18 19:05:44 -08:00
Dustin Carlino
37ae02352e Just reorganize TripManager code a bit. #258 2020-11-18 18:30:03 -08:00
Dustin Carlino
e6e7ec42ff Collapse two methods in TripSpawner. While we validate a TripSpec, also produce the TripLegs. Also get rid of the stateful TripSpawner entirely. #258 2020-11-18 15:08:06 -08:00
Dustin Carlino
37c132465f Document how simulation spawning works, as a way to think through the next steps towards simplifying it. #258 2020-11-18 14:35:04 -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
cc254d86ae Fix bug with trip tables -- changing filters in the cancelled and unfinished tables would incorrectly jump back to the finished trip table. 2020-11-18 13:23:11 -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
739e33ec3e We do need to fill out trip legs for TripSpec::SpawningFailure; smoke tests in other maps hit it. #258 2020-11-17 18:02:48 -08:00
Dustin Carlino
82c7cd1e8f At last, collapse the OD -> SpawnTrip -> TripSpec function into one thing. #258 2020-11-17 17:55:29 -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
8d80668a56 The big cutover: a Scenario's trips are now just start/endpoints and mode, not the old SpawnTrip structure with a bunch of different cases and details picked out. #258
Not regenerating scenarios yet...
2020-11-17 16:28:52 -08:00
Dustin Carlino
8d28274736 Simplify the old ScenarioGenerator, mostly by removing OriginDestination
in favor of Option<TripEndpoint>. The bike/car contention tutorial stage
has to be tweaked manually, since there's no longer a nice way to spawn
vehicles at a non-border intersection and force them to use a certain
DirectedRoad. #258
2020-11-17 15:51:30 -08:00
Dustin Carlino
0599d4b47b Whittle down places constructing SpawnTrip manually. #258 2020-11-17 14:10:47 -08:00
Dustin Carlino
7bb1d5b59c Switch the UI's spawn_agents_around intersection to go through Scenarios instead of reaching into internal sim spawning gunk. Lock down visibility of some sim spawning things. #258 2020-11-17 11:13:42 -08:00
Dustin Carlino
2abeebc55e Add a third TripEndpoint case to appear at an exact Position (lane + distance). This is a necessary step before simplifying Scenario's IndividTrip to use TripEndpoints and mode instead of SpawnTrip. #258 2020-11-17 10:50:42 -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
32dea68f5d Measure how many simulation events actually result in something
changing. #368
2020-11-16 11:51:24 -08:00
Dustin Carlino
3433fd99e0 Smarter traffic recorder. Capture the exit point when the vehicle crosses the entry point. Otherwise, in the Krakow scenario of interest, the vehicles piling up and making poor LCing decisions actually get blocked by other gridlock and never make it to the exit. #382 2020-11-16 09:59:43 -08:00
Dustin Carlino
754749a578 Parallelize part of scenario spawning. One of the code paths calls
biking_connection, which does a slow graph floodfill.

Prolet robot in Krakow: from 22.6s to 10.1s

Because Krakow now uses separate sidewalks and they're not properly
connected to the road graph yet, biking_connection has to search very
far. The speedup isn't noticeable in other cases.
2020-11-16 09:36:48 -08:00
Dustin Carlino
b9ff94f275 Fix crash in krakow with a biking trip that should get converted to a walking trip, but isn't 2020-11-15 19:59:31 -08:00
Dustin Carlino
24e1a48d75 Generalize TripSpec::NoRoomToSpawn to handle trips that're impossible to instantiate. Hitting this with 'random traffic' in krakow. #258 2020-11-15 17:52:54 -08:00
Dustin Carlino
d3aa81d2d2 new tool to record a scenario consisting of all traffic around some intersections, to help with producing a better test case for #382 2020-11-15 16:57:33 -08:00
Dustin Carlino
a0daeb2f4b new release 2020-11-15 10:59:36 -08:00
Dustin Carlino
1a0bd1848c Prep for release [rebuild] [release] 2020-11-15 10:16:45 -08:00
Dustin Carlino
396b9b1969 Infer parking tags better for dual_carriageway=yes. Also stop inferring parking on trunk roads like Aurora. And pull in fresh Seattle OSM, with lots of dual_carriageways tagged. #230 2020-11-14 17:32:34 -08:00
Dustin Carlino
5107b0f6c2 Namespace data/player/{edits,camera_state,saves} by city name. #326 2020-11-14 14:29:49 -08:00
Dustin Carlino
8101c2a820 Add a favicon to the web deployment, mostly to stop an error in the devconsole 2020-11-14 10:51:33 -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
2d928b7ecf Little tweaks to the parking mapper mode to make it easier to tag dual
carriageways. #230
2020-11-12 22:00:57 -08:00
Dustin Carlino
c6b752d41b Iterate on automatically finding medians for #230. Still not ready, but
get fresh OSM data to test in both Krakow and Seattle. While I'm at it,
also grab fresh OSM for Krakow, since it's been ages.
2020-11-12 17:58:19 -08:00
Michael Kirk
65897d8fe2 FIX #379: web client resizes with window 2020-11-12 16:51:05 -08:00
Michael Kirk
6b02048ce7 see logs in web 2020-11-12 16:51:05 -08:00
Dustin Carlino
69699600ea Prototype filling in the gaps near one-way roads. Needs more filtering
out, but solid start. #230

Regenerate map data, since the Area object changed.
2020-11-12 14:21:08 -08:00
Dustin Carlino
c96f84341a Incorporate intersection corners in the around-the-block polygon. #230 2020-11-12 13:41:47 -08:00
Dustin Carlino
1b6af3dfb1 Prototype a debug mode tool to trace a polygon on the interior of any "loop" of roads. Aka, find the polygon if you "walk around the block." This can be used to fill in the blank space between dual carriageways. #230
Algorithm needs some work -- it doesn't trace along sidewalk corners,
and it fails for some starting lanes.
2020-11-12 12:53:41 -08:00
Dustin Carlino
22cef74aec Always allow blocking a degenerate intersection. Visually inspected on
the lane-changing test map. #382

Also abandon sim.run_until_done; the only caller was the LC test, and it
uses 30s steps inappropriately anyway.
2020-11-12 11:34:17 -08:00
Dustin Carlino
62135ffc26 Allow blocking the intersection at another Green lake case, and trigger a [rebuild] 2020-11-12 10:37:21 -08:00
Dustin Carlino
b9bf23e420 Downgrade tokio. aa966d7533 broke headless and updater. Blocked on https://github.com/seanmonstar/reqwest/issues/1060 2020-11-12 10:31:52 -08:00
Dustin Carlino
7854823c28 Change the to/from permanent map edits APIs to be a little more ergonomic 2020-11-12 10:13:32 -08:00
Dustin Carlino
c0e2401414 Put the headless API server in the binary release; at least one person wants to use it, but has trouble compiling [rebuild] 2020-11-12 10:01:45 -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
3583d068a6 Fix a bug introduced in e3b9c42506 on the proposal saver, and allow blocking-the-box on another Ballard intersection 2020-11-11 13:20:56 -08:00
Dustin Carlino
e5ff76e00c Working on gridlock in the Ballard map. Allow blocking-the-box near the
famous Green Lake intersection, and add a little debug tool to see
current queue reservation length.
2020-11-11 12:43:28 -08:00
Dustin Carlino
aa966d7533 Upgrade a bunch of dependencies 2020-11-11 12:02:53 -08:00