Skip to main content

Payoff-Driven Stochastic Spatial Model for Evolutionary Game Theory

Project description

piegy

The package full name is: Payoff-Driven Stochastic Spatial Model for Evolutionary Game Theory

Provides a stochastic spatial model for simulating the interaction and evolution of two species in either 1D or 2D space, as well as analytic tools.

Installation

pip install piegy

Documentation and Source

See source code at: GitHub-piegy repo. The piegy documentation at: piegy docs.

How the Model Works

Our model can be summarized as "classical game theory endowed with a spatial structure and payoff-driven migration rules". Consider two species, predators and preys (denote by U and V), in a rectangular region. We divide the region into N by M patches and simulate their interaction within a patch by classical game theory (i.e., payoff matrices and carrying capacity). Interactions across patches are simulated by payoff-driven migration rules. An individual migrates to a neighboring patch with probability weighted by payoff in the neighbors.

We use the Gillepie algorithm as the fundamental event-selection algorithm. At each time step, one event is selected and let happen; and step sizes are continuous, dependent on the current state in the space. Data are recorded every some specified time interval.

Analytic Tools

The piegy package also provides a wide range of analytic and supportive tools alongside the main model, such as plotting, numerical tools, data saving & reading, etc. We also provide the piegy.videos module for more direct visualizations like how population distribution change over time.

Examples

To get started, simply get our demo model and run simulation:

from piegy import model, figures

sim = model.demo_model()
model.run(sim)

dynamics = figures.UV_dyna(sim)
U_hmap, V_hmap = figures.UV_heatmap(sim)

The figures reveal the population dynamics and steady state distribution.

Acknowledgments

  • Thanks Professor Daniel Cooney at University of Illinois Urbana-Champaign. This package is developed alongside a project with Prof. Cooney and received enormous help from him.
  • Special thanks to the open-source community for making this package possible.

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

piegy-1.0.0.tar.gz (33.6 kB view details)

Uploaded Source

Built Distribution

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

piegy-1.0.0-py3-none-any.whl (35.1 kB view details)

Uploaded Python 3

File details

Details for the file piegy-1.0.0.tar.gz.

File metadata

  • Download URL: piegy-1.0.0.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.8

File hashes

Hashes for piegy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b5281f05b99be2f027abe73ff333571b81ec17f290c727b15a742438bcc520f0
MD5 bc58150cff66b0f104ee712d964de358
BLAKE2b-256 4c00422998a6b277b8d77eb0daffb7b107f7944cecf5c2f4cafd42ca986fd429

See more details on using hashes here.

File details

Details for the file piegy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: piegy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 35.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.8

File hashes

Hashes for piegy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 edcdf85cae71b4c00110a326e42992c5ef849e4b52ba9ed48d8e1e54479c0ff9
MD5 ef9d95a5c1da73d0d7957bb655b5f433
BLAKE2b-256 16f6f74c704cdbaac083071163de54fac13e06264893d4498bc0ebd08fac5e44

See more details on using hashes here.

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