| Name | abmax JSON |
| Version |
0.0.7
JSON |
| download |
| home_page | None |
| Summary | ABM package in JAX. |
| upload_time | 2025-11-02 23:58:59 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.9.0 |
| license | MIT License Copyright (c) 2025 Siddharth Chaturvedi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| keywords |
abm
agent-based-modeling
abm
abmax
agent-based-modeling
jax
simulation
|
| VCS |
|
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
<div align="center">
<img src="https://github.com/i-m-iron-man/abmax/blob/master/media/abmx_logo.png" width="250"/>
</div>
<div align="center">
<img src="https://github.com/i-m-iron-man/abmax/blob/master/media/flocking.gif" width="250"/>
<img src="https://github.com/i-m-iron-man/abmax/blob/master/media/sheep_wolf.gif" width="250"/>
<img src="https://github.com/i-m-iron-man/abmax/blob/master/media/small_foragaing.gif" width="250"/>
</div>
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
```bash
pip install abmax
```
Dependencies:
- [Python >= 3.10](https://www.python.org/downloads/)
- [Jax >= 0.4.13](https://jax.readthedocs.io/en/latest/installation.html)
- [Flax >= 0.7.4](https://flax.readthedocs.io/en/latest/index.html)
# Benchmark
A comparison of the performance of Abmax with other ABM frameworks: [Agents.jl](https://juliadynamics.github.io/Agents.jl/stable/) and [Mesa](https://mesa.readthedocs.io/en/stable/) based on the [Wolf-Sheep (Grid space) and Bird-Flock (Continuous space) models](https://github.com/i-m-iron-man/ABMFrameworksComparison/tree/main). 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](https://servicedesk.surf.nl/wiki/display/WIKI/Snellius+hardware)(Intel Xeon Platinum 8360Y + Nvidia A100) of the [Snelius cluster](https://www.surf.nl/en/services/snellius-the-national-supercomputer)
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](https://github.com/i-m-iron-man/abmax/blob/master/benchmarks/wolf_sheep/benchmarks_vmap.py) 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](https://github.com/i-m-iron-man/abmax/blob/master/tutorials/getting_started.ipynb)[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}
}
Raw data
{
"_id": null,
"home_page": null,
"name": "abmax",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9.0",
"maintainer_email": null,
"keywords": "ABM, Agent-Based-Modeling, abm, abmax, agent-based-modeling, jax, simulation",
"author": null,
"author_email": "Siddharth Chaturvedi <sidchat.sc@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/08/bd/62fa9b88a9df1c1a71373584980793b4560649ec2d13f2ceec888558eba6/abmax-0.0.7.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n <img src=\"https://github.com/i-m-iron-man/abmax/blob/master/media/abmx_logo.png\" width=\"250\"/>\n</div>\n<div align=\"center\">\n <img src=\"https://github.com/i-m-iron-man/abmax/blob/master/media/flocking.gif\" width=\"250\"/>\n <img src=\"https://github.com/i-m-iron-man/abmax/blob/master/media/sheep_wolf.gif\" width=\"250\"/>\n <img src=\"https://github.com/i-m-iron-man/abmax/blob/master/media/small_foragaing.gif\" width=\"250\"/>\n</div>\n\nAbmax is a general-purpose agent-based modeling(ABM) framework in Jax\nIt provides:\n- 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\n * Rank-Match (RM)\n * Sort-Count-Iterate (SCI)\n- JAX-transformation-friendly data structures and functions that can be used to define sets of agents and their manipulations.\n * Selecting agents based on a run-time determined key.\n * Searching and sorting agents based on their attributes.\n * Updating an arbitrary number of agents to a specific state.\n * Stepping agents in a vectorized way.\n * Running multiple such simulations in parallel.\n- Implementation of common algorithms used in ABM implemented in vmap and jit friendly way.\n\n# Installation\n```bash\npip install abmax\n```\nDependencies:\n- [Python >= 3.10](https://www.python.org/downloads/)\n- [Jax >= 0.4.13](https://jax.readthedocs.io/en/latest/installation.html)\n- [Flax >= 0.7.4](https://flax.readthedocs.io/en/latest/index.html)\n\n# Benchmark\nA comparison of the performance of Abmax with other ABM frameworks: [Agents.jl](https://juliadynamics.github.io/Agents.jl/stable/) and [Mesa](https://mesa.readthedocs.io/en/stable/) based on the [Wolf-Sheep (Grid space) and Bird-Flock (Continuous space) models](https://github.com/i-m-iron-man/ABMFrameworksComparison/tree/main). 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](https://servicedesk.surf.nl/wiki/display/WIKI/Snellius+hardware)(Intel Xeon Platinum 8360Y + Nvidia A100) of the [Snelius cluster](https://www.surf.nl/en/services/snellius-the-national-supercomputer)\nThe number of initial agents for these simulations are as follows:\n- Wolf-Sheep small: 600 sheep, 400 wolves on a 100 x 100 grid\n- Wolf-Sheep large: 6000 sheep, 4000 wolves on a 1000 x 1000 grid\n\n| Model | Agents.jl | Abmax RM | Abmax SCI | Mesa |\n| ----- | ----- | ---- | ----- | ---- |\n| Wolf-Sheep small | 14.93 | 50.26 | 726.78 | 1333.047\n| Wolf-Sheep large | 685.03 | 3315.88 | 5455.01 | 170070.95\n\nIn Abmax, we can [run multiple simulations](https://github.com/i-m-iron-man/abmax/blob/master/benchmarks/wolf_sheep/benchmarks_vmap.py) in parallel because of automatic batching and vectorization. \nHere is a trend in running different numbers of wolf-sheep small models in parallel.\n\n| Number of models | 10 | 20 | 50 | 100 | 200 | 500 |\n| ----------------- | -- | -- | -- | --- | --- | --- |\n| time taken (s) | 5.75 | 6.81 | 7.32 | 8.52 | 8.617 | 14.32 |\n\nNote: All times that are reported, are excluding the model setup time.\n\n\n# Tutorial\nA basic tutorial on how to use Abmax is available [here](https://github.com/i-m-iron-man/abmax/blob/master/tutorials/getting_started.ipynb)[Outdated]\n\n\n# Citation\nIf you use Abmax in your work, please consider citing it as follows:\n```\n@misc{chaturvedi2025abmax,\n title={Abmax: A JAX-based Agent-based Modeling Framework},\n author={Siddharth Chaturvedi and Ahmed El-Gazzar and Marcel van Gerven},\n year={2025},\n eprint={2508.16508},\n archivePrefix={arXiv},\n primaryClass={cs.MA}\n}\n\n\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2025 Siddharth Chaturvedi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "ABM package in JAX.",
"version": "0.0.7",
"project_urls": null,
"split_keywords": [
"abm",
" agent-based-modeling",
" abm",
" abmax",
" agent-based-modeling",
" jax",
" simulation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "21b842304477f284eb12dce7c8792a018a146007f484803ea0aea2ba0664a0f8",
"md5": "bf731b1249d62e0812c223cce467facb",
"sha256": "5f30a80d32f31af8baa44dc092c4817ba46c3de9086f648e7806ef3bdbf99b78"
},
"downloads": -1,
"filename": "abmax-0.0.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bf731b1249d62e0812c223cce467facb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9.0",
"size": 25322,
"upload_time": "2025-11-02T23:58:58",
"upload_time_iso_8601": "2025-11-02T23:58:58.361264Z",
"url": "https://files.pythonhosted.org/packages/21/b8/42304477f284eb12dce7c8792a018a146007f484803ea0aea2ba0664a0f8/abmax-0.0.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "08bd62fa9b88a9df1c1a71373584980793b4560649ec2d13f2ceec888558eba6",
"md5": "ca9b3b3b48de752f4bfa9ceebe537d91",
"sha256": "a94bd9bbf3c1e6dbdd2d64606ece5451e3505946c402608a1724bab8e9d5af0d"
},
"downloads": -1,
"filename": "abmax-0.0.7.tar.gz",
"has_sig": false,
"md5_digest": "ca9b3b3b48de752f4bfa9ceebe537d91",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9.0",
"size": 15998,
"upload_time": "2025-11-02T23:58:59",
"upload_time_iso_8601": "2025-11-02T23:58:59.493976Z",
"url": "https://files.pythonhosted.org/packages/08/bd/62fa9b88a9df1c1a71373584980793b4560649ec2d13f2ceec888558eba6/abmax-0.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-11-02 23:58:59",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "abmax"
}