Skip to content

cmudrc/pied-piper

Repository files navigation


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.

About

PIPER Agent-Based Model

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •