Ultimate Biotech Biological Evolution Simulation

Breed the top fraction of 1,000 organisms each generation. The trait mean moves by the response R = h2 x S. Compare the simulated cumulative response with the breeder's-equation prediction.
Blue: generation 0. Orange: current trait distribution. Dashed line: truncation threshold. Right plot: mean trait by generation.
The science
Trait z = g + e, genetic value g and environmental noise e. Heritability h2 = Vg / (Vg + Ve). Truncation selection keeps the top fraction p; the selection differential S = mean(selected) - mean(all). Offspring genetic value = mean of two parents + segregation noise with variance Vg0/2 (infinitesimal model). The breeder's equation R = h2 S predicts the per-generation response; selection also lowers Vg (the Bulmer effect), so h2 drifts down and gains slow. The check sums the realised h2 x S each generation and compares it with the simulated change in mean. Simplifications: no linkage, no mutation, no trade-offs, constant environment, fixed population size.