a-b-street / abstreet

Transportation planning and traffic simulation software for creating cities friendlier to walking, biking, and public transit
https://a-b-street.github.io/docs/
Apache License 2.0
7.75k stars 345 forks source link

Ghost biking #829

Open dabreegster opened 2 years ago

dabreegster commented 2 years ago

Right now, bikes act just like cars in the simulation -- they queue behind each other, and vehicles queue behind them. There is practically no lane-changing in the simulation, so lots of things wind up quite unrealistic:

Improving the lane-changing model and attempting the same level of realism it has currently is... unlikely to happen in the foreseeable future. Also, treating lanes as discrete objects ignores reality. Lots of roads don't have a marked center-line and designated lanes and shoulders; sometimes there's room for a car to squeeze past a bike on the shoulder, sometimes they dip into oncoming traffic a bit. Until we have real road width data, there's not really a way we could even hope to model all this variation.

Based on recent conversations with @Robinlovelace about the goals for A/B Street's traffic simulation and the amount of realism that's useful, I think we've decided it'd be nice to try something much simpler. Pedestrians can "ghost" through each other; let's treat bikes the same way. This means:

Rendering-wise, this will look quite weird -- probably have to make sure the Z-order is consistent between frames, at least.

Maybe a slightly more complex, but useful, model is to note when a bike is overlapping part of a lane with any other vehicle, and 1) adjust the rendering somehow, and 2) adjust the speed of both vehicles somehow.

Robinlovelace commented 2 years ago

Thinking about when bikes stop. Worth adding a 'jitter' to the stop line so they don't all pile up bang on the traffic light? Or perhaps better, instead of bikes queuing 1 bike length apart set that to 0.3 bike lengths apart to simulate bikes 3 abreast.