The rules:

Every generation, creatures are paired up randomly and each pair gives birth to a litter of size 1-6.

Then, 100 food is divided equally between all families.

Litters that don't get at least 1 food per child die out completely.

We'll start with 20 creatures:

19 creatures are 'normal'.

1 creatures has randomly mutated the 'runt' gene:

If there is not enough food and the smallest* child carries the 'runt' gene, they will sacrifice themselves. (This process of runts sacrificing themselves will repeat until either there is enough food for the litter to survive, or the smallest child does not carry this gene at which point the entire litter dies.)

*there is not actually a notion of 'size' in the code at all. it's just based on order of birth.

Comments

Log in with itch.io to leave a comment.

(2 edits)

One last thing - looks like I accidentally coded in a weird error that makes the runt gene a lot worse than it should be. If a family has just enough food (i.e. 4 kids, 4 food) then a runt will sacrifice itself for no reason at all.

See example below, where a family of 6 runt-gene-carriers sacrifices itself down to 2 children, with 3 food available. Whoops.

 

Also of interest: A population of all gene-carriers maintains a higher and more stable population than a population of no gene-carriers.

(All rr hovers around 50-60, while no r fluctuates between 25-50)

"r" families sacrifice gene-carriers at benefit to non-gene-carriers; the turning point appears to be that once you start to see "rr" families, they are sacrificing gene-carriers purely to benefit gene-carriers. That's when the gene begins to completely dominate.

Made this sim to test out a hypothetical gene from The Selfish Gene:

"A gene that gives the instruction 'Body, if you are very much smaller than your litter-mates, give up the struggle and die', could be successful in the gene pool, because it has a 50 per cent chance of being in the body of each brother and sister saved."

My implementation is not "if you are very much smaller than your litter-mates," rather it is "if your litter is going to starve and you are the smallest one," but aside from that I think it is a relatively faithful interpretation.

Often the mutated gene does not survive. It can struggle for a while, flickering at 1-6 individuals, and die out. (Sometimes it dies in the very first generation by sheer dumb bad luck. That's life.) If it reaches a certain critical mass, though, it eventually spreads throughout the entire population.