Code for Active inferants: The basis for an active inference framework for ant colony behavior by Daniel Friedman, Alexander Tschantz, Maxwell Ramstead, Karl Friston, Axel Constant.
This repository contains Python code that simulates ant colony behavior using an active inference framework. The main components are:
ants.py: Defines theAnt,Env, andMDPclasses, along with utility functions for plotting and saving results.config.py: Contains configuration parameters for the simulation.figure_1.py,figure_2.py,figure_3.py: Scripts to reproduce the figures from the paper.
- Install the required dependencies (numpy, matplotlib, imageio).
- Run the desired figure script, e.g.,
python figure_1.py. - The generated images and data will be saved in the
imgsdirectory.
This project is licensed under the MIT License. See the LICENSE file for details.
Initial code by Alexander Tschantz for the 2021 paper. Subsequent rewriting and modifications by Daniel Friedman in 2024.