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.1.12.tar.gz (46.9 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.1.12-cp311-cp311-macosx_11_0_arm64.whl (63.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

piegy-2.1.12-cp310-cp310-win_amd64.whl (77.8 kB view details)

Uploaded CPython 3.10Windows x86-64

piegy-2.1.12-cp310-cp310-win32.whl (77.7 kB view details)

Uploaded CPython 3.10Windows x86

piegy-2.1.12-cp310-cp310-musllinux_1_2_x86_64.whl (66.7 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

piegy-2.1.12-cp310-cp310-musllinux_1_2_i686.whl (67.6 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ i686

piegy-2.1.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (65.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

piegy-2.1.12-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (66.1 kB view details)

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

piegy-2.1.12-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (66.4 kB view details)

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

piegy-2.1.12-cp310-cp310-macosx_11_0_arm64.whl (63.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for piegy-2.1.12.tar.gz
Algorithm Hash digest
SHA256 51519aabbef22c05ad9def48e202466322fb5d42d250d4e9f2c5d4ba701eab1b
MD5 1c6e56db53d29cc5190fd458785822f9
BLAKE2b-256 105d4cc586e3cd6bc913c9990c3623ea7370fc027cb7a3404fd30bdef8a1e635

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for piegy-2.1.12-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 314ddaaf35f2e9eaf02e25dbb23448963c83e3f73234560047d085ee98b0f495
MD5 b65e58331657cb527efa9cb9b99791c6
BLAKE2b-256 81a33cfee16395967aa83901883c22477c8a9c91d1edda6c75922b8ec5d1b824

See more details on using hashes here.

File details

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

File metadata

  • Download URL: piegy-2.1.12-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 77.8 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.1.12-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 cd614aad91ed2517edadc9b17f532e11d8aca9a801935922d378a0e6abc2bded
MD5 f627d5ae559773580338d5dd6f584d21
BLAKE2b-256 acaee2cb571d334e8dc317d1e0d22b49052e610be0f296654dc4537d50d2666c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: piegy-2.1.12-cp310-cp310-win32.whl
  • Upload date:
  • Size: 77.7 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.1.12-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 e25f2d1bb352ba62f1677de5a12ca8147aac217b09df2fec431f0baabbdc3b92
MD5 cab5878791b31459cb714ad6165d9489
BLAKE2b-256 9031d8acf1482d0a3a8f646b8e4e57f3cb1d1145661a90525d2533a74806f4e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for piegy-2.1.12-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 fbc9c861cb74d27fdf8587ed056afe8fddc0e96d396c2ca33e72b93f9dc41851
MD5 b45f89ebe37810e384f66e6d84694647
BLAKE2b-256 0724fd12c3ea9740d3557b576c26c32f369bcb85bfd746ecc969c43fe18d90a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for piegy-2.1.12-cp310-cp310-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 76d21b53e2e10f97e61bc3af03b64998a1035f168f35c789944bd47c9ac26c83
MD5 b45da4d1115f1bf74e685ebc745cbd4a
BLAKE2b-256 6d74cac62918fed25e59ee20bb857627ba46de3299cd3684fb46de941bb865c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for piegy-2.1.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eb18c76c7f90ec8d272cf780ca6d6fc41b847fd434024cac9da06faf816f37cb
MD5 e31ab511c81a8596a3d45745f29ca137
BLAKE2b-256 a2e0d921380b09d0c5a67c6533593d16709e76f14dfdf97d19b027fab247311d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for piegy-2.1.12-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 a041acb8a7dd1e61aafd28c745e2c51825d7b5c5e991d4cc71058759ce25e3c0
MD5 2d931d29b6ba5d4ea5301f30517e3579
BLAKE2b-256 055df3c410b5bab15b7fd5a65300e8e2b1a2aa52c505ab21eb88f4de0ab98ebe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for piegy-2.1.12-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1cd32aae1880c015f2f15c6d0538af2a2fa3174b3b5cbeb85f9bfdc0458ac94f
MD5 23fa4a4432efd5d15a428e4577ece56b
BLAKE2b-256 abf827ade52d35bc24bf252427d4d45c8b24bbe68c1a333a9e5bf0ae006e77a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for piegy-2.1.12-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c5c3d29ed2051f9c2cca812dbabdcac5f55665f2b9e5b001b90d70320aac9b33
MD5 a823f51aa81da91faa3b833a3e12e87f
BLAKE2b-256 a494092aa3f24e07110d41590641f903226d94cbd2f31d64274bca113d1ecdbb

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