Flocking simulation
Created for the purpose of passing a class Porazdeljeni sistemi at Faculty of Computer and Information Science, Ljubljana
Problem description
In the natural world, organisms exhibit certain behaviors when traveling in groups. This phenomenon, also known as flocking, occurs at both microscopic scales (bacteria) and macroscopic scales (fish). Using computers, these patterns can be simulated by creating simple rules and combining them. This is known as emergent behavior, and can be used in games to simulate chaotic or life-like group movement.
Parallelization
Here we will show how to convert sequential algoritem into parallel. We will use 4 different architectures for parallelization. Architectures will be: pThreads, OpenMP, OpenCL and OpenMPI. Parallel algorithms can be found in different branches of same repository.
Graphics library
- [OpenGL] (https://www.opengl.org/)
- [GLFW] (http://www.glfw.org)
Parallel programming architectures
- [pThread for VS] http://web.cs.du.edu/~sturtevant/pthread.html
- [OpenMP for VS] https://msdn.microsoft.com/en-us/library/tt15eb9t.aspx
- [OpenCL for VS] http://kode-stuff.blogspot.si/2012/11/setting-up-opencl-in-visual-studio_1.html
- [OpenMPI for VS] https://msdn.microsoft.com/en-us/library/bb524831(v=vs.85).aspx
Screenshot
Some Links
- http://www.cse.buffalo.edu/faculty/miller/Courses/CSE633/Cosgrove-Spring-2014-CSE633.pdf
- [Best explanation] https://gamedevelopment.tutsplus.com/tutorials/3-simple-rules-of-flocking-behaviors-alignment-cohesion-and-separation--gamedev-3444
- [Original algorithm] http://www.red3d.com/cwr/boids/
- http://www.red3d.com/cwr/papers/1987/SIGGRAPH87.pdf
- [Original code] https://www.processing.org/examples/flocking.html
Authors
- Gašper Kolar
- Luka Prijatelj