Commit Graph

415 Commits

Author SHA1 Message Date
Dustin Carlino
41712b5beb I somehow managed to break pedestrian rendering in 004ca95842 2020-10-27 15:41:33 -07:00
Dustin Carlino
004ca95842 Optionally just create a circle of some radius around the 'center' of a city. #326 2020-10-26 16:57:50 -07:00
Dustin Carlino
fda4c4da7b Refactor a few utilities, and use convex hull of the city boundaries to simplify them considerably. #326 2020-10-26 14:15:25 -07:00
Dustin Carlino
536971b641 Cleanup formatting after #371 2020-10-23 10:42:12 -07:00
Javed Nissar
c74dcf025f
Update georust (#371) 2020-10-23 10:41:00 -07:00
Michael Kirk
6025d89598
Mkirk/perf 2 (#370)
* perf: return Line iterator rather than Vec

avoids allocating vector memory, cleans up some call sites too.
2020-10-20 11:51:00 -07:00
Dustin Carlino
af70904377 Document as much of geom as I can before my battery dies. And a mechanical API changes, Angle::new_degs -> Angle::degrees 2020-10-19 19:55:05 -05:00
Dustin Carlino
87d233299a Use a HashMap instead of a BTreeMap in Scheduler's internals. Doesn't
affect determistic simulation, but yields a crazy speedup. #54

- 8 hours of downtown: 122s to 102s!!!
- prebake: 181s to 160s
2020-10-19 16:30:41 -05:00
Dustin Carlino
38394c4a08 Comment some code to clarify things in #365, and switch the color for
selecting unzoomed agents
2020-10-15 14:58:07 -05:00
Dustin Carlino
028d1df62c Allow selecting and clicking unzoomed agents. [rebuild] 2020-10-15 14:58:07 -05:00
Dustin Carlino
a1c53d5e1c Humble start to adjusting how distances and durations are printed in the UI. #331
Also trimmed out a few old UI settings; they kind of started as
experiments, but now the alternative feels useless to maintain.
2020-10-11 10:45:13 -07:00
Dustin Carlino
e38858129b Cleanups after https://github.com/dabreegster/abstreet/pull/363:
- cargo +nightly fmt
- upload new prebaked data
2020-10-10 12:24:42 -07:00
Sam
4c5a858238
Delay highlighting (#363)
* Initial storing of intersection delays

* Initial highlighting of delays on route

* Added label of delay

* Info overlay works

* Added supoprt for pedestrian delays (only intersection delay currently)
Bike also works, but is treated as a car, so the avg speed is flagged as very slow (Needs fix)

* Capitalised describe trip phase
Now uses min of (speed limit and vehicle max speed) for the maximum speed check
Added trip blocked time query
Lots of work on tool tips
Icons are broke

* Nearly complete, just fmting and a crash to fix
Color assertion?

* Fixed text font colour crash
Added new custom TextSpan size function

* Cargo +nightly fmt

* Cargo +nightly fmt

* Clion auto import formatting
Doesn't quite match the existing "changes"

* Fixing merge issues

* Fixing icon placement issues

* Requested changes (Part 1)

* Requested changes (Part 2)

Co-authored-by: Sam <a>
Co-authored-by: Dustin Carlino <dabreegster@gmail.com>
2020-10-10 12:23:02 -07:00
Dustin Carlino
f1ec2fa4c4 Convert more doc comments for abstutil, convert_osm, geom, sim 2020-10-08 21:13:08 -07:00
Dustin Carlino
f258c50595 Organize import blocks using https://github.com/dabreegster/organize_rust_imports 2020-10-05 20:29:22 -07:00
Dustin Carlino
27d94945c6 Manually move mod block after the use block, to match what CLion does. 2020-10-05 20:29:22 -07:00
Dustin Carlino
fd212b474c Get wasm running again; cargo web was hitting
https://github.com/koute/cargo-web/issues/217. After adding some
debugging to that tool, discovered the problem was generic-array, pulled
in by the new geo version. Forcing that to the older version fixes
things.
2020-09-29 23:34:10 -07:00
Dustin Carlino
2ddd9a62ff Cleanups for #346:
- Add Distance::min()/max()
- Bring in log crate everywhere
- Consolidate traffic signal validation
2020-09-26 10:11:08 -07:00
Dustin Carlino
597ef473f2 Upgrade most dependencies 2020-09-24 09:36:26 -07:00
Dustin Carlino
70d2d1115e Store polygon indices as u16, not u64. Maps from 743MB total down to
620MB!
2020-09-04 13:12:06 -07:00
Dustin Carlino
568a64df91 Don't store Rings for Polygons without any holes. Total map size from 751MB to 743MB 2020-09-04 12:18:53 -07:00
Dustin Carlino
87cb44200f Prevent a crash when scaling polygons down. Experienced while watching the current demand panel. I swear I've fixed this before, but apparently not 2020-08-27 18:56:28 -07:00
Dustin Carlino
6b7747c37a Overhaul lane markings:
- Cut off the one-way markings before the end of the road, to stop stomping over turn markings
- Draw turn arrows to every road, not each lane
- Only draw turn arrows when a lane is restricted from going to some
  outbound lane. At most intersections, all turns are legal, so don't draw
  anything.

[rebuild]
2020-08-23 12:00:25 -07:00
Dustin Carlino
14c66c5528 A humble start to a Percent type for #274. There are so many places to
use it; just start a few in ezgui. Also a good time to object to the API
so far.
2020-08-20 11:01:59 -07:00
Dustin Carlino
2e93fdbf54 Fix parking aisle loops that cross the parking lot polygon. Closes #242 2020-08-18 15:12:12 -07:00
Dustin Carlino
a6a454d326 Add a tool to import external traffic demand data. The format and way of
calling the tool (not in the importer?) are just experiments right now.
2020-08-17 12:32:09 -07:00
Dustin Carlino
bc858fdbb3 Work around a crash on the intersection demand panel, reproducible by
watching https://www.openstreetmap.org/node/53214134 on the weekday
scenario. At some point, an arrow polygon with an inner ring is scaled
down, collapsing its points so much that the ring becomes invalid.
2020-08-14 12:09:06 -07:00
Dustin Carlino
58849d3d15 Small refactor: in most places, we can actually use String as the error type; Box<dyn Error> is only useful when errors of different types are propagated.
Nowhere in abst do we care about handling different errors differently
2020-08-13 07:12:06 -07:00
Dustin Carlino
3b49353df2 gracefully degrade if we cant make TurnGroups for a traffic signal. this
gets SF, Tokyo, and London to import!!!
2020-08-12 11:05:19 -07:00
Dustin Carlino
62bb82886d blaze through all the crazy errors in intersection_polygon, just
recording errors and falling back to circular geometry and not trimming
roads

also filter out highway areas like
https://www.openstreetmap.org/way/132705692, woops!

Manchester and NOLA now import...
2020-08-12 09:36:46 -07:00
Dustin Carlino
e35c69f6f3 ezgui Wizard (and its pet Cloneable)
Here lies a weird coroutine experiment
09/20/2018 - 08/07/2020
2020-08-07 14:04:41 -07:00
Dustin Carlino
00e8b8a8c2 work around ballard map crashing from tiny border. i tried valiantly to
extend short borders, but it can't be done in convert_osm clip. has to
happen later when trimming and making intersection geometry. too much of
a headache right now.

west seattle and krakow still broken because of short borders.

also grab fresh osm
2020-08-04 15:25:49 -07:00
Dustin Carlino
d22aa87139 rearrange Building internals for #176. edits can affect building
connections to driving/biking. just store the immutable stuff -- whether
there's parking in the building, the connection to the sidewalk, and the
physical driveway line. compute all the rest dynamically, so it responds
to edits without effort.

shouldn't be major behavior changes yet (besides maybe fixing some bugs
involving edits)
2020-07-31 12:49:33 -07:00
Dustin Carlino
03796fcd66 introduce the tiny walkable shoulder lane type. pathfinding penalty,
rendering adjustments. #176

the SharedSidewalkCorner geometry looks bad, but acceptable for now.
2020-07-30 13:42:36 -07:00
Dustin Carlino
2b9123d261 fix border intersection geometry when the road is too short. closes #251
while regenerating, also pick up landuse=grass as a park area. noticed
missing in krakow.
2020-07-28 13:41:12 -07:00
Michael Kirk
5f9e94cfcc
use monospace font to avoid clock layout jitter (#250)
* use monospace font to avoid clock layout jitter

* conventional naming
2020-07-28 10:39:18 -07:00
Dustin Carlino
e1e265db14 tighten up Polygon constructors to enforce an outer ring... in most
cases now.
2020-07-27 14:03:55 -07:00
Michael Kirk
fff938180f
Commuter Patterns: Larger shapes for border intersections (#247)
* Commuter Patterns: Larger shapes for border intersections

A substantial portion of traffic has an origin/destination off the map.
We were correctly tracking all this data, attributing it to a
"block" the size of the border "intersection"; However, the design
didn't accommodate the small "size" of the border intersections:

1. it was too small to meaningfully reason about the heatmap visualization
2. it was too small of a "hit" area for clicking and hovering
3. when in the "locked" mode, the hover text overlay was illegible.

Now we draw a larger arrow, representing the inward/outward/both-ways
direction of traffic which makes it easier to reason about the heatmap
color and accommodates an adequate hit area.

And the hover text is now printed over a white pill to maintain
legibility.

* Commuter Patterns: Draw border *behind* directional icon

* Code Review: code cleanup - no changes to behavior.
2020-07-27 12:07:51 -07:00
Dustin Carlino
74bf6e0974 get riding off-map to work for #190.
- handle living streets that allow buses in berlin
- don't connect LeaveMap nodes to anything else; people were getting
  creative and using them as shortcuts to effectively warp to a border,
  then come back into the map
- make should_use_transit understand transfers (and still just return
  the first leg)
- warp to bus routes by ID

still at least one weird bug left, seen in krakow. working on it next,
trying to keep these commits "small." not regenerating maps quite yet.
2020-07-27 10:37:21 -07:00
Dustin Carlino
a1e1e51b10 obviate need for make_arrow_outline by just putting together a
reasonable make_arrow polygon in the first place
2020-07-26 20:25:38 -07:00
Dustin Carlino
7a00839553 ditch osm-xml, make a new osm parser from scratch based on roxmltree.
skip unreferenced objects, make the output extremely easy to consume.
also fix timers in importer. this helps with #212, although the actual
problem there is weird.

regen everything. some parking lots change a bit, but not horribly, and
that code needs some attention anyway.
2020-07-25 13:52:41 -07:00
Dustin Carlino
5d2b770258 Model living streets a bit more carefully.
- don't infer parking lanes there
- sidewalks on both side of a one-way
- handle maxspeed with kmph
- no maxspeed on living_street is 20 kmph

still not regenerating maps
2020-07-22 13:09:35 -07:00
Dustin Carlino
636c2838a3 experiment with fan charts for intersection delay. they... need work. 2020-07-21 10:10:42 -07:00
Dustin Carlino
a65107145f turn heatmaps into nice polygon contours 2020-07-20 17:03:32 -07:00
Dustin Carlino
f91a73e12a tighten up polygon_with_holes API 2020-07-20 09:41:47 -07:00
Dustin Carlino
50b75b732f finally have proper circle outlines 2020-07-20 09:31:12 -07:00
Dustin Carlino
3a1ef311a7 use my new best friend earcutr to make sure people dont get lost when editing a traffic signal 2020-07-17 10:00:45 -07:00
Dustin Carlino
aad5796e0b make sure polygon area is positive. the building classification was
multiplying negatives and winding up with quite a few people...
2020-07-16 21:15:44 -07:00
Dustin Carlino
1c39de50f7 use earcutr for polygon triangulation. this finally allows for
multipolygons with holes!
2020-07-16 15:33:01 -07:00
Dustin Carlino
ccf213ded9 fix pioneer square station snapping. rust-geo's FindClosest has a bug.
>_<
2020-07-16 13:22:05 -07:00