You are on page 1of 14

Analysing traffic-flow using the Nagel-Schreckenberg model

Daan van der Spek⇤



Department of Information and Computing Sciences,
Utrecht University, Princetonplein 5,
3584 CC Utrecht, The Netherlands

(Dated: October 21, 2021)

Abstract

PACS numbers:


Electronic address: d.s.vanderspek@students.uu.nl

1
I. INTRODUCTION

The modern-day world is plagued by traffic jams. Although the recent CoVID-19
pandemic made it appear as if traffic jams are a thing of the past, now that lockdown is
over, it is as if nothing happened. Besides me wanting to complain about the necessity of
travelling, it seems more viable to study factors that can increase traffic flow.

One interesting factor that influences traffic flow is car’s behaviour, or rather peo-
ple’s behaviour during traffic jams. In various countries, road authorities use dot matrix
signs above highway lanes to induce a temporary speed limit.

In this paper, I will study traffic flow as influenced by temporary speed limits using
the Nagel-Schreckenberg model. The Nagel-Schreckenberg model was developed in the
early 1990s and published in Journal de Physique in 1992[1]. Since then, it, next to its
further developement, has been used in various traffic studies, such as the simulations of the
inner-city of Duisburg, but most impressively, Germany’s Bundesland Nordrhein-Westfalen
where at present, 30 minutes, and an hour ahead of time, traffic is predicted[2].

The paper is organised as follows. In Sec. II I will introduce the rules for the
Nagel-Schreckenberg model and extend it for multi-lane use in Sec. III. IV In I will derive
two methods of measuring traffic-flow. In Sec. V, I will show results. The research is
concluded in Sec. VI and discussed in VII. Appendix A shows all figures VIII.

II. THE NAGEL-SCHRECKENBERG MODEL EXPLAINED

The Nagel-Schreckenberg model divides a single-lane road into cells. A cell can be occu-
pied by one car, or is empty. Cars get assigned a velocity v: an integer value between 0 and
5. A car’s speed is ultimately limited by the road’s speed limit vmax .[3]
Every iteration of the models, cars develop according to four actions in this order:[3]

1. Acceleration: vehicle n has velocity vn . If vn < vmax , then vn is increased by 1:


vn = vn + 1.

2. Braking: vehicle n with velocity vn at cell x looks ahead at the next vehicle at site

2
x + d. If vn > d, it brakes: vn = d 1.

3. Randomization: given a braking probability p, vehicle n will slow down 1: vn = vn 1.

4. Moving: after steps 1-3 have been completed for all cells, the cars get advanced: for
vn , xn = xn + vn .

III. EXTENDING THE NAGEL-SCHRECKENBERG MODEL

Combining results from Wright[3] and results I have acquired, I deem the following rules
fit to turn the Nagel-Schreckenberg model into a two-lane model.
Effectively, the two lanes are simulated independently. Only when a lane change occurs,
it is necessary to obtain data from the next lane over. After applying action 2 from the
above, the following actions are applied:

5. Incentive: vehicle n has velocity vn . If action 2 dictates a d lower than vn , or the car
is stopped, there is incentive to change lanes: d < vn |vn == 0; change lanes.[3]

6. Safety: a vehicle can only change lanes if the neighbouring lane has enough room.
Wright prescribes: For a vehicle to transfer to the adjacent lane, the adjacent site
must be unoccupied with gaplookback = vmax and gapahead = vn .[3].

Action 6 has a deficit: if a car stops near an obstruction on the right line, and the left lane is
congested, it never finds a spot large enough to change into. This is unjust for two reasons:

• Cars in the left lane have low velocity, allowing for the gaplookback to be smaller to
merge safely.

• gapahead for a stopped car looking for a gap equals 0, while the lane it merges into has
moving cars.

.
Therefore, I have adapted the latter merge action:

6. Safety: a vehicle can only change lanes if the neighbouring lane has enough room.
Wright prescribes: For a vehicle to transfer to the adjacent lane, the adjacent site
must be unoccupied with gaplookback = vn + 2 and gapahead = vn + 2.

3
Lastly, I simulate an obstruction, and corresponding lower speed limits as follows:

• After a certain iteration step istart , but before a certain iteration step iend , at a certain
cell xobstruct , place a car no with vno = 0.

• In the same iteration window, cars that have x < xobstruct get vmax = vmax0 . I have
altered vmax0 to get the best results.

IV. MEASURING TRAFFIC FLOW

There are many ways to measure traffic flow, i.e. how many cars enter a certain cell
during the simulation, .... I have measured traffic flow in two ways:

• Average car average speed: for every iteration, record every car’s current speed. This
is averaged across all iteration steps and all cars to give a 1-dimensional measure of
flow.

• Average stopped time: for every iteration, record for every car if its velocity is 0.
This is averaged across all iteration steps and all cars to, again, give a 1-dimensional
measure of flow.

4
V. RESULTS

In appendix A, histograms for both measurements of traffic flow, as well as space/time


diagrams can be found for all simulations. In all tests vmax = 5, density = 0.1, p = 0.05.
I have conducted four simulations:

1. No obstructions.

2. Obstruction with no lowered speed-limit.

3. Obstruction with speed-limit lowered to 4.

4. Obstruction with speed-limit lowered to 3.

The results are summarized below:

Simulation Average car speed Average stopped time


Mean Standard deviation Mean Standard deviation
1 3.75 0.36 3.5 5.01
2 3.66 0.61 6.53 8.82
3 3.89 0.14 3.13 4.44
4 3.14 0.14 3.48 4.39

VI. CONCLUSION

In this research, we find that lower the speed limit from 5 to 4 near an accident improves
traffic flow by:

• 6% when looking at average car speed,

• 52% when looking at average stopped time.

It is safe to conclude that not only does lowering the speed limit near accidents improve
safety on the road, it can also lead to higher traffic flow. Remarkable however, is that the
standard deviation in average car speed, as well as average stopped time drops. Apparently,
average traffic flow is increased, but outliers are decreased dramatically. That might mean

5
that cars that wouldn’t have had to slow down, have now and are thus negatively affected
by this measure (although for a greater good).
Lowering the speed limit further to 3 decreases traffic flow, although now the two mea-
surements for flow tell a different story:

• Compared to simulation 2, flow is decreased by 15% when looking at average car speed.

• Compared to simulation 2, flow is increased by 47%. Not as good as simulation 3, but


an increase still.

VII. DISCUSSION

It is peculiar to see that running a simulation with the same settings twice can give an
entirely different result. The results stated in section IV are averaged results over three runs.
The result would be more reliable if averaged over more runs.
It seems that average stopped time is a better indicator of traffic flow in this study. That
might explainable: average car speed factors in cars that haven’t been near the accident
site at all, thus clouding the measurement. However, if more, or less, other smaller traffic
jams form during to the randomisation action of the model, the stopped time measurement
is also clouded. Perhaps there would be an even better quantity for traffic flow.

[1] K. Nagel, M. Schreckenberg, J. Phys. I France 2, 2221 (1992)


[2] Real-time traffc flow simulation in Nordrhein-Westfalen, http://www.autobahn.nrw.de/
[3] P. Wright, Investigating Traffic Flow in The Nagel-Schreckenberg Model (2013)

6
VIII. APPENDIX A

A. Simulation 1, no obstruction

Lane 0 space/time diagram for a simulation without obstructions.

Lane 1 space/time diagram for a simulation without obstructions.

7
Average speed histogram for a simulation without obstructions.

Average stopped time histogram for a simulation without obstructions.

8
B. Simulation 2, obstruction, no changed speed-limit

Lane 0 space/time diagram for a simulation with obstruction, no changed speed-limit.

Lane 1 space/time diagram for a simulation with obstruction, no changed speed-limit.

9
Average speed histogram for a simulation with obstruction, no changed speed-limit.

Average stopped time histogram for a simulation with obstruction, no changed speed-limit.

10
C. Simulation 3, obstruction, changed speed-limit to 4

Lane 0 space/time diagram for a simulation with obstruction, changed speed-limit to 4.

Lane 1 space/time diagram for a simulation with obstruction, changed speed-limit to 4.

11
Average speed histogram for a simulation with obstruction, changed speed-limit to 4.

Average stopped time histogram for a simulation with obstruction, changed speed-limit to
4.

12
D. Simulation 4, obstruction, changed speed-limit to 3

Lane 0 space/time diagram for a simulation with obstruction, changed speed-limit to 3.

Lane 1 space/time diagram for a simulation with obstruction, changed speed-limit to 3.

13
Average speed histogram for a simulation with obstruction, changed speed-limit to 3.

Average stopped time histogram for a simulation with obstruction, changed speed-limit to
3.

14

You might also like