This page shows interactive demonstrations of traffic flow simulation to learn some of the most fundamental concepts of traffic flow.
Vehicular traffic flow on a road section is simulated by using standard traffic flow models. The road segment has a bottleneck. If the inflow exceeds the bottleneck capacity, traffic congestion occurs. You can control the inflow and the bottleneck impact by using the above control panel. Try it now!
Macroscopic traffic state variables (i.e., flow, density, speed) can be computed for each road segment by checking the options in "Additional information" panel. You can see that these variables properly reflect the movement of multiple vehicles. Furthermore, these variables can be visualized as flow-density plots. After generating various traffic conditions, you may see a triangular relation in the plot; this is the fundamental diagram, which determines the fundamental feature of the traffic flow.
Vehicle trajectories can be visualized by using the concept of time-space diagram, in which each curve represents a trajectory of a vehicle. This diagram provides full information on the dynamics the traffic flow at a glance. Traffic states can also be visualized as a time-space diagram. This is coarser but more concise representation of the traffic dynamics.
You can also plot the cumulative count, which is the cumulative number of vehicles that passed a certain location. This is another useful tool to analyze traffic flow (especially one at a bottleneck) in a simple way. For example, the horizontal distance between "bottleneck" and "upstream end (shifted)" curves represents the delay time induced by the congestion.
Following two traffic flow models can be selected: Newell's simplified car-following model and Nagel-Schreckenberg cellular automaton. Newell's model is very simple yet useful to simulate basic phenomena of traffic flow; and it is equivalent to the standard macroscopic traffic flow model known as Kinematic Wave Theory. Nagel-Schreckenberg model is more complicated; it can be considered as an extension of Newell's model, and shows more complex phenomenon such as stop-and-go waves and capacity drop.
More advanced network traffic simulator UXsim is published as open source software in Python.
The bottleneck for the both model is modeled by increasing the jam density at the bottleneck segment.