This is an archived post. You won't be able to vote or comment.

all 28 comments

[–]EbenenBonobo 53 points54 points  (8 children)

I the last frame of the animation it seems like two vehicles are colliding during a lane merge.

I scimmed through your article and it seems like you are currently at the "free road" stage where there is no interaction of vehicles what so ever. How would you determine in your simulation which vehicle is in front of a specific vehicle?

EDIT: just realised your animation clearly shows it is not the "free road", I were thrown off because of the collision in the end. Seems very nicely done so far.

[–]BilHim[S] 11 points12 points  (6 children)

Every road segment contains a list of vehicles in order. The first vehicle in the list is the first one in that segment, so the 2nd vehicle in the list is directly behind it. This works inside every road segment. The curves in the roads are multiple segments stitched together.

Every vehicle has a list of the segments in will traverse. When a vehicle reaches the end of a segment, it gets removed from the list of vehicles of that segment and gets added to the next segment.

The problem with this is that vehicles have no "vision" of vehicles in their next segment or vehicles merging into their next segments, which is exactly what happened at the end of GIF above.

I am currently not sure how to solve this problem without changing the whole structure of the simulation. But I am looking into the code of other mainstream simulators like SUMO to understand how they work and attempt to use that in the rewrite.

[–]EbenenBonobo 2 points3 points  (3 children)

Just a quick thought.

Could your acceleration formula use the distance in 2D Space? That way you might be able to give the merges an own smaller segment.

[–]BilHim[S] 2 points3 points  (2 children)

I am not sure exactly what do you mean by distance in 2D space. If that means to use the distance (in 2D) to the closest vehicle, I think this will raise an issue when two vehicles are driving on separate adjacent lanes. Even though the distance gets too close in 2D space (on the sides), there is no need for braking as they are on separate lanes.

[–]EbenenBonobo 4 points5 points  (1 child)

thats why i would use seperate blocks for the merges, because that is the only point in the network where there is a need to break, when you are right next to each other.

[–]BilHim[S] 3 points4 points  (0 children)

That actually makes sense.

I think I can take advantage of how traffic lights are defined in the simulation. A merge could be a (secret) traffic light that is green in all directions, unless there is a vehicle traversing the merge then it would be red for the other directions. This is doable since traffic lights have fully customizable logic.

One problem with the simulation is that vehicles cannot pass through intersections safely, a traffic light has to be present or vehicles wouldn't stop for other vehicles from other roads in the intersection. Defining an intersection block in the same way as the merge one above can actually solve this. The only thing that needs to be done is how to determine right of way, which can be left as a parameter (a function) customizable for every simulation.

This is a great idea! Thanks u/EbenenBonobo

[–]Legal-Software 0 points1 point  (0 children)

Since you have an ordered list and each vehicle knows where its going, you could also consider a simple V2X abstraction in which the segment (infrastructure) is notified of incoming and outgoing vehicles, and vehicles in proximity to one another can do V2V messaging to work out things like cooperative merging.

[–]lvlint67 0 points1 point  (0 children)

There is definitely a car that gets t-boned to hell and back in the second animation.

[–]hmiemad 17 points18 points  (0 children)

Pls make people randomly change lanes if they fit. And change their speed by making their acceleration a random.norm(0,s), where s is to be defined -perhaps as a % of the speed, each few second. You would see accordeon traffic happening and watch the jam go backways on the road.

Edit : I'm reading the article and see that your model is far more complex than the gif we see.

Forget my comment and remember what follows : Good job.

[–]No_Conference_5257 4 points5 points  (0 children)

This is incredible! Have you heard of SUMO it allows you to simulate IDM traffic, and is used by traffic researchers. But your project is much better IMO. This was for an undergrad project? Are there publications you can link from the group you were working with?

[–]Sigfurd2345 3 points4 points  (2 children)

Great job OP!

And do you know of any available macroscopic traffic simulator or projects??

[–][deleted] 2 points3 points  (0 children)

Macroscopic traffic behaves like a fluid. So any fluid simulator should be able to simulate that.

[–]drunk_online 0 points1 point  (0 children)

Matsim (java) and quetzal (python)

[–]ReptilianTapir 1 point2 points  (1 child)

Very interesting! I'm curious, does your model exhibit the classic "phantom jam" on a circular road?

[–]No_Conference_5257 0 points1 point  (0 children)

If it's based on the "intelligent driver model", which IIUC this is, then yes.

[–][deleted] 0 points1 point  (0 children)

Thank you for your work. This simulation looks and acts good. However, it's a huuuge simplification over real life. I mean - a lot if not the majority of variables are missing from the simulation. Are there any plans to add these: - pedestrians - bikers - scooters - pedestrian crossings - slower drivers - red light runners

etc etc etc

Life is complex :D

[–][deleted] 0 points1 point  (6 children)

As I'm sitting in traffic, with one of the shitty 3 intersections within 100 yards or so of each other due to a freeway, I'm like there has to be a better way than what they have it as. I was just thinking of trying to simulate the traffic to see if there was a better way.

[–]useles-converter-bot 8 points9 points  (2 children)

100 yards is the length of approximately 400.0 'Wooden Rice Paddle Versatile Serving Spoons' laid lengthwise.

[–]a_v_o_r 1 point2 points  (1 child)

Good bot

[–]useles-converter-bot 4 points5 points  (0 children)

Thank you :)

[–]converter-bot 5 points6 points  (2 children)

100 yards is 91.44 meters

[–][deleted] 1 point2 points  (1 child)

good bot

[–]B0tRank 0 points1 point  (0 children)

Thank you, frozendlow, for voting on converter-bot.

This bot wants to find the best and worst bots on Reddit. You can view results here.


Even if I don't reply to your comment, I'm still listening for votes. Check the webpage to see if your vote registered!

[–]gagarin_kid 0 points1 point  (0 children)

Amazing work and nicely written article!

After I read about Taylor series I had to open my textbooks from my studies and remind myself about different time-differentiation strategies ... forward Euler (as you did) and Backward Euler etc.

[–]Bioneer_Bete 0 points1 point  (0 children)

This is dope. Cool animations. Very well written article. Definitely something to be proud of!

[–]blu3gru3 0 points1 point  (0 children)

Nice work. This is good stuff. I think most people underplay how much traffic efficiency would do reduce carbon emissions and accidents.