Perception - Neighbor Detection
A simulation exploring various gene-based models of perception between cells. Each model represents a distinct combination of a cell's genes involved in perceiving its neighbours.
Perception
The interaction between two cells determines whether one cell can perceive the other. Perception is evaluated through gene comparison. If the genes are sufficiently similar, the other cell is perceived. The selected model defines which gene or set of genes is compared. As a result, a cell may or may not perceive its neighbour.
Gene comparison follows a lenient approach, where the probability of a match decreases as genetic differences increase.
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.