Each island holds a haploid population whose individuals carry a continuous trait x ∈ [0,1] (e.g. relative beak size). Every generation runs a Wright-Fisher update: parents are drawn with probability proportional to their fitness (natural selection), offspring inherit the parent's trait plus a random mutation, and because each island keeps a finite population size N, the sampling itself injects genetic drift — smaller N means noisier, more random swings in the trait mean even with no selection at all.
fitness: w(x) = exp( -(x-θ)² / (2σ²) )
σ = 0.05 + (1 - selection)·0.5
next gen: sample N parents with P(i) ∝ w(x_i)
offspring trait = x_parent + N(0, μ²)
gene flow (if connected):
each generation, swap ⌊0.08·N⌋ random
individuals between island A and island B
Island A is under selection toward θ=0.25, island B toward θ=0.75. With gene flow off, the two populations climb their local fitness peaks independently and diverge — a spatial model of allopatric speciation. Turning gene flow on re-mixes migrants between islands each generation, which drags both means back together and suppresses divergence, just as ongoing migration between real populations can prevent reproductive isolation from forming.
- Population / island — sets N per island; smaller N amplifies genetic drift (the noise term in the update).
- Mutation rate — standard deviation μ of the random trait change added to every offspring each generation.
- Selection strength — narrows the fitness function's width σ, sharpening the pull toward each island's optimum θ.
- Isolated / Connected — toggles migration (gene flow) between the two islands each generation.
This mirrors classic cases like Darwin's finches on the Galápagos or the divergence of cichlid fish across separate lake basins: local selection plus limited gene flow is what lets one ancestral population split into two.