Swarm behavior is a widely researched area but without many conclusive answers. Different kinds of swarms have different kinds of behaviors, and in this project the purpose is to simulate the schooling and shoaling patterns of fish using a Particle swarm optimization algorithm. Each individual fish has a set of rules which depends on its position relative to its neighbors and a universal target. To gain an insight into how the algorithm should be implemented, the first testing was done in MATLAB, which has extensive support for calculating and displaying large numbers of positions. The final program was written using C++ and OpenGL was used to generate the graphics.
- Download the MATLAB folder.
- Run FishSchool.m in MATLAB.
Depends on:
- OpenGL: Install OpenGL and build it with Cmake.
- Download the OpenGL folder.
- Compile the project. Make sure OpenGL is installed on your computer.
- If neccessary dependencies are installed, compile project and run main.cpp. Controls: Move the target with the mouse cursor. To move the target closer or further away in the scene use W and S on the keyboard.
As part of the TNM085 Project course @ Linköping University.
