Interactive simulation of ants foraging through stigmergy: pheromone trails form and decay without a central planner. Built with TypeScript, Vite, and Canvas 2D (high ant counts via typed arrays and grid-based fields).
Features include two-layer food/home pheromones, evaporation and diffusion, obstacles, random food, optional two-colony mode with raids and combat, harvest scoring, competition UI, territory-style trail outlines, and a benchmark harness.
npm install
npm run devOpen the URL Vite prints (usually http://localhost:5173). Use the sidebar for sliders, two-colony toggle, territory outlines, and benchmarks.
npm run build # typecheck + production bundle
npm run preview # serve distTypeScript checks under scripts/ (e.g. raid behaviour) are not part of the default build; run with npx tsx if you use them.
Ants alternate searching (follow food pheromone, lay home pheromone) and carrying (follow home pheromone, lay food pheromone). Sensors sample the field ahead; steering combines gradients with noise. Global evaporation and optional diffusion reshape trails over time so paths emerge, strengthen, and fade when food moves or dries up.
ant-colony/
index.html Vite entry
package.json
tsconfig.json
src/
main.ts app + sim loop
config.ts tunables
sim/ AntSystem, grids, pheromones, food, obstacles
render/ Canvas2D (WebGL stub)
ui/ controls, stats, competition panel
scripts/ optional TS validation helpers
docs/ renderer roadmap notes