Skip to content
ActiveInferenceInstitutePublic
forked from alec-tschantz/ants

About

MDP-based active-inference simulation of ant-colony foraging in a T-maze: code for the "Active Inferants" paper (Friedman, Tschantz, Ramstead, Friston & Constant, 2021, Frontiers in Behavioral Neuroscience).

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Active Inferants

CI License: MIT

Code for the computational model in Active Inferants: An Active Inference Framework for Ant Colony Behavior by Daniel Ari Friedman, Alec Tschantz, Maxwell J. D. Ramstead, Karl Friston, and Axel Constant.

The simulation models ant-colony foraging in a 40 × 40 T-maze. Individual simulated ants use a Markov decision process (MDP) to infer local pheromone observations, move through the environment, and deposit trail pheromone while returning from food. The repository contains the implementation used for the paper's in-silico experiments.

Documentation

Quick start

The project requires Python 3.10 or later. From the repository root:

python3 -m venv .venv
.venv/bin/python -m pip install -e .
.venv/bin/python figure_1.py

With uv, the same setup is uv sync --extra dev followed by uv run figure_1.py.

The figure scripts create an imgs/ directory containing PNG snapshots, GIFs, NumPy arrays, text summaries, and (for figure_1.py) path plots. Generated output is ignored by Git. The default experiments are intentionally larger runs; see Running the simulations for the smaller API smoke test and experiment details.

Tests

The test suite lives in tests/ and runs under pytest with a 90% coverage floor:

.venv/bin/python -m pip install -e ".[dev]"
.venv/bin/python -m pytest        # full suite, ~99% coverage (90% floor)
.venv/bin/ruff check .            # lint

Continuous integration runs the same checks on every push and pull request (see .github/workflows/ci.yml).

Citation

For the published article:

Friedman DA, Tschantz A, Ramstead MJD, Friston K, Constant A (2021). Active Inferants: An Active Inference Framework for Ant Colony Behavior. Frontiers in Behavioral Neuroscience, 15, 647732. https://doi.org/10.3389/fnbeh.2021.647732

Machine-readable citation metadata is provided in CITATION.cff. The repository's source code is released under the MIT License. See LICENSE. The article is open access under the license specified by its publisher; consult the publication for the article's reuse terms.

About

MDP-based active-inference simulation of ant-colony foraging in a T-maze: code for the "Active Inferants" paper (Friedman, Tschantz, Ramstead, Friston & Constant, 2021, Frontiers in Behavioral Neuroscience).

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages