Collective motion and swarm behaviour can be studied by utilising the Vicsek model [1]. Here, an active particle at a certain position and constant speed in an arbitrary direction aligns with the mean orientation of its neighbouring particles at each time step.
Besides Python3, Numpy and Matplotlib are required. The latter two can be installed by pip: pip install -r requirements.txt
Using the simulation is fairly simple once matplotlib and numpy are installed. The example.py file gives a example of how the code can be used.
[1] Vicsek, T., Czirók, A., Ben-Jacob, E., Cohen, I., & Shochet, O. (1995). Novel type of phase transition in a system of self-driven particles. Physical review letters, 75(6), 1226.