Skip to main content

Framework for building Agent-Based Models (ABMs) in Python

Project description

PythonABM

Documentation Status PyPI version License GitHub

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.

Installation

Assuming you have Python 3.7-3.10, the latest version of the PythonABM library can be installed using the following command.

pip install pythonabm

PythonABM can also be built from source once downloaded from GitHub.

pip setup.py install

Running a simulation

Calling the start() method in the Simulation class will launch the ABM platform and run it as follows. (See the example.py script as a template for building a simulation.) A text-based UI will prompt for a name of the simulation and a corresponding mode (described below).

  • 0: New simulation
  • 1: Continue a previous simulation
  • 2: Convert a previous simulation’s images to a video
  • 3: Archive (ZIP) a previous simulation’s outputs

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 ABM will prompt for the updated end-step number, though this can be passed like above.

python main.py -n (name) -m (mode) -es (end-step)

NVIDIA CUDA support

For GPU parallelization, PythonABM requires a CUDA compatible GPU and NVIDIA’s CUDA toolkit. If you don’t have the toolkit, download the toolkit either directly from NVIDIA here or with Anaconda's conda command show below.

conda install cudatoolkit

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

pythonabm-0.3.1.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

pythonabm-0.3.1-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file pythonabm-0.3.1.tar.gz.

File metadata

  • Download URL: pythonabm-0.3.1.tar.gz
  • Upload date:
  • Size: 17.0 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

Hashes for pythonabm-0.3.1.tar.gz
Algorithm Hash digest
SHA256 0c5651890c9351a192dd25f7838365ad0b7e208b983a33e22ad915d5bd91ce97
MD5 10b580aca98e7e871fb0f644ae689f60
BLAKE2b-256 3e3b84988863d022c23a5f73fafdefe201d4bd6f5719dd7c402f701d9ed10366

See more details on using hashes here.

File details

Details for the file pythonabm-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: pythonabm-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 16.6 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

Hashes for pythonabm-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 42b51f2cf67de3711ef8a4011b43b8dffff0d7bffb858e23dfdfdb50c32d12a0
MD5 f8bb75cc53c85759d521bdf5ffb74240
BLAKE2b-256 d27e2eca2fbf4160550b9d7d09d25cf8027b534c1eaf6687a630099811ae8521

See more details on using hashes here.

Supported by

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