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.2.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pythonabm-0.3.2.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for pythonabm-0.3.2.tar.gz
Algorithm Hash digest
SHA256 1b304624ddc4bdecf6d9895091b93d773d223c9161056e7f222402d09c800b59
MD5 864e30c35f18be0a427118b447dd06fd
BLAKE2b-256 6e9cb8d7108fad964fba90f0089d5a91b4f201f2cd1c4f29438ebc67aad4779a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pythonabm-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for pythonabm-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9cbc65c54ad953155fa7e04dba99212208e4628d823353f4541b274bcefe32bb
MD5 ef30adb1e44d1e45da9dd78b4aac41ec
BLAKE2b-256 0df742e2887eb142d2cbe07941677d18d8a6e07ed473f1a436b54a983e44ac25

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