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. "pi" refers to "payoff, and "egy" is taken from "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

To install piegy, run the following in terminal:

pip install piegy

Documentation and Source

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

How the Model Works

Our model can be summarized as "classical evolutionary game theory endowed with spatial structure and payoff-driven migration rules". Consider two species, predators and preys (denoted 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 the step size is 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 such as how population distribution change over time.

C Core

From version 2 on, the piegy simulations are now equipped with a C core, which makes it significantly faster than previous versions.

Examples

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

from piegy import simulation, figures
import matplotlib.pyplot as plt

mod = simulation.demo_model()
simulation.run(mod)

fig1, ax1 = plt.subplots()
figures.UV_dyna(mod, ax1)
fig2, ax2 = plt.subplots(1, 2, figsize = (12.8, 4.8))
figures.UV_heatmap(mod, ax2[0], ax2[1])

The figures reveal population dynamics and steady state population 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-2.2.2.tar.gz (47.2 kB view details)

Uploaded Source

Built Distributions

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

piegy-2.2.2-cp311-cp311-macosx_11_0_arm64.whl (64.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

piegy-2.2.2-cp310-cp310-win_amd64.whl (78.9 kB view details)

Uploaded CPython 3.10Windows x86-64

piegy-2.2.2-cp310-cp310-win32.whl (78.9 kB view details)

Uploaded CPython 3.10Windows x86

piegy-2.2.2-cp310-cp310-musllinux_1_2_x86_64.whl (67.3 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

piegy-2.2.2-cp310-cp310-musllinux_1_2_i686.whl (68.4 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ i686

piegy-2.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (66.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

piegy-2.2.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (66.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

piegy-2.2.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (66.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

piegy-2.2.2-cp310-cp310-macosx_11_0_arm64.whl (64.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for piegy-2.2.2.tar.gz
Algorithm Hash digest
SHA256 55b0072625c6350af13e85fa7e4014bb5d4fd923429d3ae9354c34fd7b52c226
MD5 00aab8913d8b33264c89dba579419a0a
BLAKE2b-256 3b2ffcd666c695374595adb5cdea476951f78c8cf222885c15670ac37b147323

See more details on using hashes here.

File details

Details for the file piegy-2.2.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for piegy-2.2.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 51267abdf85b92f201b579af3a6b6a993fe198c43ec1b8087ec659f9f1b31e7d
MD5 7906c3f8f212d15dc2e73a24b92200be
BLAKE2b-256 ca1d9431fb8b7f3739249319f98f0c7b113339dbd92ca59226c3b54a65c58a87

See more details on using hashes here.

File details

Details for the file piegy-2.2.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: piegy-2.2.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 78.9 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.10

File hashes

Hashes for piegy-2.2.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6e3a99821ef12dd30cfd9ddb79efbc74d819cb050c1182849b7a46c45be11438
MD5 8649abce40d2e32714d8eedd7ee1cf9e
BLAKE2b-256 c4ab4778f9b1708aacd020e8c4985670ec17b9940710bee9994cbbe4d6675187

See more details on using hashes here.

File details

Details for the file piegy-2.2.2-cp310-cp310-win32.whl.

File metadata

  • Download URL: piegy-2.2.2-cp310-cp310-win32.whl
  • Upload date:
  • Size: 78.9 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.10

File hashes

Hashes for piegy-2.2.2-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 9298d3e03c8586c072e96c9d01613103db65a7d301235e21e15c0b0c088f28bc
MD5 ae4969814a9ef2741075885a7ecb7b2c
BLAKE2b-256 99a4ed4fb0829c1370c6687efa1fe06fd310c527d48770e405475e0fac66f308

See more details on using hashes here.

File details

Details for the file piegy-2.2.2-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for piegy-2.2.2-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4737ff007c7837ae93aba32ae51e6f5fcc5804dc8b96d2ba9e9e7b4d97aebf9a
MD5 921764706ef36674cea66ad24df1e6e1
BLAKE2b-256 d962ef21c5eb018dcf1b8a91e9bc095ca419352412b7cf69e10dbaf02f0dd5e9

See more details on using hashes here.

File details

Details for the file piegy-2.2.2-cp310-cp310-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for piegy-2.2.2-cp310-cp310-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 20faeee413d9f25be27c4614b99811da5b937657773ffb3bde09ebb9abf9c955
MD5 95f2ea716e18d650a93da4aeeab5f8ed
BLAKE2b-256 d03fd354e3da6d5e83feef4b6acf9b623aa7703160494488ce3c3212a7eed150

See more details on using hashes here.

File details

Details for the file piegy-2.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for piegy-2.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6576a5dfa1746e7f14fbf51369e14cb5cdc0aaac88c1eb100a4b41103dc91e3e
MD5 9f4d6dc8b7f6354f3faf7838d8ee470d
BLAKE2b-256 124d6be2eeb6e8fae2a284cdeb11bcac42bb81409f3b7c5838d5ed1b57268de9

See more details on using hashes here.

File details

Details for the file piegy-2.2.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for piegy-2.2.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 71f3976255ab1ff9fadb2baa4c489ed1a905e149befe6f8a931c4a23dc9c7d2c
MD5 168ac404883e7f980f3ca2240e00e99f
BLAKE2b-256 c607a2d49ad733da3878aea5414ef9c592d4701f837d79d981d91a80bb22572f

See more details on using hashes here.

File details

Details for the file piegy-2.2.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for piegy-2.2.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f3789f4d80dee699d5533b9f6d3775d8310b646cc23a862aeb7ab932d543d655
MD5 58b5aa3cebacbdf916f4ab604cada12d
BLAKE2b-256 da7226f5087b26f3b2413c89e3a71650747dc7317f7d2632de69d435beeafb4f

See more details on using hashes here.

File details

Details for the file piegy-2.2.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for piegy-2.2.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0e43651e944460ae8d728fe457c9367b5de06b24101f70533f0111d32bd50a0e
MD5 61e1e2d2b3a75e05434ca8234d51a2fa
BLAKE2b-256 037e69138de115ce485f6af4d02d6c8f3651fa00c85e15824ab04a7c29c53102

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