Commit Graph

1383 Commits

Author SHA1 Message Date
Dustin Carlino
da60de0a09 Adjust walking speed for inclines, using Tobler's hiking function. #82
Now regenerating everything...
2021-04-02 19:54:33 -07:00
Dustin Carlino
acdbe0e753 Start adjusting cyclist speed for inclines, both in simulation and pathfinding, using calcultions from Valhalla. #82
Not regenerating data yet.
2021-04-02 19:54:33 -07:00
Dustin Carlino
20de91bae7 Also refactor walking speeds. #82 2021-04-01 15:03:20 -07:00
Dustin Carlino
892afddcd5 Refactor uses of biking speed between the sim and pathfinding, in preparation for incorporating incline. #82
(This was a bigger mess than I expected, so worth doing separately.)
2021-04-01 11:52:25 -07:00
Dustin Carlino
05c9134e92 Stop using contraction hierarchies for trains / light rail. The graph is
always tiny; Dijkstra's is fine. It costs a bit of file size to store
it. The huge leeds map goes from 160MB to 157MB -- not crazy savings,
but something.

Also fix a slight bug with 92d3a890ea that
caused some pedestrians to uselessly visit a bus stop node while
routing. (southbank crashes a few hours in otherwise)
2021-03-25 20:45:57 -07:00
Dustin Carlino
92d3a890ea
Express all pathfinding costs in units of seconds. #82, #494 (#587)
This is simpler to reason about, allows the penalty for entering a zone
or taking an unprotected turn to be expressed in terms of a time
penalty, and is a step towards adjusting bike/foot routing for elevation
data.

When we later add things like "safety/quietness" for cycling, maybe we
can switch to using a (time, quietness) tuple, and transform into a
single number with a linear combination parameterized by that agent's
preference for time/safety. This change is compatible with that future
idea.

There are behavior changes here, particularly for zones and unprotected
turns. No new maps start gridlocking, and in fact, Rainier starts
working again.
2021-03-25 12:59:36 -07:00
Dustin Carlino
4ef04f5bd1 Change road incline calculations to be stored in RawMap. Previously, the
"rise / run" calculation used the trimmed road center-lines, which don't
match up with the elevation at each original intersection point.

Also handle infinity in the output and reduce the resolution of the
query from every 1m to every 5m.

Regenerate all maps due to the map format change. Try bringing in
elevation data for all of Seattle using the LIDAR source, since
the data quality assessed in eldang/elevation_lookups#12 seems to be
similar, and LIDAR is way faster than contours.
2021-03-23 22:47:52 -07:00
Dustin Carlino
162f09a887 Import Tripoli for WeCode Libya, also adding an Arabic font 2021-03-23 06:51:47 -07:00
Dustin Carlino
4a704e3172 Filter out highway=pedestrian, bicycle=dismount unless separate footpaths are enabled. Removes Portugal Place from Cambridge. cyipt/actdev#151
Now regenerate everything
2021-03-22 21:30:10 -07:00
Dustin Carlino
e57cacaab4 Rename pathfind/driving -> pathfind/vehicles to reflect bikes using it too, and likewise for driving_cost 2021-03-22 16:34:46 -07:00
Dustin Carlino
7d2e8409e8 Implement no-through-traffic zones instead by adding a huge cost to crossing into the zones. #555, #574
Regenerate all maps. Gridlock-wise, Rainier and Poundbury broke, but
Wallingford started working again. Acceptable cost for a change this
useful; I'll work on fixing those maps later.
2021-03-22 16:34:46 -07:00
Dustin Carlino
e6cf2d54bc Rip out all of the special code for pathfinding into/out of access-restricted zones.
There's a much simpler implementation, it transpires. #555, #574
2021-03-22 16:34:46 -07:00
Dustin Carlino
75b39c7b35 Add a debug tool to show the pathfinding costs to each node. Trying to figure out why a new impl of pathing through zones isn't working as expected. 2021-03-22 12:03:50 -07:00
Dustin Carlino
9d2da632be Add some disabled validation that paths don't enter an access-restricted zone when they shouldn't.
I'm working on an overhaul to pathfinding and zones in another branch,
and need some more debugging tools. This one's ready to be checked in
now.
2021-03-22 09:38:53 -07:00
Dustin Carlino
a68af804e3 Pick the entrance/exit to an access-restricted zone more intelligently. #574
Instead of just picking the intersectin closest to the origin or
destination, calculate the full path length, and take the one with the
shortest distance. This fixes some of the weird problems routing around
Broadmoor. Regenerate all prebaked data.

Also fix the original request for paths involving zones, so tracing it
later works.
2021-03-19 19:24:22 -07:00
Dustin Carlino
a0461e990d Workaround an issue with how the length of roads is measured and related
to the elevation measured at the original intersection point. #82

Upload montlake, downtown, and phinney with elevation data, as an
initial demo.
2021-03-18 19:04:15 -07:00
Dustin Carlino
b61291d905 Revive the elevation layer in the UI. Add some sanity checking around the inclines we're assigning to roads, but also, I realized a problem with how the elevation lookup not matching the trimmed roads. #82 2021-03-18 18:19:41 -07:00
Dustin Carlino
95b1d884cf Rename Map::new to be more clear that it should only be used in non-UI
tools. There's one place in the UI that doesn't work on the web!
2021-03-12 06:38:17 -08:00
Dustin Carlino
c6044fa54c Fix the debugging of map serialization sizes; Map::new isn't called
anymore, because of async map loading.
2021-03-11 19:46:09 -08:00
Dustin Carlino
f0de4e4583 Don't use Bezier curves for right/left turns at tiny intersections. They
wind up looping back on themselves in a nonsensical way, causing
vehicles to visually glitch when moving through.

This was started in 081819d86b, but it
used to gridlock 2 maps. All the recent roundabout fixes seems to have
resolved those! And adjusting offstreet parking for two maps.

But wallingford does regress; plunging forward for now.
2021-03-10 15:58:16 -08:00
Dustin Carlino
7e0f29fa9f Place stop signs at the entrances of roundabouts, so people already in there get precedence over new people entering. #75
This makes Poundbury run with baseline traffic, when previously it was
super gridlocked!
2021-03-08 20:43:48 -08:00
Dustin Carlino
350b75a8e5 Don't crash when tracing a path where the first step and request don't match. This happened for the LCID site when clicking on a building and finding nearest parking, because the buildings are in an access-restricted zone. 2021-03-07 11:06:32 -08:00
Dustin Carlino
d5d186dd37 Fix border arrows for left-handed maps. 2021-03-06 10:43:58 -08:00
Dustin Carlino
081819d86b ATTEMPT: Don't use Bezier curves for right/left turns at tiny
intersections. They wind up looping back on themselves in a nonsensical
way, causing vehicles to visually glitch when moving through.

This causes lakeslice and rainier to gridlock, due to the magic of
emergent behavior. I think I upstreamed an OSM fix for lakeslice, but I
need to work on rainier before enabling this code.
2021-03-01 18:30:24 -08:00
Dustin Carlino
c5cfe76b05 Fix turn type classification for four-way intersections that meet at
weird angles. This leads to really bad traffic signal heuristics, even
causing gridlock in Rainier Valley.
2021-03-01 10:57:27 -08:00
Dustin Carlino
bce3318605 Import halsnead for actdev. It needed a fix to not treat access=private
as a no-through-traffic zone for light rail tracks!
2021-02-27 14:35:26 -08:00
Dustin Carlino
9984648379 Treat bicycle=designated on footways the same as bicycle=yes. And update Seattle OSM data again to pick up my fixes from yesterday. #330 2021-02-27 13:01:37 -08:00
Dustin Carlino
3a63c11303 Treat footways that allow bikes the same as the other shared-use trails. #330
This gets most of the Burke (and other trails) imported, though there
are still some lingering connectivity problems.
2021-02-26 17:23:21 -08:00
Dustin Carlino
603717a560 Remove the separate_cycleways experiment flag. Always import cyclepaths
mapped as separate OSM ways in all maps!!! #330
2021-02-26 14:58:57 -08:00
Dustin Carlino
601d367c32 Import highway=track as a separate cycle+footway. We identified https://www.openstreetmap.org/way/842138587 that really affects the Poundbury site. 2021-02-25 12:59:48 -08:00
Dustin Carlino
5577021ee5 When merging intersections and preserving simple turn restrictions, pay
attention to which intersection is being destroyed. Fixes #527 --
montlake and phinney both look correct now.

Regenerating everything. Actually, Phinney now runs, so adding a 4th
prebaked map!!! But Rainier regressed -- there's an issue with the
signal heuristics that's now a problem; I'll fix later.
2021-02-24 15:16:12 -08:00
Dustin Carlino
b36ebec0b9 Penalize unprotected left turns at the routing layer. #494
I experimented on the Rainier Valley map, which recently started
gridlocking due to too many cars doing this, to tune the value. Got it
running again! The two other maps keep running, with some trips on
average getting a little slower.
2021-02-23 19:32:00 -08:00
Dustin Carlino
03989bf3a6 Don't allow u-turns on really short deadends. This problem started happening when more service roads were imported, and caused gridlock in lakeslice. This gets montlake and lakeslice running again, but rainier_valley remains gridlocked with service roads. 2021-02-22 14:48:49 -08:00
Dustin Carlino
6ceac88cbe Import most service roads, except driveways. #449
Added an extra step to classify service roads as running through a
parking lot, to prevent them from being treated as regular roads.

Had to fix up a few prebaked traffic signals. lakeslice falls back into
gridlock; will fix separately -- too much effort behind this change to
stop.
2021-02-21 18:27:34 -08:00
Dustin Carlino
5139a88a66 Also sort city districts by zorder when creating them from many maps. Noticed this issue in Leeds. 2021-02-19 10:26:51 -08:00
Dustin Carlino
64d150690a When building the contraction hierarchies for different vehicle types,
be more careful with nodes representing uber-turns. Even if that vehicle
type doesn't use an uber-turn, we still need to force the nodes to exist
and match up between input graphs.

Although this really only fixes gb/charleville_mezieres/secteur4, it
potentially affects all maps, because the node map changes. So
regenerate everything...
2021-02-17 14:17:27 -08:00
Dustin Carlino
1fa57a1e17 Import Charleville-Mézières. So many new places from Twitter!
Few workarounds based on importing crashes found.
2021-02-15 16:35:24 -08:00
Dustin Carlino
bc2767b89e Refactor lots of places that construct paths to the data/input dir, which is always organized by city. This would've made the previous change way easier. #326 2021-02-13 18:30:01 -08:00
Dustin Carlino
65b1f24d5d Automatically patch edits using the old MapName. And fix the 3
built-in proposals. #326
2021-02-13 17:01:24 -08:00
Dustin Carlino
39f5d50fcd The grand country split. #326
City names are now disambiguated by a two-letter country code. This
commit handles almost everything needed to make this transition. Main
next steps are fixing up map edits automatically and making the city
picker UI understand the extra level of hierarchy.

A little bit of fallout: lakeslice gridlocks again; this regression is
actually from the recent traffic signal changes, but I'm just now
regenerating everything. Will fix soon.
2021-02-13 15:45:59 -08:00
Dustin Carlino
03538faf3f
A few traffic signal cleanups: (#512)
- Stop alerting when slow pedestrians can't make it through the minimum
  crosswalk time
- Simpler iteration style in lagging_green.rs
- Totally delete the old brute force signal config code; it never worked
  well, and the improved heuristics eliminate the need for it anyway
- Make a Duration::max function and use it in one case
2021-02-12 15:10:32 -08:00
Dustin Carlino
aacc0fa4d5 Fix a crash that happens when you load edits that transformed a stop
sign into a traffic signal.

And fix a few cargo fmt issues
2021-02-12 13:47:10 -08:00
Bruce
6cb4cea624
Ts refactor (#511)
* Create module from make/traffic_signals.rs

Most things are in mod.rs, lagging_green and brute_force are moved into their own .rs files

* pull more into brute_force.rs
2021-02-11 18:24:17 -08:00
Bruce
121377467a
Lagging green (#510)
Add a template for lagging green

Lagging green is variable. Crosswalks are also variable.
convert_to_ped_scramble() is refactored to allow a call that doesn't promote yield to protected; as this could unintentionally extend a variable phase.
2021-02-11 13:21:26 -08:00
Dustin Carlino
68e406d26b Swap left/right turns when generating traffic signal policies in the UK.
Verified by trying the "four-stage" template at some intersections. Now
regenerating data.
2021-02-08 17:06:32 -08:00
Dustin Carlino
6f0751111e Derp, crosswalks on left-handed driving maps were always just outside the intersections. This made for some crazy traffic signals, since the crosswalk never conflicted with any turn.
Don't regenerate yet, because I have one more of these...
2021-02-08 16:50:17 -08:00
Dustin Carlino
73e405e382 Upgrade most dependencies 2021-02-03 18:13:06 -08:00
Dustin Carlino
ba2500c131 Create the path cost tuner. #237, #494
This lets you live-tune routing parameters, then see how it affects the
total number of routes that cross every road, relative to the baseline
of the original parameters. We can also use it in the future to do the
same thing, comparing before/after some map edits.
2021-02-03 11:34:15 -08:00
Dustin Carlino
a2b4dcb64f Store RoutingParams in the Map. Add a method for the debug UI to override the defaults, rebuilding the CHs. This is in preparation for #237, and part of #494 2021-02-03 10:59:02 -08:00
Dustin Carlino
32bcfbe738 Plumb in the tuned routing params. When they're not the defaults, automatically fallback from CH to Dijkstra's. #494 2021-02-02 15:20:06 -08:00