jvh / evolution-of-cooperative-traits

Explores under which conditions cooperation flourishes in a given environment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Evolution of Cooperative Traits

Explores the conditions in which cooperation wins over selfish genotypes in a given population. In this model, 4 genotypes exist -- large and small group sizes (40 and 4 initial starting size respectively) with each of these being filled with a even mix of cooperative and selfish individuals. My findings show that, given an even distribution of genotypes upon initialisation, small-cooperative groups win out.

5 basic steps are taken during the algorithm to allow for generations within the population:

  1. Making the population.
  2. Forming the groups (aggregation).
  3. Reproduction.
  4. Dispersal of progreny to migrant pool.
  5. Rescaling migrant pool to global maximum in order to reflect distribution of types.

This algorithm presents a reimplementation of model outlined in Powers, S. T., Penn, A. S. and Watson, R. A. (2007) Individual Selection for Cooperative Group Formation.

In addition to the algorithm presented in this repository, a visual representation of the population is represented using pyplot. This graphing covers 2 topics, the first being the change in frequency of genotypes over each generation, and the other being the frequency of unfavourable characteristics (in this model these are a large group size and selfish characteristics) over each generation.

Usage Instructions

These commands should both be ran in the top-level directory of the repository.

Prerequisites

Install python3.

Run command pip install -r src/requirements.txt in order to install package requirements.

Commands

Note: You must run the genetic algorithm before graphing.

  • Genetic algorithm: python src/main.py.
  • Graphing: python src/plot_graphs.py.

Extensions

I have also provided a number of extensions to further explore the parameters necessary for cooperative majority. These are as follows.

Extinction and Migration

In this current model, only the pre-defined death rate determines which individuals shall leave the simulation. However, this is unrealistic as through generations potential disasters could occur which would cause entire groups to wipe out. With the group becoming extinct, this leaves a resource gap which others would like to fill. In this extension, after a generation, an extinction event inversely proportional to the proporition of cooperation occurs. This gap is then filled randomly by groups, with the likelihood of sending a single individual out being proportional to the ratio of cooperatives in the group.

This extension heavily favours cooperative groups, particularly small demes. This is because a group with more cooperatives is more immune to an extinction event, similarly a group is more likely to send a member out if they have a higher proportion of cooperatives (and therefore a cooperative agent).

Join Preferred Group

This extension covers the group forming stage. Previously, groups were formed by placing individuals according to their group size attribute. However, often times this may not be possible. This extension offers a random chance, bounded by a constant, in which individuals may be placed in a group which they have not specified.

In this extension, I found that, as the careful balance was interrupted, selfish even with larger chances of being placed in the correct group.

Random Mutation Rate

When reproducing, there is a random chance that the progeny shall undergo a mutation in which their social behaviour is altered (i.e. selfish/cooperative). Even with a relatively low chance of mutation, selfish large often ended up winning. As mentioned in join preferred group, this is due to the careful balance being interrupted. However, this is through a different mechanism -- instead the possibility of mutation raises the issue that wholly cooperative groups could have a selfish individual infilitrate before the mixing phase, where they would take advantage of the abundant resources left by cooperative individuals.

About

Explores under which conditions cooperation flourishes in a given environment


Languages

Language:Python 100.0%