Commit Graph

1388 Commits

Author SHA1 Message Date
Dustin Carlino
73e405e382 Upgrade most dependencies 2021-02-03 18:13:06 -08:00
Dustin Carlino
2bbc43b529 Avoid crashing when we try to draw a vehicle that's literally just
spawned at a border and hasn't advanced at all.
2021-02-01 18:18:46 -08:00
Dustin Carlino
8a856d6608 Include transit riders in /data/get-agent-positions. #392 2021-02-01 12:27:55 -08:00
Dustin Carlino
ba5ea18101 Filter throughput layer by mode. #456 2021-02-01 11:02:10 -08:00
Dustin Carlino
3e40686a6b Fix a bunch of links after the repository renaming. 2021-01-31 15:50:48 -08:00
Bruce
cf5ce637f3
Skip all-walk if no demand (#442)
* Skip all-walk if no demand

If you create an all-walk stage and make it adaptive, if there is no demand it will be skipped. Fixed crosswalks are never skipped, as they may be necessary for queue management.
2021-01-27 11:13:19 -08:00
Dustin Carlino
f69335edf0 Let individual maps override the street parking length. #457
Now regenerate all map data, because the schema changed. Also had to
revert part of the last commit to unbreak transit route snapping in
Berlin.
2021-01-25 12:36:49 -08:00
Dustin Carlino
f393cc923b Mark vehicles waiting off-map to spawn at a border as active, so that they get a trip ID assigned in the API. 2021-01-23 19:42:54 -08:00
Dustin Carlino
6cb951f545 Grab fresh Cambridge data again; geofabrik hadn't picked up all of the
changes when I downloaded it. #449

And a small parking fix to better investigate a live edit crash.
2021-01-23 19:24:31 -08:00
Dustin Carlino
e55079fcab When we nuke cars while live editing, sometimes we need to clean up
reserved parking spots to avoid a leak and a later crash. #312

With this change, both montlake and lakeslice survive a full day of
traffic seitan making nefarious live edits...
2021-01-23 19:05:53 -08:00
Dustin Carlino
c9c6f240ae Remove timer.{note, warn, error} in favor of the log crate. #262
Originally, the intention of the deleted calls was to not interrupt
Timer progress bars with warnings. But the output of things like the
importer is impossible to read anyway. Strongly considering explicitly
sending logs and timing info to separate places and using something like
multitail for live progress.

Unplumb timer from LOADS of places that just needed it for logging.
2021-01-21 19:22:02 -08:00
Dustin Carlino
7797d17ff0 When cancelling a driving trip, sometimes we need to delete the parked car from the origin if the person hasn't actually left yet. #312 2021-01-21 12:33:15 -08:00
Dustin Carlino
fa30a7ee78 Deleting cars was actually leaking queue.reserved_length. Undo the
previous commit and fix the root problem properly. #312
2021-01-21 12:25:39 -08:00
Dustin Carlino
3efdb1962a For live map edits, don't crash if we can't figure out who somebody is
blocked by. There's a possible leak of reserved_length used for
uber-turns, but not sure. #312
2021-01-21 10:04:56 -08:00
Dustin Carlino
bccf389058 Don't attempt to wake up follower agents behind agents deleted during
live map edits, when the followers will also be deleted soon. Previously
this was crashing. #312

traffic_seitan once again makes it through the full montlake scenario,
and crashes on lakeslice around 3am.
2021-01-19 16:56:25 -08:00
Dustin Carlino
e4bf32a145 Handle deleting cars live from the middle of uber-turns. #312 2021-01-19 15:43:01 -08:00
Dustin Carlino
4c6d7af76d Bring in linear pedestrian highways as cycleways+shoulders. #458
Also give living_streets in Krakow shoulders, so foot routing works
better there.

Now regenerate everything. Actually messes up routing for Trumpington;
71 cancelled trips up to 101. And have to intervene to keep lakeslice
not gridlocking, as usual.
2021-01-16 17:03:13 -08:00
Dustin Carlino
0a353f67f8 When importing external scenario data for cyipt/actdev#32, snap border endpoints based on the allowed modes of each border. Without this, some driving trips snap to the cycleway next to a road.
212 cancelled trips (that immediately failed) down to 140.
2021-01-15 21:45:42 -08:00
Dustin Carlino
48a60c965b For extremely short roads (under 2 meters after calculating intersection
geometry), don't generate crosswalks or stop signs. In reality, these
usually represent the middle of a complicatd intersection. Ideally these
cases would be merged into a single intersection, but before that's
feasible, at least improve some of the inferred things nearby. #457
2021-01-15 15:32:01 -08:00
Dustin Carlino
3143b57b19 When importing external scenario data, snap points outside the map boundary to the nearest border.
Now the desire lines for cyipt/actdev#32 import without errors.
2021-01-14 17:32:44 -08:00
Dustin Carlino
ff598f21a3 Add a new layer to star buildings. Autosave it. While trying out changes
for #446 in the UI, I kept losing track of the two buildings I'm
focusing on. A player-defined list of shortcuts seems generally helpful.
2021-01-12 19:22:50 -08:00
Dustin Carlino
c5ae753f20 Return agent properties for cars waiting to spawn at a border, rather than crash when asked. #392 2021-01-12 12:04:07 -08:00
Dustin Carlino
8ac74f6dee When a driving trip from on-map to off-map is cancelled with live map
edits, remove the parked car, to mimic the person driving off-map. #312
2021-01-11 14:05:26 -08:00
Dustin Carlino
0eda6307cd Defer creating TripSpec until the trip actually starts. #258
This speeds up scenario instantiation (because picking a bus to use can
be spread out over time) and is a step towards simplifying the spawning
code. Starting downtown goes from 12.8s to 2.2s.

All vehicles spawning at a border now regress to using the 1st valid
lane, instead of random. Now that the choice is made when the trip
starts, this could later be improved to pick the least loaded lane.

Now regenerate everything.
2021-01-10 18:55:38 -08:00
Dustin Carlino
77c76a2a9c Clean up and categorize overrides for allowing vehicles to block-the-box at hardcoded intersections. 2021-01-07 14:24:48 -08:00
Dustin Carlino
6346302338 Remove the adaptive traffic signal experiment, now that Bruce's variable signals work. The adaptive case was added as a proof-of-concept, and its behavior is subsumed by the variable ones. Fixes #124 2021-01-05 13:06:44 -08:00
Dustin Carlino
e99def9124 Switch all error handling to anyhow. Nothing consumes our code as a
library yet, so this is a step forward from string errors. Manually
tested how errors show up (including the nice with_context bit).
2021-01-05 11:35:03 -08:00
Dustin Carlino
bc3c3dfd6c Rename phase -> stage in the JSON traffic signal format. Meant to do this a long time ago. #295
Make this schema change backwards compatible for player edits.
2021-01-04 11:18:17 -08:00
Dustin Carlino
d529ae2e5c Upgrade usvg and rand 2021-01-04 09:19:54 -08:00
Dustin Carlino
2945913fb3 Upgrade rand 2021-01-03 19:48:03 -08:00
Dustin Carlino
5c04923dff Split abstio crate out from abstutil. #253
widgetry, geom, and abstutil may wind up on crates.io in some form to
let other projects use widgetry. abstio has A/B Street-specific tricks
for reading data on native/web. Note widgetry still depends on abstio,
will figure out how to clean that up next.
2021-01-02 10:28:00 -08:00
Bruce
d47f2d84f3
Queue::try_to_reserve_entry needs improvement (#439)
If an intersection is short, and bike is spawned, another bike coming along will attempt to fit if force_entry is true. This results in a panic. To address this, if the reserved_length is >= the geom_len, false will be returned, even if forced_entry is true.
2020-12-30 18:08:43 -08:00
Dustin Carlino
3c27255479 15 min tool: Optionally don't allow walking on shoulders. #393 2020-12-24 15:52:00 -08:00
Bruce
3be45b8221
Add a Variable phase (#433)
* Add a Variable phase

Variable provides a min duration, a delay duration, and an additional duration. The maximum cycle time is min + additional. Once min has been exhausted, if there is demand, the cycle is extended by delay until there isn't any demand or the additional duration has been consumed.

#295
2020-12-24 12:33:47 -08:00
Dustin Carlino
d917008f2e Lift SimpleState to widgetry, since it doesn't depend on any details of
the App at all. Use it in the experiment a bit.
2020-12-17 12:23:57 -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
d4fa67ac87 Make the one-mode path guesses more precise in their start/end locations. Noticeable effect is in the freeform agent spawner, the paths actually go between buildings now, instead of lane starts. 2020-12-16 15:49:03 -08:00
Dustin Carlino
7c973ecacf Expose continuous distance crossed for vehicles. #392 2020-12-16 15:29:55 -08:00
Dustin Carlino
b39aa2a45f Expose continuous distance crossed for pedestrians. #392 2020-12-16 15:09:06 -08:00
Dustin Carlino
a5b62cd454 Simplify CreateCar, using the PathRequest embedded in the router's Path 2020-12-16 13:23:33 -08:00
Dustin Carlino
f36854cc5b Simplify TripPhase now that PathRequest is embedded in the Path 2020-12-16 13:02:59 -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
e8f7e7444c Treat vehicles waiting to spawn as active. #392 2020-12-16 12:05:15 -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
Michael Kirk
375e0caeb8
integrate census scenario (#426)
#424
2020-12-14 20:27:57 -08:00
Dustin Carlino
fb9635e8c8
Copy some pieces of the proletariat robot model into the new popdat pipeline: (#419)
- mode choice
- going off-map when there's no building on-map to satisfy a particular
  activity
2020-12-10 14:51:36 -08:00
Dustin Carlino
544dda9c5c When looking for turn conflicts, treat reserved turns (created before
starting an uber-turn) the same as accepted turns, updating the
blocked-by graph and allowing a movement to start if a cycle is
detected.

No effect in montlake or lakeslice, and very slight progress at the
Krakow roundabout for #382 -- increasing a tiny 26 trips by 7:20 am.
2020-12-03 10:56:42 -08:00
Dustin Carlino
5dba8f5896 Make the blocked-by graph used for debugging and the API detect problems
from somebody about to start an uber-turn.
2020-12-03 10:21:43 -08:00