Name | abmax JSON |
Version |
0.0.1
JSON |
| download |
home_page | None |
Summary | ABM package in JAX. |
upload_time | 2025-01-10 11:35:01 |
maintainer | None |
docs_url | None |
author | None |
requires_python | ~=3.10 |
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.
|
# Abmax
Abmax is an agent-based modeling(ABM) framework in Jax, focused on dynamic population size.
It provides:
- Datastructures and functions that can be used to define sets of agents and their manipulations.
* Adding and removing arbitrary number of agents.
* 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
- Jax
- Flax
# 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/JuliaDynamics/ABMFrameworksComparison). These simulations are run for 100 steps and the median time taken for 10 runs is logged. 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: 1000 sheep, 500 wolves
- Wolf-Sheep large: 10000 sheep, 5000 wolves
- Bird-Flock small: 1000 birds
- Bird-Flock large: 10000 birds
| Model | Abmax | Agents.jl | Mesa |
| ----- | ----- | --------- | ---- |
| Wolf-Sheep small | 5X | X~140(ms) | 29X |
| Wolf-Sheep large | 60X | 60X~6420(ms) | >1hr |
| Bird-Flock small | 3Y | Y~126(ms) | 126Y |
| Bird-Flock large | 3Y | 17Y~2179(ms) | >1hr |
In Abmax, we can run multiple simulations in parallel because of automatic batching and vectorization.
Here is a trend in running different number 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 exluding 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)
# Citation
Raw data
{
"_id": null,
"home_page": null,
"name": "abmax",
"maintainer": null,
"docs_url": null,
"requires_python": "~=3.10",
"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/1b/be/8ba51aa3d4b1fb7d4db35bbe855897f5c21ddf7cdec450a391389dad1d58/abmax-0.0.1.tar.gz",
"platform": null,
"description": "# Abmax\nAbmax is an agent-based modeling(ABM) framework in Jax, focused on dynamic population size.\nIt provides:\n- Datastructures and functions that can be used to define sets of agents and their manipulations.\n * Adding and removing arbitrary number of agents.\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\n- Jax\n- Flax\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/JuliaDynamics/ABMFrameworksComparison). These simulations are run for 100 steps and the median time taken for 10 runs is logged. 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: 1000 sheep, 500 wolves\n- Wolf-Sheep large: 10000 sheep, 5000 wolves\n- Bird-Flock small: 1000 birds\n- Bird-Flock large: 10000 birds\n\n| Model | Abmax | Agents.jl | Mesa |\n| ----- | ----- | --------- | ---- |\n| Wolf-Sheep small | 5X | X~140(ms) | 29X |\n| Wolf-Sheep large | 60X | 60X~6420(ms) | >1hr |\n| Bird-Flock small | 3Y | Y~126(ms) | 126Y |\n| Bird-Flock large | 3Y | 17Y~2179(ms) | >1hr |\n\nIn Abmax, we can run multiple simulations in parallel because of automatic batching and vectorization. \nHere is a trend in running different number 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 exluding 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)\n\n\n# Citation\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.1",
"project_urls": null,
"split_keywords": [
"abm",
" agent-based-modeling",
" abm",
" abmax",
" agent-based-modeling",
" jax",
" simulation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d375880b612a9ae21654d27040adef495c4602f2bcbdf4ec8a1bf89f44748cf1",
"md5": "96eb8f83f3997f1574eded013bef1c04",
"sha256": "d04d869e191d8435d00fc391e3caeeaccc0506abb85bbd375fe826a2919b929c"
},
"downloads": -1,
"filename": "abmax-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "96eb8f83f3997f1574eded013bef1c04",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.10",
"size": 7403,
"upload_time": "2025-01-10T11:34:57",
"upload_time_iso_8601": "2025-01-10T11:34:57.590774Z",
"url": "https://files.pythonhosted.org/packages/d3/75/880b612a9ae21654d27040adef495c4602f2bcbdf4ec8a1bf89f44748cf1/abmax-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1bbe8ba51aa3d4b1fb7d4db35bbe855897f5c21ddf7cdec450a391389dad1d58",
"md5": "7a01af3519af71cd536c1037bd2e290d",
"sha256": "4716aea8f927cfa7abfd3d179a8f2bc0e783ba516fede1978aec7ae597688c8a"
},
"downloads": -1,
"filename": "abmax-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "7a01af3519af71cd536c1037bd2e290d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.10",
"size": 6015,
"upload_time": "2025-01-10T11:35:01",
"upload_time_iso_8601": "2025-01-10T11:35:01.042376Z",
"url": "https://files.pythonhosted.org/packages/1b/be/8ba51aa3d4b1fb7d4db35bbe855897f5c21ddf7cdec450a391389dad1d58/abmax-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-10 11:35:01",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "abmax"
}