Commit Graph

2700 Commits

Author SHA1 Message Date
Dustin Carlino
68daa6884a Phinney and Wallingfjord don't gridlock right now, so opt them back into prebaked results 2021-07-18 22:58:22 -07:00
Dustin Carlino
9b40186c9c Avoid crashing when editing a stop sign near a tiny road. #707 [rebuild] [release] 2021-07-18 14:20:24 -07:00
Dustin Carlino
98978fa600 Remember which dashboard was open, and return to it when pressing 'more
data.' This makes it slightly less jarring to click on a specific trip
in a table or matrix, then return to the dashboard. Future work will
also remember filters/pagination of individual tables, maybe! (Since the
dashboards change over time, this might be weird.)

This also required adding a proper way to pick the dashboard from two of
the full-screen map dashboards. Otherwise, somebody would pick them and
get stuck!
2021-07-18 14:14:19 -07:00
Dustin Carlino
f6a94e8a58 Allow DrawWithTooltip to return custom data instead of string labels.
CloneableAny revived from e35c69f6f3
2021-07-18 14:14:19 -07:00
Dustin Carlino
ceff520ff4 Use the unedited map for elevation when viewing before edits. Fixes a crash when turns don't exist. 2021-07-18 14:14:19 -07:00
Dustin Carlino
2354ffa59d Don't make cells with 0 entries clickable 2021-07-18 14:14:19 -07:00
Dustin Carlino
942f2292fc Steps towards clicking cells in the problem matrix to explore trips with differences. #600
- Add optional clickable labels to DrawWithTooltips
- Wire up problem_matrix to remember the list of trips associated with
  each cell
- When clicking a cell, just open one arbitrary example trip
2021-07-18 14:14:19 -07:00
Dustin Carlino
d142b4fbd0 Refactor lots of the places walking along a PolyLine with a step size
Verified no behavioral change using the screenshot test. (Which only had
the driveway diff from b3ce53aa5f)
2021-07-16 14:17:08 -07:00
Dustin Carlino
9828006bcc Avoid a crash when editing very short roads. #703 2021-07-16 12:53:37 -07:00
Dustin Carlino
16f7796c68 Comparing paths before/after edits requires the unedited map.
Previously, this was done through an incredibly complicated dance of
loading the map file again when needed. This was slow (especially on
web!), made the InfoPanel API have a bizarre edge case, and even had
some way of crashing if you open a trip panel in some situation.

Rip all that nonsense out. The unedited map can just be cloned before
applying the first edit.
2021-07-15 23:01:35 -07:00
Dustin Carlino
ff310af3d1 Consistently follow rules for whether a lane can be edited. #597
Allow sidewalks, shoulders, and center turn lanes to be edited now.
Still don't touch service roads or light rail.
2021-07-15 18:21:49 -07:00
Dustin Carlino
b3ce53aa5f Draw building driveways per zoomed-in road, rather than as one map-wide batch. Otherwise, every single edit to road width needs to redraw all driveways. This doesn't scale with larger maps!
When zoomed in on just a building but not its road, this means the driveway won't show up until the road is in view. Acceptable trade-off.
2021-07-15 18:05:04 -07:00
Dustin Carlino
10fdaa8e92 estimate_duration already knows the mode, from the PathRequest 2021-07-14 12:38:19 -07:00
Dustin Carlino
9c3fe9e229 Add filters to the mode shift table. #448 2021-07-14 12:31:54 -07:00
Dustin Carlino
03d21c4fe9 A first mode-shift experiment: create a table of trips showing expected
time to drive/bike, the elevation profile, and the distance. #448
2021-07-14 12:17:03 -07:00
Dustin Carlino
149df630d4 Fix web build -- have to WASM-guard the debug tool that calls the importer 2021-07-13 23:00:45 -07:00
Dustin Carlino
38be4c0f68 Fixing small style/clippy problems and kicking off a [rebuild] [release] 2021-07-13 22:52:56 -07:00
Michael Kirk
7bf3f03251 add y-axis to aggregate duration table 2021-07-13 22:51:18 -07:00
Michael Kirk
43a3f2cdc2 round duration strings to largest unit 2021-07-13 22:51:18 -07:00
Dustin Carlino
14a0e005c8 Make sliders trigger Outcome::Changed, except for scrollbars. Manually
verified this doesn't break or slow down existing uses of sliders.
2021-07-13 12:36:54 -07:00
Dustin Carlino
e20ce2d041 While modifying a scenario, show how many trips match the filter.
(Except not updating the filter when changing sliders yet...)
2021-07-13 10:44:20 -07:00
Dustin Carlino
3d5955c2b6 Hardcode infinite parking option for a few maps. #688
This is an interim option until we decide whether this setting belongs
on the map, the scenario, or something else.
2021-07-13 09:03:07 -07:00
Dustin Carlino
aa5baa57de Get less confused when switching back&forth between two debugged maps 2021-07-11 15:21:59 -07:00
Dustin Carlino
e750048141 Improve intersection merging workflow by hiding popup msg for successful imports #654 2021-07-11 13:41:29 -07:00
Dustin Carlino
2224dccda9 Add a tool in the main UI to try to merge junctions. #654
It maintains a JSON file of ways to merge that the importer also uses.
For maps fast to import, this is the nicest workflow. Unlike map_editor,
turns and trimmed roads can also be checked.
2021-07-11 13:19:00 -07:00
Dustin Carlino
2d16f5d878 Get the crazy pathfinding revamp to work
- initialization order
- reusing node ordering and applying edits

Importing, editing the map, and the basic scenario seem OK! --skip_ch
breaks, because of the lack of serialization
2021-07-10 17:14:10 -07:00
Dustin Carlino
da704b4546 Extend the parking thought bubbles to handle people climbing steep hills.
(And some clippy fixes)
2021-07-10 17:14:10 -07:00
Dustin Carlino
184593094e Also round up the X axis for the elevation plot, and lower the number of
line plot labels by default
2021-07-09 09:23:56 -07:00
Dustin Carlino
2fad01d729 Use a fixed maximum for the Y scale of the elevation profile, based on a
map's max height. This helps compare elevation profiles before/after map
edits.
2021-07-09 09:23:56 -07:00
Dustin Carlino
c5113b868c Let one vehicle attempt to lane-change around another vehicle on every
lane that they're stuck behind them. Only record a risk exposure event
the first time, but let passing happen anywhere. #382

Also add scenario name to PrebakeSummary, to disambiguate the Poundbury
results.
2021-07-07 21:20:06 -07:00
Dustin Carlino
fffd323cb4 Refactor the monstrosity that is App setup 2021-07-07 11:26:55 -07:00
Dustin Carlino
2d1368fe13 Revive some form of the ancient A/B test mode, where two maps can be swapped quickly. Using this for more rapidly testing intersection consolidation algorithms. #654 2021-07-07 10:14:48 -07:00
Dustin Carlino
ed59a8a386 Reimport all actdev scenarios, and restore Poundbury prebaked data. This was temporarily broken by a JSON format change (a-b-street/abstr#29) 2021-07-06 15:29:51 -07:00
Dustin Carlino
964cc23df8 Improve 3-way signal timing by explicitly specifying crosswalks. This
fixes a very dramatic problem in the Green Lake map.

Regenerating everything...

Also added total trip time to the prebaked summary, to get a quick sense
if a change net helps or hurts and have a record in version control.
2021-07-06 14:37:50 -07:00
Dustin Carlino
fe49a093e6 Add a revert button to the road editor. #597 2021-07-06 13:00:11 -07:00
Dustin Carlino
3a53380c46 Don't block after launching JSON viewer. Often I want to find an ID in
the JSON somewhere, then warp to it.
2021-07-06 11:49:44 -07:00
Dustin Carlino
3db4c827b8 Draw building outlines in unzoomed view also. It's a subtle effect, but important in dense areas like Sao Paulo. 2021-07-06 09:53:13 -07:00
Dustin Carlino
f37e71236f Some fixups to the regenerated data from the past two commits:
- handle when the equiv_pos of a driveway gets too close to the edge of
  another lane
- make the updater workflow handle files from S3 that're a bit older
- remove pathfinding_avoiding_roads
- strip out old vehicle capping from map edit JSON, then fix up
  proposals
- delete old capping API example
- temporarily give up on phinney; it starts gridlocking
- add broadmoor proposal link in-game
2021-07-05 17:51:40 -07:00
Dustin Carlino
a0dcc255c3 Rip out all congestion capping code. #325
This collaboration is abandoned, the code slows down refactoring, and
if we started this idea again today, it'd be better to do it from
scratch anyway.

Regenerating everything.
2021-07-05 11:15:31 -07:00
Dustin Carlino
bae86bf885 Add a debug tool to visualize equiv_pos, before trying to improve this for curvy roads. 2021-07-05 10:16:39 -07:00
Dustin Carlino
6039063d28 Add a debug tool to dump JSON for different objects and open up with an external viewer. [rebuild] [release]
And fix some clippy problems
2021-07-04 15:32:49 -07:00
Dustin Carlino
95ffa62218 Fix the unparking position. When we exit a driveway in EITHER direction,
we need to adjust the start position to account for the vehicle's
length.

Also add a very convenient debug tool to understand positions along
lanes.

This probably breaks static blockages; I'll check into that next.
2021-07-04 14:34:20 -07:00
Dustin Carlino
bf316fa99c Fix a crash in the trip info panel. If you happen to open a trip of a
car waiting to spawn, its total path distance is briefly 0.

Also silence the lane-changing info for the moment, until work resumes
there.
2021-07-03 08:28:16 -07:00
Dustin Carlino
160d65ca28 Try loading a built-in proposal with --edits, if player data is missing. 2021-07-02 13:14:08 -07:00
Dustin Carlino
6c1c6a3235 Fix crash when changing speed limit. At some point, we started changing lane IDs for every road edit and never updated this. Closes #685 2021-07-02 11:54:59 -07:00
Dustin Carlino
4fd86c8a41 Entering edit mode is slow on large maps, because clearing the simulation recreates parking state for every building. Parallelize it to speed it up at least a bit. 2021-07-02 11:47:05 -07:00
Dustin Carlino
866ecd5f88 Fix a bug in efaf6085e4 that was using walking paths for vehicles. Now prebaked data doesn't budge.
And add some more timing to demonstrate why editing a single lane in a
huge map is so slow...
2021-07-02 11:25:02 -07:00
Dustin Carlino
f4c8a508da Keep a JSON file with a summary of prebaked simulations, to more easily detect regressions with broken trips. 2021-07-02 10:07:37 -07:00
Dustin Carlino
4f00c8d2bb Phinney runs without gridlock again, so re-enable it. Pretty sure
f57278e9cd fixed it.
2021-06-30 16:51:03 -07:00
Dustin Carlino
efaf6085e4 Prepare for exiting driveways on the off-side by switching to
specialized PathRequest constructors
2021-06-30 12:35:22 -07:00
Dustin Carlino
137e9a0c2c Fix up some places affected by the f64 serialization:
- offstreet_parking_length in importer config
- backwards compatibility for map edits
- fixing up the baked-in proposals
- working around a few PolyLine bugs that happen with the new rounding
- Don't regenerate actdev scenarios yet -- the upstream JSON format is
  out of date, will have to fix separately.
2021-06-30 06:35:42 -07:00
Dustin Carlino
44171500b7 Get the Green Lake map to complete without gridlock!!!
- Allow blocking the box around two complex intersections in Green Lake.
  This makes the vehicle behavior much more realistic there, by visual
  inspection.
- Amp up offstreet parking to 10 per building. I noticed the simulation
  completes easily with --infinite_parking. This is an approximation of
  that. We make really bad guesses about carpooling and the amount of
  parking available around here, so effectively just remove it from
  consideration for now.
2021-06-23 13:56:42 -07:00
Dustin Carlino
8c2b84c37c Keep the trip info panel open when the user clicks before/after and has to initially load the unedited map. #684 2021-06-23 12:52:18 -07:00
Dustin Carlino
9f22d4893a Fix a crash with time-warping to the past when the map is edited. See #684 for an explanation.
Verified working on native. It should also be fine on web -- loading the
unedited map has to be a whole separate state because of web IO in the
first place.
2021-06-23 10:29:10 -07:00
Michael Kirk
321c9d9c40 Label contingency matrix axes 2021-06-23 10:13:51 -07:00
Dustin Carlino
d8cdfaba05 Make the multi-road editor only check and edit lanes_ltr, not speed limit. The Aurora cycletrack edit stopped matching because the speed limit happens to change along Aurora. We can think through a better UX to handle both, but I suspect most use cases will focus on lane configuration. #597 2021-06-20 10:00:05 -07:00
Dustin Carlino
e6e6fb267d Reset current selection after editing multiple roads. This sometimes crashes if the selected lane gets deleted or assigned a new ID. Fixes a crash trying to make the West Green Lake cycletrack. #597 2021-06-20 09:50:33 -07:00
Dustin Carlino
8f199177f5 Upgrade to Rust 1.53
- arrays are now iterable directly
- switch to using BTree{Set,Map}::retain!
- a round of clippy
- regenerate scenarios and prebaked data; not sure why, but there's a
  diff
2021-06-17 23:04:35 -07:00
Rémi Lauzier
1a4b997818 Fix some clippy warnings 2021-06-16 16:21:35 -07:00
Dustin Carlino
d42c1310b0 CLI flag to start in the KML viewer for convenience 2021-06-16 11:14:17 -07:00
Dustin Carlino
01a2dfe215 Create a new panel to show how trips are distributed through the day.
Refactor some of the sliding window code along the way.
2021-06-14 17:32:18 -07:00
Dustin Carlino
d272b745f2 Add a simple Python script to run grid2demand. I need to produce a scenario for Tempe, and it's also useful for #608 2021-06-14 11:00:02 -07:00
Dustin Carlino
96aa09edd0 Small steps towards matching more GMNS signals: #626
- toss a loading screen around it
- allow jump to ID in edit mode
- break down failure types more
2021-06-13 11:59:37 -07:00
Dustin Carlino
59597708ec Draw polylines as arrows in the KML viewer; it's pretty much always useful to see the direction of the raw data 2021-06-13 11:32:02 -07:00
Dustin Carlino
500f14869f Le Fournil special: don't redraw KML text constantly; it was sluggish for signal timing. 2021-06-13 11:26:08 -07:00
Dustin Carlino
76aba75082 Update links to docs after some reorg in the other repo 2021-06-12 13:38:38 -07:00
Dustin Carlino
972f5b0187 Lower the priority of service roads when placing stop signs
Regenerate all data. Wallingford started gridlocking due to this change;
plowing ahead and will follow up and fix it.
2021-06-11 09:40:44 -07:00
Dustin Carlino
18ff0eefc0 Store Turns per Intersection, instead of a massive BTreeMap. #368
Minimal file size savings, but substantial runtime improvement!
2021-06-11 09:40:44 -07:00
Dustin Carlino
cabee219db Fix some crashing spinners; the rust compiler inferred the wrong numeric type. #674 2021-06-10 18:21:24 -07:00
Dustin Carlino
fc4f0a8c8e Some Tempe fixes:
- Stop importing rail in Tempe. Not simulating anything on it yet, and it complicates gridlock. #672
- Update the GMNS timing.csv import based on slight format change. #626
2021-06-09 16:35:46 -07:00
Dustin Carlino
d827673ace Periodically free memory in the middle of screenshot test, to avoid
running out on my current machine. Fixes #671.

Finally regenerate screenshots for the first time in ages... just
blindly accepting everything, because the slightly different screen size
means everything was slightly shifted down.
2021-06-09 14:31:40 -07:00
Dustin Carlino
889c500eb1 Force geojson to use geo-types feature everywhere. This lets different
binaries properly share workspace dependencies.

See
https://www.reddit.com/r/rust/comments/nvd6y7/common_crates_in_cargo_workspace_recompiled_due/
for the full story behind this mess.

I'm going to keep repeating this process until I get game and importer
to share dependencies again.
2021-06-09 09:48:53 -07:00
Dustin Carlino
a38125ad2c Adjust multi road editor more -- custom cursor icons for select/unselect 2021-06-03 15:23:55 -07:00
Dustin Carlino
8721c4f6d9 When the desktop version is old, have a button to go directly to the releases page to grab a new one 2021-06-03 09:14:17 -07:00
Dustin Carlino
bf2e4be2a2 Adjust road editor based on real live coffeeshop feedback:
- "x/y similar segments" to relate to explanatory text about lane
  configurations below
- "edit multiple" -> "apply to multiple", since you have to change the
  road first
- start with all candidates selected
2021-06-03 09:02:12 -07:00
Dustin Carlino
b1150c9524 Export raw CSV data about problems per trip, for a data analyst to explore possible dataviz in their more familiar tools 2021-06-02 19:23:48 -07:00
Dustin Carlino
c9e4f754e1 Fix a crash in the problem map layer, caused by checkboxes getting out of sync 2021-06-02 16:26:04 -07:00
Dustin Carlino
ef4ea01c71 Add a button to import all traffic signals map-wide from a timing.csv file, reporting the total number of successes and failures. #626 2021-06-02 12:18:24 -07:00
Dustin Carlino
d2ecab44a7 Be sure to validate signals before committing the results, since GMNS imports aren't validated upfront. #626 2021-06-02 11:40:54 -07:00
Dustin Carlino
cd66d7209e Automatically fill out crosswalks to the GMNS signal import. #626 2021-06-02 11:13:30 -07:00
Dustin Carlino
dc1ce15c30 Heavily penalize GMNS snapping if the bearing doesn't match the movement. #626
University/Mill looks great now.
2021-05-28 15:56:04 -07:00
Dustin Carlino
30a317cf94 Make the KML viewer be able to inspect multiple overlapping objects. Useful for GMNS timing.csv files. #626 2021-05-28 15:21:07 -07:00
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
Michael Kirk
0d758c74f1 Polish contingency matrix / risk screen
- better color contrast
- don't color neutral/no-change buckets
- show "-" rather than "0" for cells which have been filtered out
- bespoke, non-linear, bucket durations for x-axis
- less buckets for y-axis
- better copy for tooltips
- label axes
- show empty chart rather than no chart
- remove "delays" which aren't really risks
- clarify that risk visualizations are just for bikes for now
    - remove filter UI and only include bikes
2021-05-13 13:35:04 -07:00
Dustin Carlino
0ed933aa9c Create a contingency matrix showing how number of problems change per
trip duration. #600
2021-05-13 12:36:20 -07:00
Michael Kirk
cfbd58cdce shrink down jump-to menu w/ exact sizing 2021-05-12 17:39:19 -07:00
Michael Kirk
d185195bba toggle "draw" while warping rather than before
This is helpful if you forget to check the box, or if you want to take a
quick peak of what's going on in the map while warping without stopping
the warp.
2021-05-12 17:39:19 -07:00
Michael Kirk
ec82b728dc hotkeys for proposal navigation 2021-05-12 17:39:19 -07:00
Dustin Carlino
2c5e0dae03 Fix static trait object method warning that we're now hitting in Rust 1.52
The <dyn ...> syntax is gross, but I don't think there's a way to avoid
this without defining a differently named empty struct and putting the
static method on that
2021-05-11 12:31:58 -07:00
Dustin Carlino
1e5771897f Fix lakeslice gridlock; S Charles and Rainier has a tiny driveway causing low throughput due to cars not wanting to block the box 2021-05-11 10:55:01 -07:00
Dustin Carlino
5bac09bf2a Restore popdat.bin and Seattle scenarios and prebaked data. For whatever reason, the GDAL transformation is returning coordinates in a flipped order on my new machine.
Lakeslice prebaked disabled, because it starts gridlocking around 5pm.
I'll fix separately.
2021-05-11 09:34:40 -07:00
Dustin Carlino
1bcbe057f0 Use more realistic lane widths during importing. #597 2021-05-10 20:10:23 -07:00
Dustin Carlino
775b1fcfc4 GMNS through movements are always protected. #626 2021-05-08 11:05:49 -07:00
Dustin Carlino
cc007d0c6e Adjust the signal editor panel layout based on Figma mocks. Many issues
left, but this seems good enough to push forward for now. Can go
through a proper review next week.
2021-05-08 10:57:25 -07:00
Dustin Carlino
6e3040f5a2 Rewrite the snapping algorithm for the GMNS signal importer, based on the new example data. #626 2021-05-07 13:45:42 -07:00
Trevor Nederlof
4080d0d130
Add craft and office to import and add/reorg AmenityType (#638)
* Add craft and office to import and add/reorg AmenityType

* Remove bike rental/parking and rename BikeShop to Bike

* add in leisure and tourism tags, add more categories to AmenityType and remove lesser used tags

* add dependency on strum and strum_macros and removed some manual code for text display of Enum and Enum into string

* include lock file, fix color of buildings for amenity layer, fix formatting and use orders
2021-05-06 08:43:52 -07:00
Dustin Carlino
8826af31cb Make the CSV extra shapes parser handle WKT linestrings, so we can
visualize the GMNS signal timing data easily. #626

And fiddle with the KML viewer UI a bit to make it easier to inspect the
movement polylines.
2021-05-05 13:40:53 -07:00
Dustin Carlino
81f9ee5a1b Change the KML/external shapefile debug tool to use a real file picker 2021-05-05 11:09:56 -07:00
Dustin Carlino
8fa0f97d37 Highlight just the lane or the whole road, not both. #597 2021-05-05 08:26:41 -07:00
Dustin Carlino
488c9ffe68 Start to import GMNS timing.csv just based on line-strings. #626 2021-05-04 10:34:34 -07:00
Dustin Carlino
f400663b01 Better choices for lane width. #597 [rebuild] [release] 2021-05-02 09:11:21 -07:00
Trevor Nederlof
b430a3acc2
Add default behavior for driving, non driving and sidewalks (#634)
for #597
2021-04-30 14:35:13 -07:00
Dustin Carlino
d3c035ffb3 Remember the last map loaded, and start the game with that, unless using --dev or some other override 2021-04-30 12:36:24 -07:00
Dustin Carlino
03fade1aa7 Change the tooltip wording 2021-04-29 14:23:08 -07:00
Dustin Carlino
a11cd866c2 Add tooltips to the signal editor. 2021-04-29 14:23:08 -07:00
Dustin Carlino
5186957ce4
Store a generic type in the Spinner widget. (#631) 2021-04-29 11:35:22 -07:00
Dustin Carlino
8c5f603c39 Pick default scenarios better, and describe some of the UK scenarios in the picker.
And the tiny Widget::evenly_spaced_row refactor from the previous PR
2021-04-28 18:01:08 -07:00
Michael Kirk
4a18c64701
tweaks to get closer to the design (#630) 2021-04-28 17:59:23 -07:00
Dustin Carlino
7f2dafb489
Get closer to the Figma card style for road editor buttons. #597 (#627) 2021-04-28 17:39:21 -07:00
Dustin Carlino
71e559b6d5 Compress all of the road edits when we confirm, same as the signal editor. And add a cancel button. #597 2021-04-27 17:54:36 -07:00
Dustin Carlino
a4584f7427 Add new lanes more intelligently: #597
- Don't allow adding >2 parking lanes or sidewalks
- Set the initial position and direction based on the new lane type and
  existing confguration

Much more work needed here, but this is some progress.
2021-04-27 15:35:54 -07:00
Dustin Carlino
e917cb7772 Refactor internal panel management of road selector UI 2021-04-26 14:47:20 -07:00
Dustin Carlino
bba48ec654 For the new road editor, also select lanes on the map directly. #597 2021-04-26 14:41:08 -07:00
Dustin Carlino
36427d163c Fix the traffic signal challenge. It shouldn't reset the simulation after editing!
And fix up the score panel a bit
2021-04-26 10:49:15 -07:00
Dustin Carlino
97b41b9e19 Make the deploy_actdev script work again 2021-04-24 13:57:00 -07:00
Dustin Carlino
55127924ea Fix more junctions in Tempe, and opt it into the screenshot testing 2021-04-23 18:04:00 -07:00
Dustin Carlino
298d322054 Record the time of a problem, and add a filter for that in the layer. #600
Also change the dot map color to purple, start with the heatmap by
default, and add the count to the panel.

Regenerate prebaked data
2021-04-23 10:15:52 -07:00
Dustin Carlino
46f7d7e099 Add a layer to show where on the map problems are occurring, either individually or as a heatmap. #600 2021-04-23 10:15:52 -07:00
Dustin Carlino
bc591c1b5f Plumb back the widget name in Outcome::Changed 2021-04-22 13:09:32 -07:00
Dustin Carlino
babdc9e384 Let TextBox know its own name, and clean up the API for creating them 2021-04-22 13:09:32 -07:00
Dustin Carlino
ff039f017a Let Spinner know its own name 2021-04-22 13:09:32 -07:00
Michael Kirk
e8e678f4ca remove repeated choice from "speed". use nicer method 2021-04-22 10:43:09 -07:00
Dustin Carlino
8722c102b9 Fix bug moving lanes left/right where the width of different lanes
wasn't getting updated, due to the code-path handling the old case...
2021-04-22 10:22:06 -07:00
Dustin Carlino
2112736a1f Polish UI of new road editor 2021-04-22 07:57:23 -07:00
Dustin Carlino
e0871d9db2 Undo/redo in the new road editor 2021-04-22 07:57:23 -07:00
Dustin Carlino
8dbb1a47e5 Refactor how edits are applied inside the new road editor 2021-04-22 07:57:23 -07:00
Dustin Carlino
f781d3e74f Delete the temporary old road editor. I didn't expect the new editor to become usable so quickly.
And enable the new editor for everyone, with the experimental warning
2021-04-22 07:57:23 -07:00
Dustin Carlino
9aa5d97271 Select the newly created lane 2021-04-22 07:57:23 -07:00
Dustin Carlino
1fb1253e97 Refactor speed_limit_choices 2021-04-22 07:57:23 -07:00
Dustin Carlino
6cd869e494 Temporary way to move lanes left/right 2021-04-22 07:57:23 -07:00
Dustin Carlino
acfe095a3f Handle editing just the width of one lane 2021-04-22 07:57:23 -07:00
Dustin Carlino
c73ceebd35 MVP of Yuwen's new road editor! 2021-04-22 07:57:23 -07:00
Dustin Carlino
38f5da4f80 Make the native download progress screen show how many files are left. 2021-04-21 17:01:51 -07:00
Dustin Carlino
3b9a7cfa1f Add a basic per-file progress bar for native downloads! 2021-04-21 17:01:51 -07:00
Dustin Carlino
d644bf3b5f Debug tool to change color schemes without recompiling 2021-04-20 17:03:55 -07:00
Dustin Carlino
ee78644089 Download files before starting a challenge mode or Santa level, if needed 2021-04-20 16:10:17 -07:00
Dustin Carlino
7176994a87 Refactor CarID to be a struct, not a tuple
And regenerate prebaked data from a few commits ago
2021-04-19 15:16:48 -07:00
Dustin Carlino
bc2a21ca89 Refactor some methods in Traversable 2021-04-19 14:50:51 -07:00
Dustin Carlino
c62cf1c90c Refine the detection for when a car wants to over-take a bike, and expose it in the UI as a problem. #81, #600 2021-04-19 14:44:42 -07:00
Dustin Carlino
478a146350 Display a caution icon for large intersection crossings, and add tooltips for all drawn problems. #600 2021-04-19 11:40:39 -07:00
Dustin Carlino
6380bd74ec Refactor a concept of per-trip Problem. #600, #170
The simulation analytics tracks problems per trip. The previous
measurements for delay at intersections is one case, and the new
cyclist-crossing-large-interection event is another. I removed the lane
speed measurement, since it's kind of redundant with the delay.

Consolidated the reporting in the trip info panel / drawn on the route.
2021-04-19 11:40:39 -07:00
Dustin Carlino
6f5a7b980a Track when a pedestrian or bike crosses a large intersection. Start to
show it in individual trip info panels. #600
2021-04-19 11:40:39 -07:00
Dustin Carlino
31070ccadf Tutorial fixes after a UX study:
- Fix a typo
- Draw a star on the car that the player is supposed to follow
- Move the message panel to the left when pointing to the minimap and
  layers
- Add button icons to the message box to really emphasize what we're
  pointing to
2021-04-18 11:14:01 -07:00
Dustin Carlino
3a6b8f2919 Make the 'no sidewalks' layer understand how shared cycle+foot paths look right now. 2021-04-16 16:22:48 -07:00
Michael Kirk
bc3a121cd6 introduce --minimal_controls option for screen recordings 2021-04-15 19:22:37 -07:00
Dustin Carlino
d41482febd Fix running external tools on Windows [rebuild] [release] 2021-04-15 11:29:29 -07:00
Dustin Carlino
5bcd2a5526 Fix the grid2demand import, when repeatedly importing different files. 2021-04-15 08:58:21 -07:00
Dustin Carlino
179daa5d25 Clean up commented out code from #170. Going to re-evaluate how problems along a trip are shown in the UI anyway. 2021-04-14 17:25:58 -07:00
Dustin Carlino
79fdf01690 Remove the fade overlay from the tutorial. It makes some of the arrows pointing at stuff hard to see. If we just use it on message screens without an arrow, it looks odd to appear/disappear.
Also prep a mid-week [rebuild] [release]...
2021-04-14 13:05:54 -07:00
Dustin Carlino
4a06a7285b Change the grid2demand file picker to be async. #605 2021-04-14 09:54:04 -07:00
Dustin Carlino
1e94ba9b06 Update some tutorial wording from Yuwen's designs.
Internally, overhaul some of the crazy tutorial code to just use Text,
not Vec<String>.
2021-04-13 16:56:39 -07:00