This repository contains a modlue code for a public goods game (PGG) between cooperator and defectors (optional: loners). The PGG is either played with other randomely picked players from the set of all players (bucketModel) or when players are spatially aranged on a grid with players from their 3x3 neighborhood (latticeModel). Players can update their strategy using a probabilistic revision protocol by looking at a random player in the bucket or in the neighborhood, respectively.
Hauert, C., De Monte, S., Hofbauer, J., and Sigmund, K. (2002a). Replicator dynamics for optional public good games. Journal of Theoretical Biology, 218(2):187–194
Hauert, C., De Monte, S., Hofbauer, J., and Sigmund, K. (2002b). Volun- teering as red queen mechanism for cooperation in public goods games. Science, 296(5570):1129–1132.