Friends and Foes - Perception and Recognition Combined
This simulation combines perception and recognition mechanisms, allowing cells to first detect neighbours and then determine if they are friends or foes. Watch how different combined strategies compete and evolve over time.
Perception and Recognition
The simulation models two types of interactions between cells: perception and recognition. Perception determines whether a cell can detect a neighbor, while recognition classifies the detected neighbor as either a friend or foe.
Both perception and recognition are evaluated through gene comparison. In perception, if the genes are sufficiently similar, the other cell is perceived. The selected model determines which gene or set of genes is compared. In recognition, if the genes match, the neighbor is recognized as a friend. However, a mismatch does not necessarily imply a foe—foes are identified when the genes are sufficiently opposite.
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 and corresponding gene comparison matches. Not perceived friends don't affect fitness. Not perceived foes double the amount of fitness exchanged.
- 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.