This is a collection of simulation code I wrote for my PhD project in the university of Bristol.
I implemented the following models for the collective behaviour.
- The voter model (JAP, MA, CH, HL, PRE, 2008, link to paper)
- The Vectorial Network Model (MA, CH, J. Stat. Phys., 2003, link to paper)
- The Vicsek Model (TV, AC, EBJ, IC, OS, PRL, 1995, link to paper)
- The Couzin Model (IDC, JK, GDR, NRF, J. theor. Biol., 2002, link to paper)
- Copy
lib/fish_siminto your project folder. - Add the path to
libto$PYTHONPATH. (For instance, you can edit the~/.bashrcfile.)
(Some examples are in the tests folder.)
The Python module requires the following packages: numpy, matplotlib, scipy, and numba.
They can be installed via command python -m pip install numpy matplotlib scipy numba
The following command will build an extra python package cmodel. It is written in C++, and binded by pybind11. The simulation of models in cmodel is faster, and the way to use these models is consistent with the Python models.
(You will need a C++ compiler and CMake to build the cmodel module.)
git submodule update --init # download the Eigen & pybind11
mkdir build
cd build
cmake ..
make
make install