Home▸Animals & Their World▸Aardvark Termite Foraging Lab (2D)

Aardvark Termite Foraging Lab (2D)

A 2D optimal-foraging simulation: an aardvark forages a landscape of termite mounds under the marginal value theorem, leaving each mound once its extraction rate drops below the landscape-wide average. Adjust mound density to see the optimal giving-up time shift.

Animals & Their World2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-3d-aardvark-termite-foraging-lab ↗ Open standalone

This 2D companion strips the aardvark's foraging problem down to the numbers that actually drive it. Each termite mound on the landscape has its own colony size and a diminishing-returns extraction curve — the deeper the aardvark digs into one mound, the harder it gets to pull out more termites. Rather than digging on a timer, the aardvark tracks its own running average energy rate for the whole session, travel time included, and leaves a mound the instant that mound's current extraction rate drops below that average — the marginal value theorem's central prediction. The mound-density slider makes the theorem's most testable claim visible: pack mounds closer together, and cheaper travel raises the landscape average, so the optimal giving-up time at each mound gets shorter.

⚙ Under the hood

2D optimal-foraging simulation implementing the marginal value theorem: each termite mound follows a Michaelis-Menten diminishing-returns extraction curve, and the aardvark compares its instantaneous extraction rate against a running landscape-wide average (energy gained over total time, foraging plus travel) to decide when to move on. A mound-density slider changes travel cost and therefore the optimal giving-up time; a colony-size-variability slider controls how unevenly resources are spread across mounds.

aardvarkoptimal foraging theorymarginal value theoremtermite moundsgiving-up time2D

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)