Framework for building Agent-Based Models (ABMs) in Python
Project description
PythonABM
PythonABM makes complex agent-based modeling (ABM) simulations in Python accessible by providing an efficient base framework for constructing ABMs. More information on PythonABM can be found below.
- Documentation: pythonabm.readthedocs.io
- PyPI: pypi.org/project/pythonabm
Installation
This library requires Python 3.7-3.10 for full functionality. A CUDA compatible GPU is necessary for enabling GPU parallelization of various simulation methods (otherwise CPU parallelization is used). See the bottom for information on enabling GPU parallelization. The latest version of PythonABM can be installed with the following command.
pip install pythonabm
Running a simulation
Calling the start() method of Simulation class (or any subclass of Simulation) will launch the ABM and run it as follows. (See the example.py script as a template for building a simulation.) A text-based UI will then prompt for the name identifier for the simulation and corresponding mode as described below.
- 0: New simulation
- 1: Continue a previous simulation
- 2: Turn a previous simulation's images to a video
- 3: Archive a previous simulation's outputs to a ZIP file
To avoid the text-based UI, the name and mode can be passed at the command line by using flags (without the parentheses). Note: the simulation file does not have to be named "main.py".
python main.py -n (name) -m (mode)
When continuing a previous simulation (mode: 1), the UI will prompt for the updated end-step number, though this can be passed through the command line like above.
python main.py -n (name) -m (mode) -es (end-step)
NVIDIA CUDA support
In order to use the methods associated with CUDA GPU parallelization, PythonABM requires a CUDA compatible GPU and NVIDIA's CUDA toolkit. If you don't have the toolkit, be sure to update your NVIDIA GPU drivers here then download the toolkit either directly from NVIDIA there or with the conda (Anaconda) command show below.
conda install cudatoolkit
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pythonabm-0.3.0.tar.gz
.
File metadata
- Download URL: pythonabm-0.3.0.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a3267547370b3d5718c17a61629545da2cbedd1f4a2008c37459f8894fef901 |
|
MD5 | 16bd767c8378fb0b0ecdbd940ce84ee3 |
|
BLAKE2b-256 | 33fa9c9f6b33ec69e87febf268d07c4aba0ecb39c33a10fd05a257dadbce89e8 |
File details
Details for the file pythonabm-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: pythonabm-0.3.0-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1401a9dedc62ecb67cbbe96b466a5106c4d2ed051b0c6822433c5594e76738b |
|
MD5 | 64916cb3e66a398ddfd254c448decf0d |
|
BLAKE2b-256 | 28f54e62e62b361ff03e32dd6659faa0dc9991be74cef6b8e7d19fdbfa36c214 |