Skip to main content

An Agent-Based Model Framework for Simulating Resilience in Python

Project description


Pied Piper

An Agent-Based Model Framework for Simulating Societal Resilience

Documentation Python Version PyPI Version GitHub License: MIT
Coverage status

KeePied Piper of HamelinpDelta
Illustration by Kate Greenaway for Robert Browning's "The Pied Piper of Hamelin"

Introduction

Living beings exist in perpetual tension with their environment, continually adapting to changes in their surroundings. This project aims to model the interdependent nature of life between humans and their environment.

Documentation

Full documentation, including installation instructions, usage guides, API reference, examples, and contributor guidelines, is available at: PiperABM Documentation

Installation

Install the package using pip:

pip install piperabm

For advanced installation options, including animation support, see the Installation guide.

Usage

Once a Model instance is created, it automatically includes interconnected infrastructure and society components. The simulation is designed to explore how changes in one domain, such as agent behavior or infrastructure layout, affect the other over time. This interdependence forms the core of agent-based modeling within PiperABM.

import piperabm as pa

model = pa.Model()
model.infrastructure.add_street(pos_1=[0, 0], pos_2=[-60, 40], name='road')
model.infrastructure.add_home(pos=[5, 0], id=1, name='home 1')
model.infrastructure.add_home(pos=[-60, 40], id=1, name='home 2')
model.infrastructure.bake()
model.society.generate(num=2, gini_index=0.4, average_balance=1000)
model.run(n=100, step_size=60)

For a guided walkthrough, see the step-by-step usage guide, and for additional examples, refer to the examples folder in the repository.

Supported Python Versions

It has been tested and verified to work with Python versions 3.11 to 3.13. While it is expected to work with older versions of Python (given compatible dependency versions), these environments have not been tested and are not officially supported.

Contributing

Contributions are welcome, including bug fixes, documentation improvements, and extensions to existing model components.

Please see the full contributor guide in the documentation: Contributing Guide

This guide explains:

  • Where to make changes in the codebase
  • How tests are organized and run
  • How to build the documentation locally

License

Distributed under the MIT License. See LICENSE.txt for more information.

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

piperabm-0.2.2.tar.gz (63.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

piperabm-0.2.2-py3-none-any.whl (105.5 kB view details)

Uploaded Python 3

File details

Details for the file piperabm-0.2.2.tar.gz.

File metadata

  • Download URL: piperabm-0.2.2.tar.gz
  • Upload date:
  • Size: 63.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for piperabm-0.2.2.tar.gz
Algorithm Hash digest
SHA256 47fafee321c16ecb6b8f9d98829d4eb075289ec72e92f21a17091dd2f30cdc3d
MD5 e31649591a4203748da92a5bff75be24
BLAKE2b-256 ce506d4183823237b8cc47d932492fed89dfa114cbdb77dfa6bf51afe6168870

See more details on using hashes here.

Provenance

The following attestation bundles were made for piperabm-0.2.2.tar.gz:

Publisher: pypi-release.yml on cmudrc/pied-piper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file piperabm-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: piperabm-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 105.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for piperabm-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 20b27dc480a9c5d7cd39fd4e34a5791f26feaa06324e32f62ef717ac32c41e92
MD5 13200fbba9a6d7f63fd6f8092be2f0b8
BLAKE2b-256 fb88e00a9790b3d8a6f644aba82cf13999dc4b41d6a045b37a5aaa9050a94f28

See more details on using hashes here.

Provenance

The following attestation bundles were made for piperabm-0.2.2-py3-none-any.whl:

Publisher: pypi-release.yml on cmudrc/pied-piper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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