Skip to main content

ABM package in JAX.

Project description

Abmax is a general-purpose agent-based modeling(ABM) framework in Jax It provides:

  • Two algorithms to apply unique updates to a dynamic number of agents selected during run-time. Both are JIT friendly and can be vectorized across different number of models
    • Rank-Match (RM)
    • Sort-Count-Iterate (SCI)
  • JAX-transformation-friendly data structures and functions that can be used to define sets of agents and their manipulations.
    • Selecting agents based on a run-time determined key.
    • Searching and sorting agents based on their attributes.
    • Updating an arbitrary number of agents to a specific state.
    • Stepping agents in a vectorized way.
    • Running multiple such simulations in parallel.
  • Implementation of common algorithms used in ABM implemented in vmap and jit friendly way.

Installation

pip install abmax

Dependencies:

Benchmark

A comparison of the performance of Abmax with other ABM frameworks: Agents.jl and Mesa based on the Wolf-Sheep (Grid space) and Bird-Flock (Continuous space) models. These simulations are run for 100 steps and the median time taken for 10 runs is logged in ms. The benchmark is run on a gcn GPU node(Intel Xeon Platinum 8360Y + Nvidia A100) of the Snelius cluster The number of initial agents for these simulations are as follows:

  • Wolf-Sheep small: 600 sheep, 400 wolves on a 100 x 100 grid
  • Wolf-Sheep large: 6000 sheep, 4000 wolves on a 1000 x 1000 grid
Model Agents.jl Abmax RM Abmax SCI Mesa
Wolf-Sheep small 14.93 50.26 726.78 1333.047
Wolf-Sheep large 685.03 3315.88 5455.01 170070.95

In Abmax, we can run multiple simulations in parallel because of automatic batching and vectorization. Here is a trend in running different numbers of wolf-sheep small models in parallel.

Number of models 10 20 50 100 200 500
time taken (s) 5.75 6.81 7.32 8.52 8.617 14.32

Note: All times that are reported, are excluding the model setup time.

Tutorial

A basic tutorial on how to use Abmax is available here[Outdated]

Citation

If you use Abmax in your work, please consider citing it as follows:

@misc{chaturvedi2025abmax,
    title={Abmax: A JAX-based Agent-based Modeling Framework},
    author={Siddharth Chaturvedi and Ahmed El-Gazzar and Marcel van Gerven},
    year={2025},
    eprint={2508.16508},
    archivePrefix={arXiv},
    primaryClass={cs.MA}
}


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abmax-0.0.2.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abmax-0.0.2-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file abmax-0.0.2.tar.gz.

File metadata

  • Download URL: abmax-0.0.2.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.10

File hashes

Hashes for abmax-0.0.2.tar.gz
Algorithm Hash digest
SHA256 945b9f50ecfb14a5cc5f4e04a11a7cd2eb2b4b1e47fe6152d309a5be522b828a
MD5 af5532e3ce93a0a7556748a63487d2f6
BLAKE2b-256 5215fb48519dbae860860f24746a2ca46d3534002cdfb7d90402d160fa5c42da

See more details on using hashes here.

File details

Details for the file abmax-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: abmax-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.10

File hashes

Hashes for abmax-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2f4d399c19daff3295a232292b0f73001e5435163e45715f092ef3dd043648ac
MD5 bbb83822de56aa08c307854f4f9b286e
BLAKE2b-256 f830993120006c09c7f4d81ac8f68a74c6e323064a94f4df23346bbb98cbea2d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page