Live data from Hacker News

Abstreet: Traffic simulation game written in Rust

github.com

41–50 of 77 posts

Re: Abstreet: Traffic simulation game written in Rust

#41

Hi, author here! Didn't intend for this to wind up on HN quite yet, but I'm excited to answer the good questions coming up here.

Question from a completely clueless perspective. The points you mention I always have and I have been wondering where to simulate it and get numerical answers to all those behaviors that can be infuriating. In your seattle full map you say you heuristically got the time for the lights, but where is that coming from exactly, like would it be possible to infer that for another city from some kind of public data. Is it in the domain of science fiction, there are so many parameters to take in account so it probably is impossible, that you could model the usual behavior of commuters in a city and then simulate whether the current traffic lights are set for the right length of time. I suppose some are updated live to react to traffic jams but in these circumstances there could also be way to simulate how shifting times would be the best to refluidify the traffic, instead of just going with brute force and empirical intuition which I assume is how it works most of the time.

Re: Abstreet: Traffic simulation game written in Rust

#42
Very impressive simulation! For others unfamiliar with the term "lane sweeping", it means crossing/changing a lane during a turn. You must turn into the lane closest to you. https://cherinlawfirm.com/2018/01/what-is-lane-sweeping-and-...

(It's scary thinking a half-mile traffic jam starts at 4am... and I can't help but wonder what it looks like at more sane hours such as 8:30am or 5:15pm. Is everything just red for miles around?)

Re: Abstreet: Traffic simulation game written in Rust

#43
post #20

This is pretty cool! One thing that bothers me about every traffic simulation I've ever seen, though: all of the vehicles and pedestrians here seem to be obeying the law. That's just not realistic -- especially on Mercer, which is blocked (both directions) every few minutes in rush hour by some jerk trying to make an illegal turn onto a packed street. I'd say the main causes of traffic blockages that I encounter duri…

Another thing I'd be interested in seeing modeled are the people who squeeze into an exit lane at the very last minute. I've only ever commuted in the LA area but it's one of the biggest contributors to traffic by the freeway interchanges.

Re: Abstreet: Traffic simulation game written in Rust

#44
post #43
post #20

This is pretty cool! One thing that bothers me about every traffic simulation I've ever seen, though: all of the vehicles and pedestrians here seem to be obeying the law. That's just not realistic -- especially on Mercer, which is blocked (both directions) every few minutes in rush hour by some jerk trying to make an illegal turn onto a packed street. I'd say the main causes of traffic blockages that I encounter duri…

Another thing I'd be interested in seeing modeled are the people who squeeze into an exit lane at the very last minute. I've only ever commuted in the LA area but it's one of the biggest contributors to traffic by the freeway interchanges.

There are studies that show merging late actually reduces congestion:

https://www.nytimes.com/2016/10/13/us/why-last-second-lane-m...

Re: Abstreet: Traffic simulation game written in Rust

#45
post #20

This is pretty cool! One thing that bothers me about every traffic simulation I've ever seen, though: all of the vehicles and pedestrians here seem to be obeying the law. That's just not realistic -- especially on Mercer, which is blocked (both directions) every few minutes in rush hour by some jerk trying to make an illegal turn onto a packed street. I'd say the main causes of traffic blockages that I encounter duri…

I agree with you. However, this may be obvious, but some of that could be due to people trying to follow Google Maps, Waze, or other similar navigation system directions where the routes are generated based on what other users have done. I drove in downtown Seattle rush "hour" traffic for the first time in almost a year earlier this week, and Maps was giving me all kinds of dangerous, traffic-jam-causing directions.…

> it's not just drivers ignoring the law

It is. If a driver comes across the situation you described, any action other than a right-hand turn means they should probably take a driver's ed course again. Regardless of what a robotic voice on their phone is telling them.

Google maps once instructed my wife to do a U-turn on Lakeshore Drive. Nope.

Re: Abstreet: Traffic simulation game written in Rust

#46
post #20

This is pretty cool! One thing that bothers me about every traffic simulation I've ever seen, though: all of the vehicles and pedestrians here seem to be obeying the law. That's just not realistic -- especially on Mercer, which is blocked (both directions) every few minutes in rush hour by some jerk trying to make an illegal turn onto a packed street. I'd say the main causes of traffic blockages that I encounter duri…

I agree with you. However, this may be obvious, but some of that could be due to people trying to follow Google Maps, Waze, or other similar navigation system directions where the routes are generated based on what other users have done. I drove in downtown Seattle rush "hour" traffic for the first time in almost a year earlier this week, and Maps was giving me all kinds of dangerous, traffic-jam-causing directions.…

> instructing drivers to break the law

And the process for reporting a map error or unsafe maneuver instruction is way too complicated to do while moving, but can't be done after you've left the area, and there's no function to just submit a voice note.

Related:

Some time back, I gave my old TomTom to a not-very-technically adept friend. I figured a little introduction was in order, and at first, I asked her to interact with the unit while I did the driving.

The first thing I did was ignore every instruction. A few minutes of https://xkcd.com/1837/ ensued.

Because I wanted to drive home the point, you won't break it by ignoring it. If you don't feel like making that turn, don't make it. The voice in the box will just recalculate, it won't get annoyed, it has infinite patience and can recalculate for as many maneuvers as you feel like missing.

This is a crucial bit of understanding that I think many drivers lack, as they blindly try to follow impossible or unsafe maneuvers like the computer's word must be obeyed absolutely.

If I had a button which could project thoughts into other people's minds, but _only one thought_ and once programmed the button can never be changed, I think I might set it to "It's okay, just go past it, turn around, and come back." I think a huge fraction of traffic snarls could be eased by spamming the hell out of such a button.

Re: Abstreet: Traffic simulation game written in Rust

#47

Very impressive simulation! For others unfamiliar with the term "lane sweeping", it means crossing/changing a lane during a turn. You must turn into the lane closest to you. https://cherinlawfirm.com/2018/01/what-is-lane-sweeping-and-... (It's scary thinking a half-mile traffic jam starts at 4am... and I can't help but wonder what it looks like at more sane hours such as 8:30am or 5:15pm. Is everything just red for m…

The jam is probably not realistic. Because that area is a divided set of one-way roads, there are a few intersections each tagged with a traffic signal in OpenStreetMap. I'm simulating each signal independently right now. In reality, it's one signal with more reasonable timing.

(Also sorry for the slow replies, HN is rate-limiting comments because this is a new account.)

Re: Abstreet: Traffic simulation game written in Rust

#48

Nice work! How would I go about to use it for my own city?

In theory, https://github.com/dabreegster/abstreet/blob/master/docs/new.... There are a bunch of unsolved problems -- for example, most places in OSM don't map on-street parking, so there won't be any. For Seattle, I'm inferring from an extra shapefile. Have to figure out how to generalize that.

Re: Abstreet: Traffic simulation game written in Rust

#49

Hi, author here! Didn't intend for this to wind up on HN quite yet, but I'm excited to answer the good questions coming up here.

Question from a completely clueless perspective. The points you mention I always have and I have been wondering where to simulate it and get numerical answers to all those behaviors that can be infuriating. In your seattle full map you say you heuristically got the time for the lights, but where is that coming from exactly, like would it be possible to infer that for another city from some kind of public data. Is it…

I don't have real traffic signal timing for Seattle. I'm waiting on a reply from some folks at SDOT and King County GIS.

In the meantime, I have heuristics like https://github.com/dabreegster/abstreet/blob/ed2f703e859d57d.... They're not great at all. If you're interested in improving these, https://github.com/dabreegster/abstreet/issues/8 is a great bug. ;)

Some traffic signals are adaptive (they'll switch phases sooner/later based on real-time vehicle detection, bus priority, etc) or even centrally controllable. I'm not modeling that yet.

Re: Abstreet: Traffic simulation game written in Rust

#50
post #45

Earlier quoted context omitted.

I agree with you. However, this may be obvious, but some of that could be due to people trying to follow Google Maps, Waze, or other similar navigation system directions where the routes are generated based on what other users have done. I drove in downtown Seattle rush "hour" traffic for the first time in almost a year earlier this week, and Maps was giving me all kinds of dangerous, traffic-jam-causing directions.…

> it's not just drivers ignoring the law It is. If a driver comes across the situation you described, any action other than a right-hand turn means they should probably take a driver's ed course again. Regardless of what a robotic voice on their phone is telling them. Google maps once instructed my wife to do a U-turn on Lakeshore Drive. Nope.

Yes, and driver's ed should harp on the concept of ignoring the sat-nav if it's telling you obnoxious things. See my other comment.

I don't think this concept is mentioned anywhere in the current curriculum, and I think a lot of people are ignorant enough of technology to obey it more blindly than they should.

Post reply on HN