Skip to content

WyrmSnack/ant-colony

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ant Colony — Browser stigmergy sandbox

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.

Quick start

npm install
npm run dev

Open 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 dist

Validation scripts

TypeScript checks under scripts/ (e.g. raid behaviour) are not part of the default build; run with npx tsx if you use them.

How stigmergy works here

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.

Layout

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

About

Interactive ant-colony simulation: stigmergy, pheromone trails, foraging, optional two-colony competition. TypeScript, Vite, Canvas 2D. Open source.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors