Commit Graph

1495 Commits

Author SHA1 Message Date
Dustin Carlino
2288b0d42a Add a smaller study area in Tehran.
- Procedurally generate houses there, so the automatic travel demand
  model doesn't produce totally silly patterns.
- Disable parking
- Allow vehicles to enter the intersection even when it looks like they
  might get stuck; this lets the default scenario complete without
  gridlock.
- Prebake the scenario, so a researcher can make edits and use all of
  the A/B testing data viz.

The home-to-work scenario produces laughably bogus patterns... everyone
working at Bank Sepah.
2021-09-30 14:51:56 -07:00
Dustin Carlino
c4d38ca591 A humble start to showing an alternate, low-stress route. #743 2021-09-27 13:13:11 -07:00
Dustin Carlino
3945528cf5 Start a 4th mode for the bike network tool: predicting impact, aka, mode-shift. #448
Just load the scenario and scrape data from it, to start.
2021-09-20 10:07:58 -07:00
Dustin Carlino
b7d010058c Store Movements per Intersection, instead of constantly calculating them! #746
Regenerating everything...
2021-09-06 14:53:37 -07:00
Dustin Carlino
7f86fe5ce6 Fix the run_scenario tool, try to use it for profiling 2021-09-06 09:54:58 -07:00
Dustin Carlino
9300470c6b Lane offset comes for free now 2021-09-05 19:53:10 -07:00
Dustin Carlino
442523ae6c Simplify some lane lookups that just needed to find the parent 2021-09-05 19:53:10 -07:00
Dustin Carlino
112bc38e0c Get rid of the now redundant lanes_ltr 2021-09-05 19:53:10 -07:00
Dustin Carlino
4c46510342 Cleaning up a few APIs, now that lanes belong to roads... 2021-09-05 19:53:10 -07:00
Dustin Carlino
0f4a31e915 Moving lanes from a BTreeMap to be stored inlined in their parent Roads. #746
Somewhat invasive API change internal to map_model, but not much impact
elsewhere.

Not regenerating anything yet.
2021-09-05 19:53:10 -07:00
Dustin Carlino
cea0ad2541 Change LaneID to encode (RoadID, offset), still in one u32. #746
Not regenerating yet.
2021-09-05 19:53:10 -07:00
Dustin Carlino
df242871b5 Fix actdev crash -- some people in the imported scenario data don't have
any trips snap successfully to buildings, so we wind up with 0-trip
people that break some UI logic.

Reimported all actdev scenarios. Hopefully there weren't any cases like
this in the Seattle data, but I'll do a full regeneration later tonight
anyway...
2021-08-25 09:24:00 -07:00
Dustin Carlino
b397f97a12 Splitting Aurora study area into 3 maps, actually 2021-08-23 19:38:36 -07:00
Dustin Carlino
fbd173408e Import new Seattle OSM data with a bunch of fixes around Aurora, and actually disable parking in the Aurora maps
Remove Queen Anne from prebaking -- it trips some crash with waking up
following vehicles that I'm not going to dig into right now.
2021-08-22 19:50:47 -07:00
Dustin Carlino
71b54b3ed7 Create two study areas for the Aurora project. Can fine-tune or split
boundaries later, but this roughly captures the interesting bits.
2021-08-20 16:31:08 -07:00
Dustin Carlino
90a1d2ff83 Initially launch with edits loaded remotely 2021-08-16 16:00:01 -07:00
Dustin Carlino
1d7149c18b Don't crash in the activity model generators if a map has no borders. This currently happens with Overpass imports. #717 2021-07-25 10:30:06 -07:00
Dustin Carlino
1d7c8ce89c Opt Tempe into infinite parking always. #672 2021-07-21 15:13:13 -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
10fdaa8e92 estimate_duration already knows the mode, from the PathRequest 2021-07-14 12:38:19 -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
fe64501e6d Fix pedestrian speeds on inclines. Those walking contraflow on a
sidewalk were using the wrong incline!

Not regenerating data yet (need to regenerate all maps)
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
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
06ec73b67f Fix a bug with both regular and infinite parking. If two cars enter a
lane and both want to park in the same building or parking lot, they're
assigned the same spot. When the second one tries to use it, they pick
another. Now the second will still consider spots that they're directly
next to. #688
2021-07-05 22:27:21 -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
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
d314163f13 Finally regenerate prebaked data, with left turns out of driveways fully
supported!

- Had to skip over center turn lanes -- we're approaching the point where
  we can model those realistically.
- Carefully deal with static blockages near the start of a lane to avoid
  spillover. Observed near b3810 in greenlake. It's time to make equiv_pos
  smarter...
2021-07-04 14:34:20 -07:00
Dustin Carlino
0211094689 Create static blockages for off-side driveway exits. Verified correct
for all combinations of on/off-side exits and cutting across lanes by
using the static blockage visualizer.
2021-07-04 14:34:20 -07:00
Dustin Carlino
646e85d278 Optionally draw static and dynamic blockages. This is immensely useful
for working on exiting from driveways and lane-changing. #382
2021-07-04 14:34:20 -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
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
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
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
799fdfbbc0 Don't start lane-changing while still being a laggy head. Fixes the crash. #392
Now prebake data again, and upload everything
2021-06-22 18:36:35 -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
69152f00ad Fix critical dynamic blockage math bug. Stops some crashes in some cases, including the tests -- which run again. Manually verified the turn goldenfile diff in the UI and regenerated prebaked data. #392 2021-06-21 20:37:11 -07:00
Dustin Carlino
3b748ee9fa Implement dynamic blockages and use them for lane-changing. #392
This is conceptually simple and improves the behavior of vehicles
that're following a LCing leader.

Regenerate prebaked results -- no new gridlock!
2021-06-19 12:35:19 -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
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
Dustin Carlino
0f7299f091 Found the bug with the previous commit. Keeping this separate to point out the issue. Reasoning using get_active_cars is super dangerous; likely going to remove it. #555
But finally, regenerate prebaked data successfully and commit all of
this. It's done. Blocking driveways on exit works now
2021-06-17 13:39:26 -07:00
Dustin Carlino
841336ad15 A grand finale: refactor logic to update follower vehicles, and call that new logic when clearing static blockages. #555
And previous commit was wrong about Unparking needing distances; it
needs distances OF ANOTHER QUEUE.
2021-06-17 13:01:00 -07:00
Dustin Carlino
1528b954c6 Carefully change the Unparking and IdlingAtStop states to require
distances... #555

Prebaked actually broke with the previous commit in Arboretum, because a
car waits behind a blockage, then suddenly warps ahead. But now we can
fix this...
2021-06-17 12:18:25 -07:00
Dustin Carlino
1dc973c7fa And finally: enforce static blockages while a vehicle exits a driveway onto a far lane! #555
Vehicles now wait behind blockages, but one more little bug... after the
driveway is clear, the waiting vehicle jumps forward. Need to reset
their crossing state, same as waiting behind a bus.
2021-06-17 09:27:48 -07:00
Dustin Carlino
f5dc28900b The big rip: change Queue to store more than just actively moving vehicles. Expose these in the API and update a few callers. #555
Still no behavioral change -- not inserting blockages into the queue
yet, just representing them. Verifying no prebaked changes still.
2021-06-17 08:51:07 -07:00
Dustin Carlino
ab539f1efd Creeping towards #555: make the queue of cars in Queue private, and start some proper APIs for managing it. We need to change this to model blockages, and this is a small step towards that.
No behavioral change; verified by regenerating prebaked data
2021-06-16 21:35:57 -07:00
Rémi Lauzier
1a4b997818 Fix some clippy warnings 2021-06-16 16:21:35 -07:00