Sources from GitHub

Information on the
mixed traffic flow simulation

This is an interactive simulation of the fully two-dimensional model which is fully documented in following reference:
Venkatesan Kanagaraj and Martin Treiber (2018)
Self-Driven Particle Model for Mixed Traffic and Other Disordered Flows
Physica A: Statistical Mechanics and its Applications 509, 1-11
[arxiv e-print: 1805.05076]

At present, only landscape-like viewports are supported, so the width of the simulation screen should be greater than the height (3:2 works well).

The simulation starts with little traffic on a homogeneous road (the U-bend is only there in order to display a longer road segment) with a small downstream bottleneck realized by a road narrowing.

There are two insert diagrams: a speed-density box-whisker plot at the top, and a flow-density scatter plot at the bottom. After each aggregation interval (presently, set to 3 s), an additional box-whisker element and data point is added to each plot, respectively. The plots give the global picture over the whole simulation area, i.e., the flow-densitry data approximate a macroscopic fundamental diagram and the boxes of the speed-density plot are longest for phase-segregated traffic, i.e., jammed in one portion and free in another.

Furthermore, there are three possibilities for interaction: The sliders, the buttons to the right, and loading a custom initial configuration

The sliders

The buttons/switch areas

Custom initial conditions (micro ICs)

The simulation can be customized by prescribing arbitrary microscopic initial conditions and road-blocking bottlenecks as specified in text files prescribing the type, initial longitudinal and lateral position (u,v), and initial velocity (speedLong,speedLat) of any object. Pressing the button "IC from file" opens a file selector for user-supplied files. Once selecting one, the simulation is cleared and re-run with the user-supplied vehicle configuration (the geometric bottlenecks are retained from the previous setting). The file format is as follows:
 # type     length   width  u     v       speedLong  speedLat
 car        5.0      2.0    20    3       15         0
 truck      10.0     3.0    20    -3      15         0
 bike       2.0      1.0    40    -3      5          1
 obstacle   80       2      300   9.5     0          0
 ...        ...      ...    ...   ...     ...        ...
Examples can be downloaded at the GitHub link or from the links further below. Besides the three moving types car, truck, and bike, there is also a type obstacle which can be used to implement various road-blocking bottlenecks.
Micro ICs are useful when analyzing certain model aspects with reproducible scenarios. For this reason, I also seed the random number generator when a new IC file is loaded. This is necessary because a certain acceleration noise is added to resolve stalemates in the traffic flow (see file IC_resolveStalemate.txt below). When using micro ICs, it is best to set the inflow to zero because otherwise new incoming vehicles may disturb the analysis/experiments. With zero inflow, there are also no further stochastic elements in the simulation in addition to the acceleration noise. Notice that the simulation is cleared from all past vehicles and past obstacles and bottlenecks when a new IC file is loaded but the other slider settings are unchanged.
As examples and templates for further modification, you can download several template initial configurations.

Hint: The filename indicates that the configurations work as intended for a road width of 3.5 m times the given number of lanes. furthermore, you should deactivate the "Var width*" geometry settings and set the inflow to zero because, otherwise, the additional inflow vehicles will interfere. You can also try if a given configuration works better with lanes (floorfield on) or without)