ANTM in CARLA: Final Scenario

Chaotic, Indian-style traffic recreated in the CARLA simulator with the ANTM traffic model: which settings create it, and how much each one matters.

At a glance

The game changer: the keep-moving rule. On its own, ANTM makes a car stop whenever a neighbour edges into its space, even when the road ahead is open. With CARLA’s real car physics, those short stops turn into cars stuck waiting and frozen groups of traffic. The keep-moving rule is simple: if nothing is in a car’s own path, it doesn’t stop. In the final scenario, switching it off means cars push and wait far more (35 against 21 times per car per minute), traffic slows from 19 to 16 km/h, and there are 4 collisions. With it on, the same chaos flows smoothly with no crashes.

Why is it needed in CARLA, when the Python simulation works fine? In Python, cars change speed instantly, so when ANTM briefly says “stop” and then “go”, the car just keeps creeping forward. Real CARLA cars need time to brake and to pull away again, so that same stop-go flicker leaves them standing still, and the cars behind freeze too. With the same chaos settings, cars stand still 0.1% of the time in Python but around 22 to 34% in CARLA without the rule. Keep-moving only steps in when a car’s own path is clear; whenever something is actually in the way, ANTM’s decision is used unchanged. It doesn’t change ANTM’s driving logic; it makes real cars behave the way ANTM’s instant Python cars already do.

What changed compared with ANTM’s defaults

What makes the biggest impact, in order

  1. Keep-moving rule: keeps the chaos flowing instead of getting stuck, and crash-free.
  2. Number of cars: the biggest effect on how much overtaking there is; 20 cars overtake most, 45 or more jams.
  3. Lane-change willingness: the main control for how often drivers switch lines.
  4. Gap-search width: decides how big and bold the overtakes are.
  5. Car size: small cars slip through gaps easily; big cars push much more and bump into each other.
  6. Collision guard: keeps it all crash-free without reducing the chaos.
  7. Lines (3/7 vs 3/7/15) and car model mix: only small differences.

The goal

The idea was simple: make CARLA traffic feel like a busy Indian road. Cars squeezing into gaps, changing lines all the time, overtaking wherever there’s a bit of space, and somehow it all keeps moving. The ANTM traffic model drives the cars, and its settings were tuned to find out what actually creates that chaos.

That’s the final result in CARLA, seen from above (top half and bottom half of the road).

Starting point

Here’s the starting point for all the tests. Each test changes just one of these and leaves the rest alone.

Setting Value used ANTM’s default
Keep-moving rule on not in ANTM
Collision guard on not in ANTM
Gap-search width 6.5 m 1.25 m
Lane-change willingness -1.0 0.1
Lines on the road adaptive 3/7/15 adaptive 3/7/15
Car size ANTM uses 5.2 x 2.3 m 4 x 2 m
Number of cars 30 -
Car model all Tesla Model 3 (real size about 4.8 x 2.2 m) -

A few other things were tweaked too and stayed the same throughout: drivers try a random lane change quite often (0.5), speeds are a mix of slow (5-7 m/s) and fast (9-14 m/s) drivers with 40% slow ones, cars follow closely (0.5 s gap) and drivers are pretty aggressive.

Every car is the same model (Tesla Model 3), so the one car size ANTM uses fits every car equally.

How the tests work

How the numbers are measured

Nothing is judged by eye. During every CARLA run, three things are recorded automatically:

  1. A log file: every 0.05 s it saves each car’s position, sideways position, speed and what the driver is doing.
  2. ANTM’s own counters: how many lane changes were completed and how many times a driver started pushing into a gap.
  3. Collision sensors on every car.

The first 10 seconds are skipped while the cars settle in, so the numbers cover the last 30 seconds.

Number How it’s worked out
Lane changes Completed lane changes, divided by (number of cars x minutes)
Pushing into gaps Times a driver started pushing into a gap, divided the same way
Overtaking moves From each car’s sideways position: every sideways move of 1.2 m or more counts, divided the same way
Speed Average speed of all cars over the whole run, in km/h
Collisions Collision sensor hits; the same two cars touching within 1 second count once

Example: 30 cars measured for half a minute is 15 car-minutes. About 107 completed lane changes divided by 15 gives 7.1 lane changes per car per minute. Working per car per minute keeps runs with 20, 30 or 60 cars comparable.

Each number comes from one 40-second run. The same run repeated with different random starts shifts by about 1 lane change, so only bigger differences really mean something.

Results

Normal ANTM settings vs final scenario

First, the big picture. On top is ANTM with its normal settings; below is the final scenario. Same road, same 30 cars, same start.

Settings Lane changes Overtaking moves Pushing into gaps Speed Collisions
Normal ANTM 2.5 1.0 0.3 20 km/h 0
Final scenario 7.9 5.6 21.4 19 km/h 0

Takeaway: a completely different road. Normal ANTM is calm lane following. The final scenario changes lines about three times as often, makes over five times as many real overtaking moves and pushes into gaps all the time, yet it’s barely slower and has no collisions.

1. Keep-moving rule

What it does: if nothing is in a car’s way, the car doesn’t stop, even if ANTM wants it to. This is added in CARLA; it’s not part of ANTM.

Keep-moving Lane changes Overtaking moves Pushing into gaps Speed Collisions
Off 7.3 5.7 35.0 16 km/h 4
On (final) 7.9 5.6 21.4 19 km/h 0

Takeaway: lane changes stay about the same, but without the rule cars get stuck waiting much more: pushing into gaps jumps from 21 to 35, traffic slows from 19 to 16 km/h, and there are 4 collisions. With it on, the same chaos flows smoothly and safely.

2. Gap-search width

What it does: how far to the side a driver looks for a gap to jump into.

Width Lane changes Overtaking moves Pushing into gaps Speed Collisions
1.25 m (ANTM) 8.3 3.7 6.3 20 km/h 2
3.5 m 11.0 4.2 9.3 20 km/h 0
6.5 m (final) 7.9 5.6 21.4 19 km/h 0
8.5 m 9.8 7.5 14.4 21 km/h 0

Takeaway: the further drivers look, the bigger their overtaking moves: from 3.7 at ANTM’s 1.25 m to 7.5 at 8.5 m, with drivers cutting across several lines at once. 3.5 m gives the most lane changes. In this run 8.5 m came out a little better than 6.5 m on every number, so a wider search is worth trying in the final scenario.

3. Lane-change willingness

What it does: how much better a new line has to be before a driver bothers to move. Below zero, drivers switch lines even when it’s not really better, which is pretty much how Indian traffic works.

Willingness Lane changes Overtaking moves Pushing into gaps Speed Collisions
0.1 (ANTM) 5.9 4.4 10.5 22 km/h 0
-0.2 9.7 6.6 11.4 21 km/h 2
-1.0 (final) 7.9 5.6 21.4 19 km/h 0

Takeaway: drivers more willing than ANTM’s default change lines much more (5.9 up to 9.7). But very high willingness (-1.0) doesn’t add more: drivers try so often that they mostly end up pushing and waiting (21 pushes), which slows things down. -0.2 gave the most lane changes here, with 2 collisions.

4. Collision guard

What it does: looks about 1.2 seconds ahead, and if two cars are about to touch, it brakes one of them or straightens it out. This is added in CARLA; it’s not part of ANTM.

Guard Lane changes Overtaking moves Pushing into gaps Speed Collisions
Off 7.3 7.2 20.2 20 km/h 4
On (final) 7.9 5.6 21.4 19 km/h 0

Takeaway: without the guard there are 4 collisions and more than twice as many near misses (3.0 against 1.2 per car per minute). With it, the chaos is just as busy and nobody crashes.

5. Lines on the road: 3/7 vs 3/7/15

What it does: ANTM splits the road into imaginary lines instead of real lanes, and changes how many depending on traffic. With 3/7 it uses 3 or 7 lines. With 3/7/15 it can also go up to 15 lines, packed just 0.86 m apart, when things get crowded.

Lines Lane changes Overtaking moves Pushing into gaps Speed Collisions
3/7 6.6 6.7 13.3 20 km/h 0
3/7/15 (final) 7.9 5.6 21.4 19 km/h 0

Takeaway: a small difference. 3/7/15 adds more small lane changes and more pushing, so it looks busier. 3/7 gives slightly bigger moves with less pushing, so it looks cleaner.

6. Real car size: small, medium and big cars

What it does: the whole road is filled with one real CARLA car model, small, medium or big. ANTM is told each car’s real size plus the same small safety margin.

Cars Lane changes Overtaking moves Pushing into gaps Speed Collisions
Small: Nissan Micra (3.6 m) 7.0 7.0 5.3 20 km/h 0
Medium: Tesla Model 3 (4.8 m, final) 7.9 5.6 21.4 19 km/h 0
Big: Nissan Patrol (5.6 m) 8.6 6.0 36.8 18 km/h 10

Takeaway: car size changes how cars fight for space more than how often they change lines (7 to 8.6 is close to normal variation).

Why do the big cars crash? Three fixes were tried, and none of them removed the collisions:

Big cars (Nissan Patrol) Lane changes Pushing into gaps Collisions
As tested above 8.6 36.8 10
Bigger safety margin around each car 5.1 42.9 12
25 cars instead of 30 8.2 38.8 14
Collision guard told the real car size 6.7 64.4 18

So it isn’t simply a lack of space. The most likely reason is the big SUV’s own physics: it is heavier and steers and brakes differently, while ANTM and the car controls treat every car like a normal-sized one. In this crowded, aggressive traffic the SUVs can’t follow ANTM’s plan closely enough. Making big cars work would need their own vehicle settings, so the final scenario keeps medium cars, which stay crash-free.

7. Number of cars

What it does: just how many cars are put on the 201 m road.

Cars Lane changes Overtaking moves Pushing into gaps Speed Collisions
20 9.2 8.0 8.3 24 km/h 0
30 (final) 7.9 5.6 21.4 19 km/h 0
45 5.8 3.7 36.9 12 km/h 0
60 2.7 1.9 21.7 6 km/h 0

Takeaway: the more cars, the less room to overtake. 20 cars give the most lane changes and overtakes; 30 is busier, with lots of pushing into gaps, and still flows. At 45 cars traffic slows to 12 km/h, and at 60 it’s nearly gridlocked at 6 km/h.

8. Car models: a random mix vs all the same

What it does: either every car is a random CARLA model (small and big cars mixed), or every car is a Tesla Model 3.

Car models Lane changes Overtaking moves Pushing into gaps Speed Collisions
Random mix 8.9 6.2 19.2 20 km/h 0
All Tesla Model 3 (final) 7.9 5.6 21.4 19 km/h 0

Takeaway: hardly any difference; it’s within the normal run-to-run variation of about 1 lane change. Using one model mainly makes it easy to give ANTM the right car size.

Putting it all together

Setting What it does to the traffic Final value
Keep-moving rule Stops cars getting stuck: less waiting, faster, no crashes On
Collision guard Keeps the chaos crash-free On
Number of cars The more cars, the fewer overtakes; 45 or more jams 30
Lane-change willingness More willing drivers change lines much more, up to a point -1.0
Gap-search width Wider search gives bigger overtaking moves 6.5 m
Real car size Small cars slip through; big cars push and bump much more Medium (Tesla Model 3), ANTM size 5.2 x 2.3 m
Lines 3/7 vs 3/7/15 Small difference; 3/7/15 looks busier 3/7/15
Car model mix Hardly matters All Tesla Model 3

So the final scenario recipe is: 30 Tesla Model 3 cars, keep-moving on, collision guard on, drivers looking 6.5 m to the side for gaps, lane-change willingness at -1.0, lines 3/7/15 and car size 5.2 x 2.3 m. On top of that: frequent random lane changes (0.5), a mix of slow (5-7 m/s) and fast (9-14 m/s) drivers with 40% slow ones, close following (0.5 s) and aggressive drivers.

Possible improvements spotted in these tests: lane-change willingness -0.2 and gap search 8.5 m each did better than the final values in a single run. Trying them together is the next step.