Rabbits eat grass and breed. Foxes eat rabbits and breed. Each rule is simple, yet together the numbers swing up and down in a rhythm, with the foxes always a step behind the rabbits.
Watch the phase plot: the loop shows rabbits and foxes chasing each other. Lower the hunt rate a little and the swings calm down. Try Overhunting: foxes that are too good at hunting starve themselves. Use the same seed to repeat a run, or change it to see how luck matters. Export the data as CSV to study the time series, or run a sweep across the hunt rate. Agents: a 44 x 30 wrapped grid of grass patches; each day a patch regrows with probability r_g; a rabbit moves to a random neighbour, eats the grass if there is any (else starves after 6 hungry days) and a fed rabbit has a kit with probability b_r; a fox moves, catches a rabbit within one cell with probability h per rabbit it meets (at most one a day), dies of age with probability d_f or after 18 hungry days, and a fed fox has a cub with probability b_f. Population is capped at 2,000 animals. Equations: Lotka (1925) and Volterra (1926), dx/dt = a x (1 - x/K) - B x y and dy/dt = D x y - G y, integrated with fourth-order Runge-Kutta (step 0.1 day) from the same start numbers, with a = b_r, B = 9 h / cells, D = 0.67 B b_f, G = d_f + 0.02 and K = 0.3 cells r_g / (r_g + 0.1); this mapping is a rough match, not a fit. The classic model (no K) has its equilibrium at G/D and a/B and conserves V = D x - G ln x + B y - a ln y. The sweep varies the hunt rate for 500 days with the current settings and the seed, repeating over seeds. Runs on your device.