Direct Reciprocity
Status
Python-backed. This page describes the moran_models/nowak_mechanisms/direct_reciprocity/ package in the sibling EvolvedCooperation repository. It is not yet a browser replay case study.
Direct reciprocity is cooperation sustained by repeated encounters between the same individuals. An agent is more likely to help a neighbor from whom it has recently received help — "I scratch your back, you scratch mine."
How It Is Implemented Here
Each site carries a reciprocity memory variable alongside its cooperation trait. At each step, expressed cooperation is scaled by that memory:
where is the site's memory of recently received help. After reproduction, the memory of the offspring is updated from the parent's memory and the positive return it received in the previous step:
This means agents that have been helped in the past express more cooperation, which tends to attract further help — a direct reciprocal feedback loop.
Key Parameters
| Parameter | Default | Role |
|---|---|---|
memory_baseline_expression | 0.35 | Minimum cooperation expressed regardless of memory |
memory_expression_gain | 0.85 | How strongly memory amplifies cooperation expression |
memory_decay | 0.35 | Weight on previous memory versus recent experience |
B_plus_scale | 1.0 | Scales cooperative benefit produced per unit trait |
C_scale | 0.2 | Private cost per unit trait |
Python Module Layout
moran_models/nowak_mechanisms/direct_reciprocity/
__init__.py
direct_reciprocity_model.py
direct_reciprocity_pygame_ui.py
config/
direct_reciprocity_config.py
Usage
./.conda/bin/python -m moran_models.nowak_mechanisms.direct_reciprocity.direct_reciprocity_model
Live viewer:
./.conda/bin/python -m moran_models.nowak_mechanisms.direct_reciprocity.direct_reciprocity_pygame_ui
References
- Axelrod, R., & Hamilton, W. D. (1981). The evolution of cooperation. Science, 211(4489), 1390–1396. https://doi.org/10.1126/science.7466396
- Nowak, M. A. (2006). Five rules for the evolution of cooperation. Science, 314(5805), 1560–1563. https://doi.org/10.1126/science.1133755