Commit Graph

1259 Commits

Author SHA1 Message Date
Dustin Carlino
a52777cca4 Fix /data/trip-time-lower-bound API. It was using the full length of the
first and last lane, which is usually not true, and thus over-estimating
time. #392
2020-12-22 10:22:25 -08:00
Dustin Carlino
0b8c86e2c8 Adjust the threshold for what counts as a straight vs right turn from 10
degrees to 30 degrees. It works around the issue in #428, but it doesn't
solve the root cause there, so the unit test is also adjusted to provide
a way to solve the harder problem.

Regenerated all maps accordingly. Many traffic signals tended to
improve, with a straight turn marked protected, instead of permitted as
a "right turn."
2020-12-18 12:06:16 -08:00
Dustin Carlino
0831d112ed Simplify the trace API even more -- everyone but the simulation deals with unmodified paths and wants the original start 2020-12-16 16:14:33 -08:00
Dustin Carlino
d00e7f7bca Simplify path trace API -- nobody needs dist_ahead. I think that was originally meant to be a performance trick to only draw the next little bit of a route 2020-12-16 16:09:11 -08:00
Dustin Carlino
b39aa2a45f Expose continuous distance crossed for pedestrians. #392 2020-12-16 15:09:06 -08:00
Dustin Carlino
6e275a0a60 Track Path's total_length and crossed_so_far a bit more precisely at the beginning/end of the path, towards #392 2020-12-16 14:45:20 -08:00
Dustin Carlino
fccc98205c Refactor: Store the input PathRequest inside the resulting Path. This
saves lots of callers from cloning the request and separately plumbing
around the requested start/end distance. Also a step towards exposing
more granular distance crossed in a path for #392.

Still a few more places to simplify, but will do in a separate, smaller
change.
2020-12-16 12:55:57 -08:00
Dustin Carlino
2b4b92664e Much needed refactor: map.pathfind() returns a Result, stating the failed request. Many call sites were cloning the request and doing this anyway. 2020-12-16 10:06:12 -08:00
Dustin Carlino
a0555d1df5 Add an API call to estimate the best-case duration of a trip. #392 2020-12-16 09:42:50 -08:00
Dustin Carlino
3d361074ab Draw traffic signals changing over time in the experiment 2020-12-08 09:05:06 -08:00
Dustin Carlino
60117a64e8 Handle starting/ending in a zone when pathfinding, regardless of Dijkstra/CH implementation. #411
The import bug in Münster is still happening though! Still digging in.
(But regardless, this change fixes some old technical debt)
2020-12-02 10:42:01 -08:00
Dustin Carlino
17e850908c Reorganizing pathfinder code to prepare for sharing the start/stop-in-a-zone logic between the CH and Dijkstra implementation. #411 2020-12-02 09:22:16 -08:00
Dustin Carlino
69b14e444f Simpler abstutil APIs: return string errors immediately, don't make callers transform. We don't need to distinguish different error types anywhere. 2020-12-02 08:44:07 -08:00
Michael Kirk
ddfaf73eae Improve lane changing vis-a-vis uber turns.
1. Allow lane changing in an uber turn. Because of the way uber turns
   work, we lock in and commit to all the lane changes just before
   entering the uber turn.
2. Avoid overzealous lane changing by combining number-of-lanes-crossed
   and numer-of-vehicles-in-lane into a single cost, rather than always
   preferring the least  number-of-vehicles-in-lane.
3. Don't lane-change unless the candidate lane's cost is strictly better
   than the current lane cost.
2020-12-01 19:20:53 -08:00
Dustin Carlino
57963126fa Fold number of housing units into Building; ditch the extra file approach. 2020-12-01 12:43:19 -08:00
Dustin Carlino
2672eb837c Remove the unused total_lanes from Path 2020-11-25 11:21:15 -08:00
Dustin Carlino
ab88010ed0
Refactor PathRequest creators that go between two buildings. #176 (#404) 2020-11-24 13:21:44 -08:00
Dustin Carlino
d83133fa09 Fix the biking mode for #393 2020-11-22 10:48:41 -08:00
Dustin Carlino
594b376734 Figure out travel time for bikes. #393
Something's wrong with the results, but it's a start.
2020-11-21 15:10:49 -08:00
Dustin Carlino
78eedff7c7 UI glue for switching between walking/biking. #393 2020-11-21 14:02:24 -08:00
Dustin Carlino
bf9d34d1a3 Drop results farther than 15 minutes away. #393
It'd be more efficient to terminate the Dijkstra's search directly, but
petgraph doesn't have an option for that, so we'll have to implement
Dijkstra's manually (shouldn't be hard).
2020-11-21 10:12:29 -08:00
Dustin Carlino
d33d051d47 Make the isochrone use time, not distance, as a cost function. And
floodfill using Dijkstra's, instead of computing loads of paths.  #393
2020-11-19 14:11:59 -08:00
Dustin Carlino
f6565988c9 Let parking aisles span multiple parking lots. 2020-11-19 12:34:31 -08:00
Dustin Carlino
739e33ec3e We do need to fill out trip legs for TripSpec::SpawningFailure; smoke tests in other maps hit it. #258 2020-11-17 18:02:48 -08:00
Dustin Carlino
b6be9c81d5 Generate city picker maps from a bunch of small maps, instead of one huge map. Use for Paris. One giant map covering everything there is going to be too large. 2020-11-13 18:22:46 -08:00
Dustin Carlino
6fe49ce0fa Some preps for importing Paris: avoid crashing on some previously unseen
OSM things, and making geojson_to_osmosis handle multiple polygons in
one input file.
2020-11-13 16:31:22 -08:00
Dustin Carlino
c6b752d41b Iterate on automatically finding medians for #230. Still not ready, but
get fresh OSM data to test in both Krakow and Seattle. While I'm at it,
also grab fresh OSM for Krakow, since it's been ages.
2020-11-12 17:58:19 -08:00
Michael Kirk
6b02048ce7 see logs in web 2020-11-12 16:51:05 -08:00
Dustin Carlino
69699600ea Prototype filling in the gaps near one-way roads. Needs more filtering
out, but solid start. #230

Regenerate map data, since the Area object changed.
2020-11-12 14:21:08 -08:00
Dustin Carlino
c96f84341a Incorporate intersection corners in the around-the-block polygon. #230 2020-11-12 13:41:47 -08:00
Dustin Carlino
1b6af3dfb1 Prototype a debug mode tool to trace a polygon on the interior of any "loop" of roads. Aka, find the polygon if you "walk around the block." This can be used to fill in the blank space between dual carriageways. #230
Algorithm needs some work -- it doesn't trace along sidewalk corners,
and it fails for some starting lanes.
2020-11-12 12:53:41 -08:00
Dustin Carlino
7854823c28 Change the to/from permanent map edits APIs to be a little more ergonomic 2020-11-12 10:13:32 -08:00
Dustin Carlino
4b557fa6de Bring in fresh OSM for Seattle. Because it's so annoying to manually
repair proposals when roads change upstream, make the test dump a
repaired file before failing. Manually inspect/amend that.
2020-11-11 15:16:06 -08:00
Dustin Carlino
3e7c0e51c4 Set up a test scenario for lane-changing to reproduce #382. The same
problems aren't quite captured, but it's a start.
2020-11-11 11:33:47 -08:00
Dustin Carlino
2a546e528c Skip applying no-op edits and recalculating pathfinding when leaving sandbox mode. For large maps, it's a noticeable delay 2020-11-10 15:19:41 -08:00
Dustin Carlino
e0a8d82b61 Reorganize polygon files to importer/config, instead of data/input.
Nothing in data/input should be under version control; all of it is
managed by the updater. #326
2020-11-06 10:10:03 -08:00
Dustin Carlino
cda586dfc9 Cleanup by moving some methods to belong to MapName. #326 2020-11-05 14:18:13 -08:00
Dustin Carlino
4f2cda8d53 Reorganize data/system/ files by city! The only interesting change is
abstutil::path_all_maps becoming abstutil::list_all_maps. #326
2020-11-05 14:05:48 -08:00
Dustin Carlino
67530bec07 Future-proof file organization by changing map_name from a string to a
struct. Whatever choices we make next about naming cities hierarchially
or not can be managed in just one place. #326

This is a pretty huge change, but the compiler gives reasonable
confidence it's correct. More bugs are likely to crop up in the next
step, when filenames start being namespaced by the city too.
2020-11-04 17:26:32 -08:00
Dustin Carlino
e99dd5bba7 Use inferred sidewalks for Leeds, after detecting another geometry bug
when building sidewalk corners. Raw sidewalks from OSM aren't suitable
for traffic simulation yet.
2020-11-04 08:46:06 -08:00
Dustin Carlino
b2519e3050 Add an extra check for polyline intersection endpoints. I found an
intersection polygon in Krakow that has really bad geometry, and this
improves it. The extra check absolutely shouldn't be necessary, but of
course, all the core line intersection code is quite suspect! #161
2020-11-02 15:10:45 -08:00
Dustin Carlino
6e417340e4 Generate turns much more simply for intersections of footpaths. #161
Also gets rid of some annoying warnings about roads with missing names.
I could continue to skip the warning for more situations, but I think
this sort of data quality check could be done better in the OSM viewer.
2020-11-01 18:20:32 -08:00
Dustin Carlino
04b9eef24a When using OSM footpaths, don't stick sidewalks on the road when sidewalks=separate and also bring in cycleways and paths allowing foot traffic. #161 2020-10-30 15:16:19 -07:00
Dustin Carlino
ca2ff08d71 Don't render intersections between footways with a special color. Also
cut Kraków over to using the new experimental footpath support. #161
2020-10-30 14:11:00 -07:00
Dustin Carlino
bf0dce2c18 Optionally import sidewalks and separate footpaths exactly as they're in OSM, instead of attempting any inference. This is a way to move forward on #161 without having to cutover to it all at once. 2020-10-30 13:27:45 -07:00
Dustin Carlino
3b838c1225 Finish formatting distance/duration/speed units nicely. And remove the
number of lanes from trip info; it's misleading and not useful. #331
2020-10-28 11:33:48 -07:00
Dustin Carlino
0c0104d1e2 Parallelize parking lot spot generation. Austin goes from 81s total import down to 44s. #270 2020-10-26 16:28:11 -07:00
Dustin Carlino
47fa997f72 Refactor a proper Amenity struct. Leave room for optional raw OSM tags.
Don't expose the tags in the UI yet. [rebuild]
2020-10-25 11:49:46 -07:00
Dustin Carlino
34b41a909e Optionally keep building OSM tags. Display in info panels and the new viewer, when present.
Don't keep the tags by default. File size increase from the empty map is
negligible.
2020-10-24 14:19:22 -07:00
Dustin Carlino
9dbb156058 Skip wakeup_waiting while we're handling live map edits. Based on the
order of vehicle deletion, we try to ask about stop sign and traffic
signal movements that may be deleted and would be irrelevant anyway if a
different deletion order happened. #312

We should really defer wakeup_waiting until after all cleanup is done,
but for now, willing to risk some stuckness at a stop sign...
2020-10-23 12:15:51 -07:00