Recognition - Friend or Foe Discrimination
A simulation exploring various gene-based models of recognition of friend or foe between cells. Each model represents a distinct combination of a cell's genes involved in recognizing its neighbours.
Recognition
The interaction between two cells determines whether one cell can recognize the other as a friend or foe. Recognition is evaluated through gene comparison. If the genes are sufficiently similar, the other cell is recognized as a friend. Conversely, if the genes are sufficiently opposite, the other cell is recognized as a foe.
Gene comparisons use a lenient approach: for similarity-based comparisons, the probability of a match decreases as genetic differences increase. Conversely, for opposite-based comparisons, the probability of a match decreases as genetic differences decrease. Based on the classification of the neighbour, fitness may be gained or lost.
Cell Attributes and Life Cycle
Cell Properties
- Four Circular Genes (A, B, C, D, Z)
- Fitness (0-255)
- Age (+1 with each cycle)
Life Cycle
- Fitness +1 for each neighbouring empty cell.
- Fitness gain or loss from each neighbour depending on selected model (see below) and corresponding gene comparison matches.
- At fitness >= 255 fitness is reduced to 255 minus random value in between 0 and 60.
- At fitness >= 128 cell tries to reproduce, dividing fitness equally to offspring and parent.
- Reproduction may fail if several cells try to divide into an empty cell. Winner is the offspring with the highest fitness.
- During reproduction, there is a 1 in 10,000 chance that a cell mutates a gene, with a mutation range of ยฑ64.
- At fitness <= 0 or age > 40, the cell dies.
Models
Each model code represents a gene-matching pattern between cells, where single letters (A, B, C, D) indicate genes compared sequentially, and the "-OR" suffix means any single match suffices instead of requiring all matches. For example, "AA" matches if gene A matches the neighbour's A, while "ABCA-OR" matches if A matches B, B matches C, or C matches A.