Commit Graph

2468 Commits

Author SHA1 Message Date
Dustin Carlino
4227371bbe Rewrite the GMNS signal movement snapping algorithm. Instead of
independently picking the best match for "from" and "to", it considers
all vehicle movements, and minimizes "turn_type_cost * (from_cost +
to_cost)", using a hint about turn type to correct for geometry
mismatches at consolidated intersections. #626

Gets better results in Tempe at University and Mill, at least.
2021-05-28 14:55:53 -07:00
Dustin Carlino
5aa00955f9 Clean up the timer.parallelize API, getting rid of the weird enum to
toggle how many CPUs to thrash. We always use all of them, except for
one case, where a separately named method is more clear. Also make that
variation use all but 1 CPU, instead of just half.
2021-05-27 17:47:22 -07:00
Dustin Carlino
53430319b1 Filter out trips between the same place. Regenerate all Britain background scenarios. Fixes #664 2021-05-27 07:57:25 -07:00
Dustin Carlino
455399b90e Collapse degenerate intersections between cycle+footpaths. At various
times in the past, I've also tried doing this for other roads, but wound
up reverting for reasons only git remembers. But it seems like an
obvious win for bike paths; especially around Seattle, the ways are
split because of all of this raised curb data we're ignoring anyway.

Tested manually around Montlake.

Finally regenerating all data... Only Phinney breaks. One for tomorrow.
2021-05-26 22:27:29 -07:00
Dustin Carlino
3a68e5677f Allow all vehicles to use bus-only lanes that also happen to be turn lanes. #555
There are some caveats with the implementation commented inside.
Verified manually in Montlake -- down to just 122 cancelled turns!

Still not regenerating...
2021-05-26 19:13:14 -07:00
Dustin Carlino
e4a95b604e Fix Rainier Valley gridlock, fallout from #664.
https://www.openstreetmap.org/changeset/105381427 mapping a turn lane is
the fix, preventing crazy U-turns using the service road. Not sure how I
missed that lane when looking here before. I made the edit to .osm
locally instead of grabbing fresh data for all of Seattle.
2021-05-26 15:02:20 -07:00
Dustin Carlino
9fc79b1089 Use explicit start/endpoints for trips in scenarios. This is necessary
for people that leave one border, then re-enter a different one. #664

Alternative considered: insert a dummy remote trip between the two
borders. We used to do something like this at non-trivial code
complexity expense and having to explain the trip in the UI.

Regenerated all scenarios and prebaked data.

- Modest file size increase, as expected. Montlake scenario goes from
  1.3MB to 1.5, downtown from 37MB to 43MB, all Seattle scenarios from
  280MB to 327MB
- Eyeballed a few of the previously broken trips; they work now!
- Montlake goes from 3127 cancelled trips to just 302!
- No new gridlock, except in Rainier Valley -- disabling that for now
- I discovered missing validation in Poundbury for no-op trips between
  the same building. I'll filter those out and restore prebaked results
  there in a followup.
2021-05-26 14:30:01 -07:00
Dustin Carlino
3b375078b1 Prebake data until the simulation is done, not just until midnight. That
way, we have trip stats for people starting near the end of the day, and
we stop incorrectly showing failed trips when comparing.

Prebaked data: no change in size (245MB)
Montlake: 3135 "cancelled" trips -> 3127
Lakeslice: 6766 "cancelled" trips -> 6647
2021-05-26 10:22:09 -07:00
Dustin Carlino
c95a0b0f64 Handle another case for creating multiple left/right turns at an intersection. Use the new validation for connectivity at an intersection and give up on using OSM turn restrictions in some cases.
39 problems in Montlake down to 33, but regressions on some of the LCing unit tests...
2021-05-25 20:24:11 -07:00
Michael Kirk
93c56f4ded make clippy happy 2021-05-25 16:06:39 -07:00
Michael Kirk
cba8ba761b update drawn problems when switching before/after 2021-05-25 16:02:26 -07:00
Michael Kirk
11a49e7c55 Add "arterial crossing" risk for pedestrians.
Also:clarify "Complex" vs "Large" intersection, which is now ambiguous.
2021-05-25 16:02:26 -07:00
Dustin Carlino
2f71751929
Add support for tooltips on disabled buttons. Use this to explain a f… (#661)
* Add support for tooltips on disabled buttons. Use this to explain a few pecularities of the road editor UI.

* Consistent tooltip storage
2021-05-24 15:05:32 -07:00
Dustin Carlino
cc344af231 Add a file-picker UI to import JSON scenarios easily 2021-05-24 14:55:11 -07:00
Dustin Carlino
13bb434249 Highlight the lane card when hovering on the lane in the map. #597
[rebuild] [release]
2021-05-23 10:06:45 -07:00
Dustin Carlino
a6e707eb8a Upgrade more dependencies.
(Can't upgrade winit yet, because glutin doesn't have a crates.io
release that's caught up)
2021-05-22 16:36:57 -07:00
Vinzent Steinberg
a1899e29f8
Update dependencies (#656)
* Update dependencies

* Use github for polylabel, to make all dependencies use geo 0.18, not a mix of 0.18 and 0.17

* Downgrade lyon to avoid a crash

Co-authored-by: Dustin Carlino <dabreegster@gmail.com>
2021-05-22 16:23:06 -07:00
Dustin Carlino
d85cd7f797 Per feedback in #659, change the road editor to automatically compress
edits to a road before entering the zone editor. Users can use edit
mode's undo if they made a mistake. It's more fluid than prompting.

Use the same auto-compress flow to allow switching to different roads,
without leaving the road editor
2021-05-22 16:02:03 -07:00
Dustin Carlino
541c82a601 Add missing icon for shared left turns, preventing a crash 2021-05-21 14:34:04 -07:00
Dustin Carlino
d7d45b9052 Enforce parking lanes requiring a driving lane; the simulation crashes otherwise. #597
The enforcement is a bit more invasive, because there's a few ways of
getting into a bad state.
2021-05-21 14:34:04 -07:00
Dustin Carlino
644935114d Enforce max 2 sidewalks and max 2 parking lanes per road. It was working
for adding new lanes, but not changing existing lanes. #597
2021-05-21 14:34:04 -07:00
Dustin Carlino
256d280f50 Delete the old lane editor. Jump straight into the new road editor, focused on a particular lane. #597 2021-05-21 14:34:04 -07:00
Dustin Carlino
548acc1024 Add access restrictions button to new road editor. #597
The design in Figma treats it like a dropdown, but I think we still need
the dedicated UI to draw the bounds of the access-restricted zone.
2021-05-21 14:34:04 -07:00
Dustin Carlino
a5ae881be5 Start to dismantle the old lane editor by moving the old bulk road
selector into debug mode. #597

Previously, it was used both to search/replace lane types and to
select roads, then dump them in various formats. Just preserve the
latter behavior.
2021-05-21 14:34:04 -07:00
Dustin Carlino
ef90721741 Fix missing study area polygons on the web. The refactor to Polygon::from_geojson_file introduced filesystem IO to the geom crate. Instead, we need to be explicit about how we do file IO.
Also fix some clippy errors
2021-05-20 14:33:04 -07:00
Dustin Carlino
922ec40a61 UX fixes for the multi-road editor:
- Disable the 'edit multiple' button if the current road hasn't been
  changed yet
- Start with no other roads selected
- Add a "select all" and "select none" button
- Show the count of segments in the panel
2021-05-19 10:26:54 -07:00
Dustin Carlino
289475d894 Simplify multiple road editor:
- only handle roads with the same name
- use different colors for the 3 states
2021-05-19 10:26:54 -07:00
Dustin Carlino
a528409233 Create a UI to apply edits from one road to others with matching configurations. #597 2021-05-19 10:26:54 -07:00
Dustin Carlino
28afbe1224 Add hotkeys for lane types in the new road editor, but only for modifying an existing lane. 2021-05-19 10:26:54 -07:00
Dustin Carlino
11df7f79c7 In the travel times dash, retain the scroll state when toggling filters 2021-05-17 18:19:06 -07:00
Michael Kirk
94501e4699 size horizontal-divider WRT its parent size, not absolute window size 2021-05-17 18:19:06 -07:00
Michael Kirk
4e8136d4ff delay chart on "travel times" 2021-05-17 18:19:06 -07:00
Dustin Carlino
1e3ed254a9 Reorganize canvas settings, so that they can actually be saved. #216 2021-05-17 13:12:45 -07:00
Dustin Carlino
1fe60eb8bb Automatically save/restore user settings. #216
On a best-effort basis, of course. If the format changes, just start
fresh.
2021-05-17 10:34:13 -07:00
Dustin Carlino
d33a88281f Handle fixed column names in timing.csv. #626 [rebuild] [release] 2021-05-16 11:12:39 -07:00
Dustin Carlino
ca400ae61b Add a file picker for GMNS timing.csv. #626 2021-05-16 11:03:05 -07:00
Dustin Carlino
d6539f7449 Refactor file picker 2021-05-16 10:51:03 -07:00
Dustin Carlino
72d0e53fdc Make ChooseSomething take a FnOnce callback, so we can avoid cloning at a few call-sites 2021-05-16 08:41:37 -07:00
Dustin Carlino
7a262fb25f Set the gameplay mode correctly when loading from a savestate, so that prebaked results actually are loaded correctly 2021-05-15 17:11:31 -07:00
Dustin Carlino
27da792df6 cargo fmt 2021-05-15 16:28:50 -07:00
Vinzent Steinberg
ac62dde925 Prefer turbofish over temporary binding when collecting 2021-05-15 14:24:08 -07:00
Vinzent Steinberg
9d17faa878 Prefer slices over reference to owned type 2021-05-15 14:24:08 -07:00
Dustin Carlino
7767da39b9 Add fire icon to tutorial 2021-05-15 14:00:55 -07:00
Dustin Carlino
913f7b770f Load prebaked results when restoring a savestate from the command line 2021-05-15 09:19:41 -07:00
Dustin Carlino
1edbca6509
Refactor most of the places extracting polygons from geojson files (#644) 2021-05-15 09:05:28 -07:00
Vinzent Steinberg
446a21696d
Fix most clippy warnings (#646)
* More conventional spelling of acronym identifiers

* `new` -> `new_state`

* Remove redundant field name

* Remove needless `collect`

* `to_controls` -> `make_controls`

* Simplify long if statement

* Fix module inception

* Simplify chained if let

* Return directly instead of creating a binding

* Disable clippy warning about `borrow` method

Implementing the `Borrow` trait instead would result in excessive type
annotations.

* Fix most remaining clippy warnings

* Allow clippy::type_complexity

* Fix bad merge from web editor

* Run cargo fmt

* Suppress large_enum_variant warnings

* Rename FYI state to ShowMessage

* Fix upper_case_acronyms warnings

Co-authored-by: Dustin Carlino <dabreegster@gmail.com>
2021-05-14 17:31:32 -07:00
Michael Kirk
9fc2505df8
touch up "travel times" screen (formerly "trip summaries") (#645)
* touch-up scatter plot

* Bespoke bucket durations for faster/slower, rename duration summaries

* codify secondary text color per theme

* clarify axis labels apply to bar boundaries

* address clippy
2021-05-14 16:19:00 -07:00
Dustin Carlino
29c881ffc3 Switch from cargo +nighty fmt to the stable cargo fmt. Whatever edge-case formatting was happening with stable has been fixed 2021-05-14 08:39:51 -07:00
Dustin Carlino
efd10ac9b0 Fix build errors not caught by merge conflicts from #642 2021-05-14 08:37:46 -07:00
Vinzent Steinberg
fd3b0e2a14
Fix compilation failures and most clippy warnings (#642)
* abstutil: Fix compilation failure

* map_gui: Fix compilation

* traffic_signal_data: Fix compilation failure

* map_model: Fix compilation failure

* abstutil: Fix doctests

* abstio: Fix most clippy warnings

* abstutil: Fix most clippy warnings

* collisions: Fix clippy warning

* convert_osm: Fix clippy warnings

* sim: Fix most clippy warnings

* geom: Fix clippy warnings

* kml: Fix clippy warnings

* map_model: Fix most clippy warnings

* fifteen_min: Fix clippy warnings

* game: Fix many clippy warnings

* Disable some noisy clippy warnings

* headless: Fix clippy warnings

* importer: Fix clippy warnings

* map_editor: Fix clippy warnings

* map_gui: Fix clippy warnings

* osm_viewer: Fix clippy warnings

* parking_mapper: Fix most clippy warnings

* popdat: Fix clippy warnings

* santa: Fix clippy warnings

* sumo: Fix clippy warnings

* traffic_seitan: Fix clippy warning

* updater: Fix clippy warnings

* widgetry: Fix clippy warnings

* tests: Fix some clippy warnings

* Fix compilation on stable Rust

* Simplify unwrapping

* Make use of `Entry` more readable

* Fix formatting

* Fix code that was broken in the refactoring

* Apply cargo +stable fmt

* Fix code that was broken in the refactoring, second try

* Remove `Default` impls that are equivalent to `new`

* Remove obsolete clippy wrapper

* Avoid turbofish

* Prefer `unwrap_or_else` over allowing `clippy::or_fun_call`

* Remove redundant `into_iter`

* Fix typo

* Prefer `&& false` over commenting code out

* Fix some clippy warnings

Co-authored-by: Dustin Carlino <dabreegster@gmail.com>
2021-05-14 08:32:56 -07:00