https://github.com/chaoqiansci/spatial-pggs-any-network

This includes a Matlab function for calculating the critical synergy factor of spatial PGGs on any network structure and Python programs for agent-based simulations.

https://github.com/chaoqiansci/spatial-pggs-any-network

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.3%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

This includes a Matlab function for calculating the critical synergy factor of spatial PGGs on any network structure and Python programs for agent-based simulations.

Basic Info
  • Host: GitHub
  • Owner: ChaoqianSCI
  • Language: MATLAB
  • Default Branch: main
  • Size: 0 Bytes
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme

README.md

Spatial-PGGs-any-network

This includes a Matlab function for calculating the critical synergy factor of spatial PGGs on any network structure and Python programs for agent-based simulations.

Files

  • everythingrbcaccu.m - A matlab function. Please input population size N and $N\times N$ adjacency matrix wij.

If wij(i,j)=1 then i and j are neighbors, and vice versa if wij(i,j)=0.

The function will then return [rPC,rDB,rBD,rPCaccu,rDBaccu,rBDaccu,bcPC,bcDB,bcBD,bcPCaccu,bcDBaccu,bcBDaccu]. "r" means critical synergy factor in spatial PGGs. "bc" means critical benefit-to-cost ratio in spatial DGs. "PC" "DB" "BD" means the three update rules. "accu" means accumulated payoff (if there is no "accu" then it is averaged payoff).

  • demo.m - A demonstration for the use of everythingrbc_accu.m, taking the star graph as an example.

  • pgggraph_PC.py - A python program for agent-based simulations of spatial PGGs using averaged payoffs under the PC rule.

  • pgggraph_DB.py - A python program for agent-based simulations of spatial PGGs using averaged payoffs under the DB rule.

System requirements

  • We use Matlab 2022a and Python 3.9 in PyCharm.

  • We used the mentioned softwares in Windows 11.

Installation guide

  • Simply download Matlab and PyCharm in their official websites. Matlab may need costly subscription.

  • Install the required packages within these softwares if there is any error report.

  • Typical install time may be within one hour.

Demo of Matlab

  • For numerical solutions of the theoretical predictions on specific networks, refer to demo.m.
  • It shows an example of the $n=9$ star graph.
  • Please put demo.m and everythingrbc_accu.m in the same fold and run demo.m.
  • The outcome should be the critical synergy factors for cooperation success in spatial PGGs (and critical benefit-to-cost ratio in DGs) across all model details.
  • Typical run time should be within 2 seconds.

Demo of Python

  • For agent-based simulations on star graphs, refer to pgggraphPC.py and pgggraphDB.py, depending on the update rule you need.
  • You may need to create a project in Python, with a "main.py" file. You can add pgggraphPC.py and pgggraphDB.py into your project and run them.
  • The outcome should be the average stationary cooperation fraction as a function of synergy factor $r$.
  • Typical run time should be more than 24 hours, depending on the performance of your computer. This is a parallel program and may take up all of your computer's CPU resources.

Q&A

For any question about this program, please contact

Chaoqian Wang, Email: CqWang814921147@outlook.com

Owner

  • Name: Chaoqian Wang
  • Login: ChaoqianSCI
  • Kind: user

GitHub Events

Total
  • Push event: 12
  • Create event: 2
Last Year
  • Push event: 12
  • Create event: 2