A traffic simulation game exploring how small changes to roads affect cyclists, transit users, pedestrians, and drivers.

Overview

A/B Street

Ever been stuck in traffic on a bus, wondering why is there legal street parking instead of a dedicated bus lane? A/B Street is a game exploring how small changes to a city affect the movement of drivers, cyclists, transit users, and pedestrians. It works anywhere in the world, thanks to OpenStreetMap.

Show, don't tell

Alpha release trailer

Find a problem:

exploring_traffic

Make some changes:

editing_map

Measure the effects:

evaluating_impacts

Documentation

Roadmap and contributing

See the roadmap for current work, including ways to help. If you want to bring this to your city or if you're skilled in design, traffic simulation, data visualization, or civic/government outreach, please contact Dustin Carlino at [email protected]. Follow r/abstreet for weekly updates or @CarlinoDustin for occasional videos of recent progress.

Project mission

If you fix some traffic problem while playing A/B Street, my ultimate goal is for your changes to become a real proposal for adjusting Seattle's infrastructure. A/B Street is of course a game, using a simplified approach to traffic modeling, so city governments still have to evaluate proposals using their existing methods. A/B Street is intended as a conversation starter and tool to communicate ideas with interactive visualizations.

Why not leave city planning to professionals? People are local experts on the small slice of the city they interact with daily -- the one left turn lane that always backs up or a certain set of poorly timed walk signals. Laura Adler writes:

"Only with simple, accessible simulation programs can citizens become active generators of their own urban visions, not just passive recipients of options laid out by government officials."

Existing urban planning software is either proprietary or hard to use. A/B Street strives to be highly accessible, by being a fun, engaging game. See here for more guiding principles.

Credits

Core team:

Others:

Data:

Comments
  • Visualizing low-traffic neighborhoods and gated communities

    Visualizing low-traffic neighborhoods and gated communities

    Today, there are two types of roads colored pink.

    Screenshot from 2021-05-21 14-06-49 This is a gated/private community in Seattle called Broadmoor. There's a physical gate surrounding this neighborhood; you have to show an ID to a guard to walk or drive in.

    Screenshot from 2021-05-21 14-08-40 This is a Stay Healthy Street in Seattle. Also called "play street", "living street", "low traffic neighborhood" in different parts of the world. People can drive through there only if they live on that street, or they're making deliveries. Pedestrians and bicycles and people playing outside are supposed to be the main use. They usually have some kind of sign or barrier at the entrances: 960x0

    We should probably depict these differently. The pink color isn't meaningful at all. We have the unzoomed view, shown above, and also the zoomed-in detail view like this: Screenshot from 2021-05-21 14-11-20

    Maybe we could have a simple 2D top-down rendering of a barrier or a gatehouse? For the unzoomed view, I'm not sure what to do.

    @trangrei

    design-needed 
    opened by dabreegster 53
  • Make crosswalks bidirectional

    Make crosswalks bidirectional

    For issue #813

    Problems:

    • ~~Currently crashing in map_model::objects::traffic_signals::Stage::max_crosswalk_time failing to find a movement in i.movements~~
    • I added PathStep::ContraflowTurn mostly by adding it to the enum and then fixing all the non-exhaustive pattern errors, which means I likely missed some matches which use _.
    • I haven't touched pathfinder v2 yet, notably into_v1_walking would likely generate TurnIDs which do not correspond to any Turn

    other TODOs:

    • Degenerate intersections still have two crosswalks (they had four before?). Do they not have SharedSidewalkCorners?
    • Once all duplicate crosswalks are not being created, remove other_crosswalk_ids and its one reference.
    opened by mdejean 42
  • better default

    better default "random" traffic patterns

    see https://github.com/dabreegster/abstreet/issues/154#issuecomment-658026415 for current plans

    see https://github.com/dabreegster/abstreet/issues/205#issuecomment-660707593 for warp hint


    sim/src/make/generator.rs contains code for generating trips

    See https://github.com/dabreegster/abstreet/pull/183/files for related code

    See https://github.com/dabreegster/abstreet/commit/ead4a99682d11ec4af4824a1ab4c3854bae7b0d4 for related code


    I have no idea how "random" traffic generation works, but currently it results in poor results for large maps.

    Initial traffic at midnight seemed reasonable (maybe bicycle traffic was too high and bus traffic was too low), but later instead of ramping up it started dropping!

    I expected game melting down/crashing on attempting to simulate tens (hundreds?) thousands of active trips at once rather than drop to zero active trips.

    EDIT: yes, it is a prime example of not reading warnings. Random is described to behave in this way - see https://github.com/dabreegster/abstreet/commit/da1731ccb2d549ed95516de76881ab53f67e8dd3#diff-628ee6879bfcdd889804ae5371c9a26cR223

    good first issue 
    opened by matkoniecz 28
  • Quick prototype of Streetcomplete colors and an explicit curb

    Quick prototype of Streetcomplete colors and an explicit curb

    This is a followup to @westnordost's suggestion in #704 to draw a more explicit curb between the road and sidewalk. I incorporated a few more ideas here too, pulling lots of colors from Streetcomplete (https://user-images.githubusercontent.com/7988080/103153247-827c1f00-478f-11eb-9d1f-4d12017533aa.png) and also its map style (https://raw.githubusercontent.com/ENT8R/streetcomplete-mapstyle/gh-pages/images/light.png). I'm really liking how things are looking and am considering a big color overhaul based around this. Any initial feedback? @Robinlovelace, @michaelkirk, @trangrei

    Some of the changes:

    • Using Streetcomplete colors for the map background, water, parks, unzoomed roads
    • Drawing a bold line between the road and curb. (There are some bugs near intersections that I'll fix if we decide to push forward with this style.)
    • Use Streetcomplete color for zoomed-in lanes
    • Stop coloring intersections and parking lanes a different color. It usually doesn't match reality; just show paved surface, and add markings on top of that.

    If we go forward with this, there's lots of code simplification I'll do, and rethinking the styling for bike/bus lanes, access-restricted roads, night mode, etc. Also need to make sure layers and agents look good on this scheme.

    We could also just incorporate a few of the ideas -- the color changes and adding the curb could be independent steps.

    Before: Screenshot from 2021-07-23 13-04-15 After: Screenshot from 2021-07-23 13-04-24

    Before: Screenshot from 2021-07-23 13-03-38 After: Screenshot from 2021-07-23 13-03-19

    Before: Screenshot from 2021-07-23 13-05-46 After: Screenshot from 2021-07-23 13-05-39

    opened by dabreegster 25
  • Create new lane types to express different types of buffers for prote…

    Create new lane types to express different types of buffers for prote…

    …cted bike lanes. They're only created manually right now, to explore rendering.

    The goal is to start modeling different types of bike lanes -- some are right in the door-zone of street parking, others have flimsy little flex posts protecting from cars, but some have proper barriers in place. Eventually we'll use this in the routing and simulation layer. But the goal for this PR is actually just to explore the rendering style.

    I've started with 4 types of barriers, but happy to add more!

    For each of these, any better ideas for visualizing in our top-down view?

    Stripes

    Top-down rendering: Screenshot from 2021-07-16 14-50-25 Reference: buffered-bike-lane_street_0

    Flex posts ("wands" in the UK)

    Rendering: Screenshot from 2021-07-16 14-51-45 Reality: bikes_lanes_slider

    Planters

    Rendering: Screenshot from 2021-07-16 14-52-52 Reality: 2016_0211_2ndAvePioneerSquareFlyer-concept

    Jersey barrier

    Rendering: Screenshot from 2021-07-16 14-54-00 Reality: bikelane-protected-jersey-barrier-flushing-ave--fortheloveofbikes-thumb

    Next steps

    There's more work needed to create/modify these properly in the road editor UI. I also want to start tagging these in OSM, and then importing into A/B Street. https://wiki.openstreetmap.org/wiki/Berlin/Verkehrswende/Radwege#Tagging-Beispiele seems to have some traction.

    opened by dabreegster 19
  • Levenshulme LTN

    Levenshulme LTN

    In collaboration with the University of Manchester, we're trying to initially apply the LTN tool to study the Levenshulme LTN. Urban Observatory has sensors measuring air quality, pedestrian counts, and vehicle counts in the area. There should be data both before and after the LTN was put in. So, the goal is to take the LTN's impact prediction about short-term detours, and compare it to the real observations.

    What exactly is the LTN scheme?

    We'll need a map representation before and after the scheme was put in.

    • [ ] Find a definitive boundary
    • [ ] Find the location of the filters
    • [ ] If recent OSM edits have picked up the LTN, transform the small bike-only segments into filters, so they can be manipulated in the tool

    From https://s3-eu-west-2.amazonaws.com/commonplace-customer-assets/levenshulmeandburnageactiveneighbourhood/FAQ%20Design%20Detail.pdf: Screenshot from 2022-01-31 13-37-52

    https://secure.manchester.gov.uk/info/200024/consultations_and_surveys/8009/levenshulme_and_burnage_active_neighbourhood/3 lists 14 filter locations

    When were the filters installed? (And double check -- do we have counts from before that?)

    opened by dabreegster 17
  • Importing OSM data for London

    Importing OSM data for London

    Hi, your progress with the LTN Tool is exciting and it's already potentially useful. London UK is a focus of a lot of effort in planning LTNs.

    As you may know, London is administered as 33 boroughs that act as separate cities for most road planning. My own borough is Camden https://www.openstreetmap.org/#map=13/51.5428/-0.1809. It would be great to get the OSM data for Camden imported to AB Street. I'd be happy to designate the area or to download the relevant section of the OSM database.

    Once knowledge of the LTN Tool spreads I imagine there will be demands from quite a few other London boroughs too. Does it make sense to import the OSM data for all of Greater London (http://download.geofabrik.de/europe/great-britain/england/greater-london.html)?

    opened by georgio8 17
  • Import all service roads

    Import all service roads

    Separate cyclepaths like https://www.openstreetmap.org/way/54563641 excluded; let's try enabling them.

    https://www.openstreetmap.org/way/4188078 has cycleway:left, but it winds up on the right -- I think the left-hand driving side needs some fixes here.

    opened by dabreegster 17
  • Font problem or a missing language setting?

    Font problem or a missing language setting?

    I built the simulation game from source. After starting the simulation, i see a mix of readable text and non-readable pixels, where i assume, another text should be visible. Is there a missing font or do i have to define a prefered language for the game? abstreet_fontproblem

    opened by okilimu 17
  • Adding support for other cities

    Adding support for other cities

    What's involved with this? It's not just converting the OSM data right? Are locations hardcoded in somewhere? My city has terrible street traffic. I'd love to modify this to support other cities easily.

    opened by taybin 17
  • Import Münster (Germany)

    Import Münster (Germany)

    Hi,

    great project!

    I tried to import my hometown, Münster in Germany. I used the (unzipped) .osm file downloaded from bbbike.org. I tried to import this with the following command:

    ./import.sh --oneshot=Muenster.osm
    
    

    The import fails with this error.

    thread 'main' panicked at 'No bus route from Position(Lane #102018, 27.2693m) to Position(Lane #86195, 7.4311m) now for Bus 329: Sendenhorst, Realschule => Hoetmar, Hagenhoff! Prevent this edit', map_model/src/pathfind/walking.rs:329:17
    

    This might be related to #190, but I didn't investigate any further beyond this error message. I got the same error with a manual bounding box download from bbbike.org, though.

    opened by silberzwiebel 14
  • Bump tokio from 1.19.2 to 1.20.3

    Bump tokio from 1.19.2 to 1.20.3

    Bumps tokio from 1.19.2 to 1.20.3.

    Release notes

    Sourced from tokio's releases.

    Tokio v1.20.2

    1.20.2 (September 27, 2022)

    This release removes the dependency on the once_cell crate to restore the MSRV of the 1.20.x LTS release. (#5048)

    #5048: tokio-rs/tokio#5048

    Tokio v1.20.1

    1.20.1 (July 25, 2022)

    Fixed

    • chore: fix version detection in build script (#4860)

    #4860: tokio-rs/tokio#4860

    Tokio v1.20.0

    1.20.0 (July 12, 2022)

    Added

    Changed

    • time: remove src/time/driver/wheel/stack.rs (#4766)
    • rt: clean up arguments passed to basic scheduler (#4767)
    • net: be more specific about winapi features (#4764)
    • tokio: use const initialized thread locals where possible (#4677)
    • task: various small improvements to LocalKey (#4795)

    Fixed

    Documented

    • fs: warn about performance pitfall (#4762)
    • chore: fix spelling (#4769)
    • sync: document spurious failures in oneshot (#4777)
    • sync: add warning for watch in non-Send futures (#4741)
    • chore: fix typo (#4798)

    Unstable

    • joinset: rename join_one to join_next (#4755)
    • rt: unhandled panic config for current thread rt (#4770)

    #4677: tokio-rs/tokio#4677 #4741: tokio-rs/tokio#4741 #4755: tokio-rs/tokio#4755 #4758: tokio-rs/tokio#4758 #4762: tokio-rs/tokio#4762

    ... (truncated)

    Commits
    • ba81945 chore: prepare Tokio 1.20.3 release
    • 763bdc9 ci: run WASI tasks using latest Rust
    • 9f98535 Merge remote-tracking branch 'origin/tokio-1.18.x' into fix-named-pipes-1.20
    • 9241c3e chore: prepare Tokio v1.18.4 release
    • 699573d net: fix named pipes server configuration builder
    • 3d95a46 chore: prepare Tokio v1.20.2 (#5055)
    • 2063d66 Merge 'tokio-1.18.3' into 'tokio-1.20.x' (#5054)
    • 5c76d07 chore: prepare Tokio v1.18.3 (#5051)
    • 05e6614 chore: don't use once_cell for 1.18.x LTS release (#5048)
    • c0746b6 chore: prepare Tokio v1.20.1 (#4861)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Embed osm2streets in map_model

    Embed osm2streets in map_model

    Currently the raw_map layer embeds osm2streets StreetNetwork, just adding A/B Street-specific stuff in addition (buildings, areas, transit routes, and things like crosswalks & modal filters that aren't yet in osm2streets). But then the map_model layer, which is used by the traffic sim and all the apps, has its own representation for roads and intersections, and all the osm2streets stuff is gone. This was OK to start, but it's starting to get a bit tricky:

    • A/B Street edits lane specs and needs to regenerate geometry and movements, so we have an adapter kind of hack around it now
    • Rendering code is starting to be duplicated between map_gui and osm2streets. And then again in #1038 for Bevy
    • There are some osm2streets API concepts like RoadEdge that'd be useful to use over here now, but they're not easy to get at

    I'd like to explore options for embedding StreetNetwork inside map_model::Map too. Reasons to be wary of this:

    • Keeping serialized file size small and loading times quick for large maps is important, potentially at the expense of code readability / API niceness
    • the API surface of Lane, Road, Intersection is huge and messy
    • Keeping some indirection / wrapper between osm2streets and here is a good idea for evolving the two codebases at different speeds

    Another vague idea is to embed osm2streets::{Road, Intersection} structs inside of A/B Street equivalents, and keep a few extra fields over on this side

    CC @BudgieInWA

    opened by dabreegster 1
  • Add to Taginfo Projects

    Add to Taginfo Projects

    Show the OpenStreetMap community what data you are using. Add your project to the list of Taginfo Projects.

    (you may provide multiple, i.e. if there is different themed layers. or -if possible- for Streetmix)

    opened by danieldegroot2 2
  • Window height resized to 600px after loading

    Window height resized to 600px after loading

    Platform: Linux (ArchLinux, Gnome 43.2, Wayland)

    When starting the game with RUST_LOG=trace RUST_BACKTRACE=1 cargo run --bin game -- --dev, I observe the following behaviour:

    • the window starts with a 800x600px size, then goes full screen, and then down to 1920x600px
    • according to the window decoration, it's always maximized, so you have to click twice on the "maximize" icon to go to full screen after that.

    Here are some relevant logs:

    [2022-12-15T23:45:31Z WARN  widgetry::runner] Monitor scale factor is 1, screen window is 800, but the application requires 1500. Overriding the scale factor to 1.
    [2022-12-15T23:45:31Z TRACE widgetry::runner] winit event says the window was resized from 800, 600 to ScreenDims { width: 1920.0, height: 1013.0 }. But inner size is ScreenDims { width: 1920.0, height: 1013.0 }, so using that
    [2022-12-15T23:45:33Z TRACE widgetry::runner] winit event says the window was resized from 1920, 1013 to ScreenDims { width: 1920.0, height: 600.0 }. But inner size is ScreenDims { width: 1920.0, height: 600.0 }, so using that
    

    I'm not sure why the initial window is 800x600px. From what I understand, the issue likely lies in glutin, but that crate was completely rewritten recently, so if there's a bug there it's not going to get fixed.

    It looks like updating glutin isn't a straightforward task.

    opened by matthieu-foucault 2
  • LTN tutorial mode

    LTN tutorial mode

    Madison designed an interactive tutorial mode for the LTN tool, but I haven't found time to implement it yet. If someone's not afraid of the slightly odd UI library A/B Street uses, it could be a fun medium-sized starter project. The design can be found at https://www.figma.com/file/HxSNM2146bcb0P0bNlW0x1/LTN-Working-Station-V2?node-id=5369%3A5464&t=cE5ZYUOuSsUMKwl2-0. Some samples: Screenshot from 2022-12-08 12-58-34 Screenshot from 2022-12-08 12-58-21 Embedding a second view of the map canvas is a bit advanced, but something we've figured out before. If anyone's interested in implementing, I can help flesh out smaller tasks and figure out how to structure the code.

    CC @matthieu-foucault as an option I forgot from the other list

    good first issue 
    opened by dabreegster 1
Releases(v0.3.37)
Owner
A/B Street
A traffic simulation game exploring how small changes to roads affect cyclists, transit users, pedestrians, and drivers.
A/B Street
Geospatial primitives and algorithms for Rust

geo Geospatial Primitives, Algorithms, and Utilities The geo crate provides geospatial primitive types such as Point, LineString, and Polygon, and pro

GeoRust 989 Dec 29, 2022
Blazing fast and lightweight PostGIS vector tiles server

Martin Martin is a PostGIS vector tiles server suitable for large databases. Martin is written in Rust using Actix web framework. Requirements Install

Urbica 921 Jan 7, 2023
Geospatial primitives and algorithms for Rust

geo Geospatial Primitives, Algorithms, and Utilities The geo crate provides geospatial primitive types such as Point, LineString, and Polygon, and pro

GeoRust 990 Jan 1, 2023
Zero-Copy reading and writing of geospatial data.

GeoZero Zero-Copy reading and writing of geospatial data. GeoZero defines an API for reading geospatial data formats without an intermediate represent

GeoRust 155 Dec 29, 2022
TIFF decoding and encoding library in pure Rust

image-tiff TIFF decoding and encoding library in pure Rust Supported Features Baseline spec (other than formats and tags listed below as not supported

image-rs 66 Dec 30, 2022
OpenStreetMap flatdata format and compiler

osmflat Flat OpenStreetMap (OSM) data format providing an efficient random data access through memory mapped files. The data format is described and i

null 31 Dec 7, 2022
Calculates a stars position and velocity in the cartesian coordinate system.

SPV Calculates a stars position and velocity in the cartesian coordinate system. Todo Expand the number of available operation Batch processing by tak

Albin Sjögren 11 Feb 18, 2022
Didactic implementation of the type checker described in "Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism" written in OCaml

bidi-higher-rank-poly Didactic implementation of the type checker described in "Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorph

Søren Nørbæk 23 Oct 18, 2022
A single-binary, GPU-accelerated LLM server (HTTP and WebSocket API) written in Rust

Poly Poly is a versatile LLM serving back-end. What it offers: High-performance, efficient and reliable serving of multiple local LLM models Optional

Tommy van der Vorst 13 Nov 5, 2023
A set of tools for generating isochrones and reverse isochrones from geographic coordinates

This library provides a set of tools for generating isochrones and reverse isochrones from geographic coordinates. It leverages OpenStreetMap data to construct road networks and calculate areas accessible within specified time limits.

null 3 Feb 22, 2024
Abstreet - Transportation planning and traffic simulation software for creating cities friendlier to walking, biking, and public transit

A/B Street Ever been stuck in traffic on a bus, wondering why is there legal street parking instead of a dedicated bus lane? A/B Street is a project t

A/B Street 6.8k Jan 9, 2023
MASQ Network 121 Dec 20, 2022
LayerCake: An insured-in-transit cross-network composability protocol

LayerCake: An insured-in-transit cross-network composability protocol The key features of LayerCake are: Instant transfers as opposed to the delayed t

Flare Labs 5 Jul 27, 2023
💫 Small microservice to handle state changes of Kubernetes pods and post them to Instatus or Statuspages

?? Kanata Small microservice to handle state changes of Kubernetes pods and post to Instatus ?? Why? I don't really want to implement and repeat code

Noel ʕ •ᴥ•ʔ 4 Mar 4, 2022
WIP / POC for using the ESP32C3 and ESP32 wifi drivers in bare-metal Rust

Wifi on ESP32C3 and ESP32 (on bare-metal Rust) About This is experimental and work-in-progress! You are welcome to experiment with it and contribute b

esp-rs 135 Jan 2, 2023
Examples on how to write Windows kernel drivers in Rust

windows-kernel-rs Note: this is still work in progress! This is a Windows kernel framework in Rust that consists of windows-kernel-sys, a crate that p

S.J.R. van Schaik 77 Dec 28, 2022
Rust drivers for the SIM7000 series of modems

sim7000 This crate provides drivers for the SIM7000 series of chips. The current code implements enough commands to bring up a TCP connection and run

The Techno Creatives 11 Dec 29, 2022
WIP / POC for using the ESP32C3 wifi drivers in bare-metal Rust

Wifi on ESP32C3 (on bare-metal Rust) About This is experimental and work-in-progress! You are welcome to contribute but probably shouldn't use this fo

Björn Quentin 135 Jan 2, 2023
Rust port of the official Windows Driver Samples on Github. Leverages windows-drivers-rs

Rust Driver Samples This is a Rust port of the driver samples from the original Windows Driver Samples on Github. The repository provides examples and

Microsoft 80 Oct 10, 2023
Fish Game for Macroquad is an online multiplayer game, created as a demonstration of Nakama, an open-source scalable game server, using Rust-lang and the Macroquad game engine.

Fish Game for Macroquad is an online multiplayer game, created as a demonstration of Nakama, an open-source scalable game server, using Rust-lang and the Macroquad game engine.

Heroic Labs 130 Dec 29, 2022