Swarm dynamics based on Free Energy Principle. Dissertation project for MSc Intelligent and Adaptive Systems at the University of Sussex.