A simple simulation of the Boids flocking algorithm, meant to simulate the flocking behavior of birds in groups.
The simulation is written in the Go programming language, and the results are plotted using Python via Matplotlib.
Run the Go simulation via the following command:
go run .This will write the positions of the boids to the ./out/ directory.
It takes roughly 7s to simulate 200 boids over 1000 time steps.
Plot the positions of the boids in an animated gif file by running the following python command:
python plot-trajectory.pyThis will create a movie.gif file of the desired animated plot.
