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.10 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.0.tar.gz (63.3 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.0-py3-none-any.whl (105.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for piperabm-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dd79f420507cd389abef56554baf9cddf606f0dbe11f5e7b00dfb855c3c76b3b
MD5 0d5dbb4411f385ac7e70508b504dfce8
BLAKE2b-256 2b100891b9fd6afd3c8bfe723f0f06e740a2939b8fe5dfbebb4bdb25e040d8ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for piperabm-0.2.0.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.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for piperabm-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 585e9282432d5f228166cbfe31d281f7387720832bc0e326d5123a1460ea39ef
MD5 6cd21b311ab5aa121311eb61972f25ef
BLAKE2b-256 abfe6ac006a6c362a5108463c67c478534647c391a5af5c80e5e059ef533105f

See more details on using hashes here.

Provenance

The following attestation bundles were made for piperabm-0.2.0-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