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

Docs Python Version PyPI Version GitHub Coverage Status License: MIT

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.

Installation

Install the package using pip:

pip install piperabm

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 more usage examples, refer to the examples folder in the project 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! Feel free to:

  • Report issues.
  • Submit feature requests.
  • Create pull requests.

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.1.2.tar.gz (58.9 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.1.2-py3-none-any.whl (101.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for piperabm-0.1.2.tar.gz
Algorithm Hash digest
SHA256 68e4712020576d94a9a1695fef3e7ee73b4d01ffde63d51da147ecbe5556678b
MD5 0afd9949f5dd52ed9d1fa91e55a0c417
BLAKE2b-256 9f12a75f0fcc4ccbad4e77ee92ad7ddd184f481f9d848217f66bb03d7c83cb61

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: piperabm-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 101.3 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.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 38782c9ef47715ada13d2ee66e9420daacc586cb9a3f811c63585fd83e69252c
MD5 12d95fa9d98045fc11d0512786ca0a7b
BLAKE2b-256 5fb00d4debdc2cf0a0a0a8eb6b44d7529ffc3ffae32ba8b0c30001bff52947f2

See more details on using hashes here.

Provenance

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