This code simulates the optimal velocity model (OVM) or a multiple car following (MCF) model.
Matplotlib
NumPy
SciPy
scikit-learn
See ovm.ipynb for further instructions.
Bando, M., Hasebe, K., Nakayama, A., Shibata, A., and Sugiyama, Y. (1995). Dynamical model of traffic congestion and numerical simulation. Physical review E, 51(2):1035.
Peng, G. H. and Sun, D. H. (2010). A dynamical model of car-following with the consideration of the multiple information of preceding cars. Physics Letters A, 374(15):1694–1698.