Commit Graph

4825 Commits

Author SHA1 Message Date
Dustin Carlino
112a29625f Prepare get_lane_specs_ltr to support two-way cycletracks from OSM...
and bring in fresh OSM, with some of the cycletracks tagged properly
2020-08-25 14:02:17 -07:00
Dustin Carlino
95c43f8e1c Finally replace the underlying storage in Road 2020-08-25 12:08:54 -07:00
Dustin Carlino
6919e4eace Working on kicking the old children out of the house (that is,
map_model). But give in and create an adapter to derive the old thing
from the new thing. The remaining callers are hard to port over to
lanes_ltr.
2020-08-25 12:08:54 -07:00
Dustin Carlino
376cf1292a And more. Now all the deprecated stuff is locked down to map_model, and
it's pretty much related to map construction and edits
2020-08-25 12:08:54 -07:00
Dustin Carlino
b6a4657dbb Whittle down more deprecated Road stuff 2020-08-25 12:08:54 -07:00
Dustin Carlino
aa3bd5073b Make some new methods on Road to handle child lanes from left-to-right,
not split by direction. Update many callers, and lock down the
visibility of the old methods.

Tested a few maps manually to make sure there's no behavioral diff. Only
problem right now is the z-order of adjacent lanes covering up half of
the white stripe sometimes. Have some ideas to fix that later, and not
_super_ important in the meantime.
2020-08-25 12:08:54 -07:00
Dustin Carlino
219622311d Add dev unverified workaround to mac instructions 2020-08-25 12:04:01 -07:00
Dustin Carlino
b99996c5be Oh no, the install URLs on the instructions page weren't actually links 2020-08-25 08:44:32 -07:00
Dustin Carlino
4005adecf8 Refactor: create a Direction enum, in preparation for two-way cycletracks on one side of a road. 2020-08-24 13:30:13 -07:00
Dustin Carlino
20d81cd453 Start bringing in cycletracks as bike lanes. Stop interpreting :left to
mean the backwards direction. Not handling two-way cycletracks yet.
2020-08-24 11:20:41 -07:00
Dustin Carlino
0ee6bcbfcb Fix intersection geometry in cases where two road edges intersect at
multiple points. This was already handled when the roads went between
the same intersections, but I found a case in Ballard where the roads
are just really close to each other. Screenshot diff empty in Krakow,
but still related to #243
2020-08-24 10:25:08 -07:00
Dustin Carlino
b41b52d7bd fix crash in debug mode when opening info panels 2020-08-24 09:01:27 -07:00
Dustin Carlino
bf57c26278 Documenting the trip transitions right now, partly as brainstorming for refactoring 2020-08-23 14:10:52 -07:00
Dustin Carlino
dc5bd7f904 new release 2020-08-23 12:09:45 -07:00
Dustin Carlino
6b7747c37a Overhaul lane markings:
- Cut off the one-way markings before the end of the road, to stop stomping over turn markings
- Draw turn arrows to every road, not each lane
- Only draw turn arrows when a lane is restricted from going to some
  outbound lane. At most intersections, all turns are legal, so don't draw
  anything.

[rebuild]
2020-08-23 12:00:25 -07:00
Dustin Carlino
0fd40bd04e Explicitly mark buildings with private off-street parking from OSM. 2ebf463635 added parking icons to all buildings with > 10 spots, but this makes the downtown map look ridiculous. The intention was to show the tagged buildings, so just go do that. 2020-08-23 11:09:00 -07:00
Dustin Carlino
8aff945bbf Manually fix the Burke Gilman proposal, broken by OSM IDs changing upstream. Give up on restoring the superblock one; I can't find an old release where it's working properly. I drew it originally from a few different sources that I didn't write down. Now that CHAZ/CHOP happened, maybe it could be redrawn later to document what that was like. 2020-08-23 10:40:30 -07:00
Dustin Carlino
70dd9fcad1 Switch to 'reserving' the congestion cap when starting a trip, not when entering the road. In the initial tests, all the drivers rush for a road at once. They all pass the check initially, then violate it when they reach it. It's a little more reasonable to enforce the cap earlier, even though we can't really predict when the car will reach the zone, so the time is a little off. 2020-08-23 09:54:39 -07:00
Dustin Carlino
6250cb8393 Be more specific about access restrictions in info panel. For capped roads, print the value and current counter. 2020-08-23 09:41:12 -07:00
Dustin Carlino
ca8af784c7 Add an explicit version number to the edits schema 2020-08-23 09:22:41 -07:00
Dustin Carlino
8a05a88f0c Refactor the plumbing of different parts of Sim. More context at
https://old.reddit.com/r/rust/comments/idjcua/passing_all_other_fields_of_a_struct_to_one/.
2020-08-22 21:46:57 -07:00
Dustin Carlino
83c0a31e62 show roads with changed access restrictions in edits layer 2020-08-22 20:27:04 -07:00
Dustin Carlino
66151e8aa4 Dump route goldenfiles during the smoke-test, so that it's run when all
data is regenerated. (Ideally screenshots would also be automated, but
that's a little trickier.)

_NOW_ regenerate all data! The only diff anywhere is the binary map
format, so there's confidence the last few commits haven't changed
anything.
2020-08-22 10:53:05 -07:00
Dustin Carlino
8165312426 Start the Dijkstra's impl, forking from the implementation in Zone. No
support for transit or zones yet. Simplify the CH building process now.
2020-08-22 10:22:11 -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
3afdb3f7e2 The JSON format for the map edits changes occasionally. Be backwards
compatible with old edits, automatically transforming them to match the
new format. Part of #216 and necessary to work on #234.
2020-08-22 09:14:01 -07:00
Dustin Carlino
11832aa606 Record throughput through a traffic signal by direction, expose through
the API (#245), and beef up the Python example.

Impact to prebaked file size is tiny -- for lakeslice, the original
intersection_thruput is 2MB and the new traffic_signal_thruput is 435KB.

[rebuild]
2020-08-22 09:13:16 -07:00
Dustin Carlino
5b2a548c93 When regenerating all map data, make sure proposals still work. Lo and
behold, I've broken two of them by updating OSM!
2020-08-21 15:49:28 -07:00
Dustin Carlino
ad423b22e9 Remove the glium backend, now that @michaelkirk has gotten the glow native/wasm backends ship-shape. Got rid of the glutin fallback behavior for now; need to ideally upstream something there for #103 2020-08-20 16:59:54 -07:00
Dustin Carlino
1d0470dac2 Fix the rustdoc workflow (handle ezgui feature import clash, and
document private struct fields)
2020-08-20 16:46:08 -07:00
Dustin Carlino
21ab1d7d6f Before starting the driving portion of a trip, check if it'll cross a
zone with a cap that's been exceeded. If so, abort the trip.

This is 90% plumbing... need to rethink how pieces of the simulation are
passed around.
2020-08-20 16:38:45 -07:00
Dustin Carlino
2bfb5d5ac4 Track how many cars are entering zones with caps.
Tested by print debugging and comparing to throughput stats
2020-08-20 16:38:45 -07:00
Dustin Carlino
fa83554eb4 Consolidate code for loading edits from JSON 2020-08-20 16:33:08 -07:00
Dustin Carlino
2783c3e180 Expose the granular delays through an API for reinforcement learning (#245). 2020-08-20 16:21:52 -07:00
Dustin Carlino
084b9d74cd Store delay for traffic signals per direction of travel, using a compressed representation of turn groups. No substantial increase in prebaked file size. 2020-08-20 16:21:52 -07:00
Michael Kirk
5db0a7ad9d
reclaim wasm vertex/buffer memory, consolidate glow backends (#290)
* Complete wasm backend memory mgmt, extract common glow code

Similar to 3e8d2d7d, but for the wasm backend.

Also takes a pass at consolidating some of the common code between the
glow-native and glow-wasm backends. At this point, the backends just
diverge in their window handling, and the data types of their OpenGL
data types (e.g. vertex_buffer.id is WebBufferId vs. uint32 on native)

* glow impls share prerender innards

* coalesce vertex/buffer types

* minimize diff

* clarify module naming
2020-08-20 15:58:51 -07:00
Dustin Carlino
3a10416e26 Organize map edits code a little 2020-08-20 15:34:15 -07:00
Dustin Carlino
14c66c5528 A humble start to a Percent type for #274. There are so many places to
use it; just start a few in ezgui. Also a good time to object to the API
so far.
2020-08-20 11:01:59 -07:00
Dustin Carlino
2c5bbd3e7e Use alternate language building names and amenities, when available. Fixes #271.
Tested in Shinjuku. No substantial file size increase for any maps.
2020-08-20 10:39:28 -07:00
Dustin Carlino
bd35260b0a updater was missing xian 2020-08-20 08:22:13 -07:00
Michael Kirk
3e8d2d7daa glow: fix memory leak of old vertex data 2020-08-20 08:19:51 -07:00
Michael Kirk
7856671ac6 Fix glow backend on mac
Without this change, the screen was blank when using the glow backend on macos.

Some debugging traced it down to the shader attribute configuration.
@dabreegster suggested trying to declare a newer version of the shader
language which supports the syntax for explicit attribute layout, which
fixed it.

Specifically, before this commit, this diff was interesting on macos:

diff --git a/ezgui/src/backend_glow.rs b/ezgui/src/backend_glow.rs
index 2046bccd..f834a4fa 100644
--- a/ezgui/src/backend_glow.rs
+++ b/ezgui/src/backend_glow.rs
@@ -244,31 +244,7 @@ impl PrerenderInnards {
                 glow::FLOAT,
                 false,
                 stride,
-                // WTF: this offset seems correct, but on macos (OpenGL 4.1)
-                // a blank screen is rendered.
-                //
-                // To debug, I've hardcoded a color assignment in the fragment shader.
-                //
-                // What's fascinating is that, even if we don't use this second "style"
-                // input for anything, the mere act of passing it in with the expected
-                // offset causes all the geometries to not be visible.
-                //
-                // That is:
-                // - with a hardcoded color in the fragment shader
-                // - set offset `0` here (which is surely wrong?)
-                // - I can see the correct shapes with my hardcoded color
-                //
-                // - with a hardcoded color in the fragment shader
-                // - set offset `2*size_of(f32)` here (which should be right)
-                // - I'd expect to see the correct shapes with my hardcoded color
-                // - But instead I can no longer see any shapes on the screen
-                //
-                // So it seems like something about setting the offset on this second attribute
-                // configuration is corrupting our vertex data, even if we never read from that
-                // attribute data.
-                //
-                // 2 * std::mem::size_of::<f32>() as i32,
-                0
+                2 * std::mem::size_of::<f32>() as i32,
             );
2020-08-19 18:54:25 -07:00
Dustin Carlino
f31c4ec7fb New tool to union two scenarios. One use case is manually defining some
new trips, then seeing the impact they'll have on the normal weekday
scenario. So how much externality would be caused by a bunch of new
trips if some building is built?

Demo showing the whole flow: https://youtu.be/adpED0KGQ7Q. Why do those
few trips at the beginning impact some later trips so much? Who knows.
Likely parking spots get gobbled up.
2020-08-19 17:49:39 -07:00
Dustin Carlino
24a8d4a836 Prepare to support capping the number of vehicles that can pass through
a zone per hour. This is part of support for some kind of congestion
charging experiments. This step just rearranges the data to define the
cap and makes a UI to edit it. Not enforcing the cap yet.
2020-08-19 17:46:40 -07:00
Dustin Carlino
2ebf463635 Handle buildings tagged as parking garages in OSM. 2020-08-19 17:19:54 -07:00
Dustin Carlino
d427893843 Model parking lots with extra un-renderable spots. This fixes #150, lots
without aisles, and #265, multi-story garages.
2020-08-19 17:19:54 -07:00
Dustin Carlino
71ab485022 Attempt curved road labels for #173. Two issues left before enabling it:
- Need to draw a background underneath the curved text
- Sometimes the text is "upside-down" relative to what's expected; we
  should be able to reverse the polyline sometimes to deal with that. But
  when?
2020-08-19 13:43:36 -07:00
Dustin Carlino
7cbc0fd95c Make a tool to dump the map in JSON. 2020-08-19 12:49:30 -07:00
Dustin Carlino
8f258b33a6 Add dev-mode buttons to open OSM objects for buildings and parking lots too. Noticed they were missing while working on #271 2020-08-19 11:43:27 -07:00
Dustin Carlino
8c732feffb Build and publish cargo docs too
First try, real try...
2020-08-19 11:33:00 -07:00