Commit Graph

1479 Commits

Author SHA1 Message Date
Dustin Carlino
57feeada59 Allow vehicles to exit driveways onto the opposite side of the road. #555
- Adding an internal alt_start to PathRequest
- Using it for contraction hierarchy queries only (the Dijkstra
  implementation now diverges!)
- Figuring out which start position was used

TODO:

- Fix the unparking position
- Make sure the simulation inserts static blockages
- Carefully check the same start/end road case
- Evaluate impact on gridlock / cancelled trips
2021-07-04 14:34:20 -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
f57278e9cd Enable the new walking turn algorithm for consolidated intersections
only. It has much simpler logic and produces correct results for these
intersections, but it has degradations in some cases -- so limit where
we use it.

But in the meantime, this makes realistic crosswalks over Aurora,
fixing crazy walking detours there.

Not regenerating yet.
2021-06-24 12:41:38 -07:00
Dustin Carlino
190ee4b08f Fix the path v2->v1 and opportunistic lane-changing costs to heavily penalize cars from using bus lanes.
This doesn't avoid the aforementioned lane-changing crash, but by manual
inspection, it's keeping cars out of bus lanes.
2021-06-22 17:47:05 -07:00
Dustin Carlino
48076a4c5b Better stop sign placement -- degenerate roads shouldn't get them. Not
sure why this wasn't done before.

Regenerated all maps... but this happens to expose some lane-changing crashes.
2021-06-22 17:05:18 -07:00
Dustin Carlino
e08ddba241 Bring in fresh Seattle OSM data with the new cycletrack mapped around
Green Lake, and fix some missing support for bidi cycletracks.
2021-06-22 08:31:16 -07:00
Dustin Carlino
ae3d4e2363 Fix loading edits that change the number of lanes in a road. We need to compare the old version of the road in the edits with the basemap, NOT the edited version of the road. #597 2021-06-20 10:06:38 -07:00
Dustin Carlino
1e43d929e5 Implement dynamic lane-changing in a simple way:
- only triggered when a vehicle becomes Queued
- Only one adjacent lane, no contraflow (crossing the road's center
  line)
- Don't return to the original lane after passing
- Using a static blockage in the old lane (so other vehicles will wait
  too much)
- Only using the new lane to determine position (so visually a car will
  clip a bike as they pass)

Haven't regenerated prebaked data. #382
2021-06-19 12:35:19 -07:00
Dustin Carlino
0bcf01fd05 Avoid crashing in recalculate_intersection_polygon due to polylines not
containing some points. Happens at i524 in Arboretum and in the West
Seattle proposal.

I don't understand yet why this is possible in the first place, but
crashing is pretty bad in the meantime.
2021-06-19 11:29:01 -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
cbce654800 Prepare to have vehicles exiting driveways block any intermediate lanes. #555
This is just wiring together all of the state transitions. Haven't
decided how to internally implement this in Queue yet.
2021-06-16 16:02:17 -07:00
Rémi Lauzier
dd050ea425 Update some dependency 2021-06-16 15:51:03 -07:00
Dustin Carlino
321e7cd0ee Allow exiting a driveway onto any lane (in the same road direction). #555
- Support this at the pathfinding level, when transforming v2->v1
- Adjust how the vehicle's body is rendered as it exits a driveway onto
  a farther lane

No support yet for blocking any intermediate lanes; vehicles may clip
through each other without any conflict. Planning to add that
separately.

Regenerating all scenarios and prebaked data...
2021-06-16 15:46:09 -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
43d6ba80c5 Fix all_walking_costs_from by properly accounting for the distance between sidewalk endpoints and building paths. 2021-06-11 10:10:41 -07:00
Trevor Nederlof
4e150dcab0
Generalized connectivity to use Spot and added BorderIsochrone (#668) 2021-06-11 10:06:53 -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
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
5127a82b54 Import Tehran 2021-06-01 10:19:06 -07:00
Dustin Carlino
d014098f59 Fix an extremely naive implementation of calculating average angle,
which was causing bizarre turn lane arrows in Tempe.
2021-06-01 09:52:40 -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
cf6b2f6db7 Rewrite the heuristics for stop signs. Similar to traffic signals, only
count incoming roads when figuring out if an intersection is degenerate.
Also make link roads (on/off ramps) lower priority than the main part of
the road.

Regenerated everything.

(and fixing up the cloud scripts)
2021-05-27 15:37:46 -07:00
Dustin Carlino
8ceaf296eb Allow u-turns at merged intersections when the turn lane is explicitly tagged in OSM. This makes the infamous U-turn from Montlake to 520 WB work! The inferred signal timing isn't great, but ah well.
Not regenerating yet
2021-05-27 10:09:22 -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
6f0e01c511 Fix a critical bug with pathfinding v2: when calculating allowed
movements, make sure that a vehicle can access BOTH the source and
destination lane of a turn. #555

Without this fix, a turn from a bus lane to a driving lane is allowed
for cars at the pathfinding v2 level, but then it fails when converting
into v1 lanes.

(Next step: actually allow this for combination bus/turn lanes)

Not regenerating data yet
2021-05-26 15:39:34 -07:00
Dustin Carlino
4bd79cabbf Upload regenerated map data and address turn restriction PR feedback 2021-05-25 20:24:11 -07:00
Dustin Carlino
2dd611fd73 Refine the connectivity check for bus and bike lanes
Down to 12 connectivity problems in Montlake! Now that the dust has
settled, manually check the 3 unit tests and confirm the goldenfile
diffs.
2021-05-25 20:24:11 -07:00
Dustin Carlino
7af86a9e59 Interpreting turn:lanes tagging more carefully.
And fix an absolutely infurriatingly bad typo from the previous commit.

Now both the multiple_left_turn_lanes and divided_highway_split test
maps look great!
2021-05-25 20:24:11 -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
Dustin Carlino
62af2fef8c Introduce a new method to check for connectivity problems between vehicle lanes at an intersection, and start tracking the number of problems across a map. 2021-05-25 20:24:11 -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
dc5a484c4c Clean up the old special case for editing just a single lane type. Now, every modification to a road will touch LaneIDs. #597
This is safe to do, now that the two callers (the old lane editor, and
the old bulk lane type switcher) are gone.
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
70d6bf52d2 Fix the "growing intersection" bug that happens when repeatedly using
the new road editor, by "untrimming" the road center points. Fixes #655
2021-05-19 22:24:44 -07:00
Dustin Carlino
a38228d5da Codify some different strategies for merging short roads 2021-05-18 16:03:57 -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
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
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
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
Dustin Carlino
1bcbe057f0 Use more realistic lane widths during importing. #597 2021-05-10 20:10:23 -07:00
Dustin Carlino
4d3234ea14 Plumb a flag through the importer to try to consolidate all intersections in a map 2021-05-08 11:34:16 -07:00
Dustin Carlino
8c09f33761 Also implement multi-source Dijkstra's for vehicles. Had to give up on petgraph. 2021-05-06 10:48:32 -07:00
Dustin Carlino
8d6a184a1f Speed up the 'find perfect home' tool by starting Dijkstra's floodfill with multiple sources. Only implemented for walking right now. 2021-05-06 10:48:32 -07:00
Dustin Carlino
b29a613b42 Use strum macro to implement AmenityType::all 2021-05-06 08:50:29 -07:00