Commit Graph

452 Commits

Author SHA1 Message Date
Dustin Carlino
bf8f51ae05 Consistently count hours for a time. There was some disagreement between
recorded analytics and code that later summed things up, making the
relative throughput layer more confusing than it is already. #85
2021-03-10 13:59:38 -08:00
Dustin Carlino
7170efbdba Improve some gridlock cases near roundabouts particularly. #114, #75
1) If a car is blocked by a conflicting turn and is part of a cycle,
   wake up the car blocking it. In some cases, this wakes it up faster
   and unsticks things. Otherwise, it just wastes a little bit of time.
2) If a car is part of a cycle, allow blocking-the-box.
3) Continue sorting people at a stop sign by the time they've been
   waiting. But for cars "overflowing" their current lane, move them to
   the front of this ordering. It unsticks one particular situation.
4) Fix wakeup_waiting entirely. Before, it was waking up protected turns
   before permitted, but otherwise the ordering was arbitrary. Now actually
   respect stop sign ordering. I expect this to improve many other
   situations than the one I was checking.

This was all motivated by one particular roundabout in Poundbury. It
doesn't solve gridlock there, but it gets past a major blockage.
2021-03-08 17:47:01 -08:00
Dustin Carlino
aa59677ad2 Transform the UK OD and zone data from raw input into a clean structure. #556 2021-03-05 10:47:48 -08:00
Michael Kirk
9533c10137 Theme switches
The main button API only allows re-writing one color of the image.

Since we need to rewrite multiple colors for the switch, I introduced a
`image_batch` for buttons which lets you do all kinds of manual
fanciness, and pass the result into the button API.
2021-02-24 14:59:47 -08:00
Dustin Carlino
9b966205c9 Delete redundant implementations of min and max for geom types. They get it for free by implementing Ord. 2021-02-12 15:22:27 -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
a5bfa55c8e Create a tool to find the geofabrik osm.pbf file covering a particular region. Inspired by https://github.com/ropensci/osmextract. This will make importing more maps much easier, especially for cyipt/actdev#65. 2021-02-10 12:35:59 -08:00
Dustin Carlino
06ab55da00 Prune auto-placed buildings that overlap each other. https://github.com/cyipt/actdev/issues/53
And write the result as geojson. This process could become a map
importer phase, but I like checking the intermediate results, and it's
not clear yet how often we'd be using this.
2021-02-07 11:50:30 -08:00
Michael Kirk
07738d2cef
popup and persistent split to spec (#480)
* introduce "pill" to be explicit about fully rounded, vs a "None" radius

* no-op transition to CornerRadii

* popup button to spec

* restore "fully rounded" layout behavior

* use plain light to better show highlight

* persistent split to spec (for day theme anyway)

* remove night-theme colors for speed panel

* fixup docs for pill

* CR: remove unnecessary `row`

* CR: remove outdated doc

* import order
2021-01-24 15:32:28 -08:00
Michael Kirk
d7445d889e
button revamp groundwork (#459) 2021-01-19 10:10:18 -08:00
Michael Kirk
c421fb2e82 rename inner props for Pt2D for more readable debug output
originally I was going to implement std::fmt::Debug, but since these are
private members I just renamed them. Not sure why they had a baroque
name - it's ok for fields to have the same name as methods.
2021-01-16 21:16:14 -08:00
Michael Kirk
f8a9844b2c Bounds::zero and Bounds::eq 2021-01-16 21:16:14 -08:00
Dustin Carlino
549a625d57 Parse times more like what people expect -- 07:30 is 7h30m, not 7m30s 2021-01-12 12:49:07 -08:00
Dustin Carlino
f680de73aa Remove London from screenshot testing, and use Cambridge instead. #449
This will make it easier to visually track the progress improving the
import. Originally London was added to have one left-hand driving map
under the test, but Cambridge works for that too, and it also includes
separate cycleways.

Also fix a crash when trying to draw very very tiny arrows.
2021-01-12 12:30:21 -08:00
Dustin Carlino
802e020520 Import a SUMO network, transform it into an ABST map. So far, this gets
lanes and intersections displaying, but with lots of problems.
2021-01-05 12:44:38 -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
795c6bebb1 When producing GeoJSON, represent Polygons that arent Rings (like from SVGs) as a MultiPolygon of every pre-calculated triangle. #440 2021-01-01 15:33:11 -08:00
Dustin Carlino
6119042b4f Reorder points when converting a PolyLine to a Polygon, so that the
result is usually a Ring. This gets lanes to render in the GeoJSON
export. #440

Ideally all Polygons would be expressed as an outer Ring and some
optional inner Rings. There are a few cases where this is hard, and we
instead just rely on the triangulation for rendering and point
containment and give up on GeoJSON export.

Not regenerating all maps yet -- zero screenshot diff, the map file does
change, but not sure how.
2021-01-01 15:03:09 -08:00
Michael Kirk
acadad8bdf
fetch US census data from a hosted FlatGeoBuf (#432) 2020-12-31 16:20:32 -08:00
Dustin Carlino
172dbf359c Try merging intersections with concave hull instead. #114 2020-12-28 16:05:41 -08:00
Dustin Carlino
5aecff3b9e Regularly import Salzburg. #366 2020-12-15 06:02:06 -08:00
Michael Kirk
8b9b3ce2b1
census areas import (#425)
#424
2020-12-14 17:48:47 -08:00
Dustin Carlino
3c2c3cda5a Output lane width as feet in the Streetmix export, not meters.
Also few unrelated tiny wording changes in the experiment
2020-12-14 16:13:32 -08:00
Dustin Carlino
4d057cb74f Improve the out-of-energy arrow:
- point to the driveway, not the building center
- scale arrow length so it doesn't overshoot where we're supposed to go
- explicitly say to go refill from a store
2020-12-14 15:03:22 -08:00
Dustin Carlino
de129e2e8e Improve that movement style by ordering choices by angle 2020-12-12 19:34:54 -08:00
Dustin Carlino
4d56786289 Don't move faster diagonally 2020-12-06 19:49:59 -08:00
Dustin Carlino
4c947f05f6 Attempt more precise collision response, but it doesn't feel good, so
disable it
2020-12-06 19:24:19 -08:00
Dustin Carlino
12d0294692 Minimap tracker and new meters 2020-12-03 15:09:54 -08:00
Dustin Carlino
08d6f6987f Figure out when we pass a building along a road 2020-12-02 18:00:51 -08:00
Dustin Carlino
aa4d848a0e Figure out the number of single family and multi-family units per OSM building, from parcel data. Just store it in an extra system file for now. 2020-11-30 10:58:47 -08:00
Dustin Carlino
51d4f4dac8 When out of energy, point to a depot. 2020-11-28 20:47:49 -08:00
Dustin Carlino
e589f89922 Add a simple progress bar for updater downloads. #410 2020-11-26 16:12:16 -08:00
Dustin Carlino
fba2391bc5 Experiment with winit key handling. And attempt [rebuild] [release] again 2020-11-22 12:56:22 -08:00
Dustin Carlino
d43bf2c869 Import Paris, for helping the OSM community visualize all the awesome pop-up bike lanes there 2020-11-13 17:23:36 -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
a3bcf5181c Make the map editor be able to produce synthetic .osm, and use it to
create a map exemplifying the lane-changing problems of #382.
2020-11-11 10:44:45 -08:00
Dustin Carlino
07ac288e72 Refactor: rename Pt2D::from_gps to just gps.to_pt(bounds) 2020-11-10 12:00:43 -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
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
1707b6fe37 Consolidate some PolyLine geometry code, and refactor some geom->geojson
mappings
2020-10-29 12:23:39 -07:00
Dustin Carlino
f187cf4bd8 Add an API call to export intersection geometry to geojson, for experimental streetmix3d integration.
To get an example:
> cargo run --bin headless -- --port=1234
> curl http://localhost:1234/map/get-intersection-geometry?id=291
2020-10-29 12:00:34 -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
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