HackerTube.dev

ants simulation

Hugh Lomas · 1.5K views · 2014-10-15 · 0:31

Open on YouTube ↗

If playback is restricted in your region, try opening the original video. Use Mark watched to add it to your marked videos.

Overview

A one-minute visualization of a simulated ant colony in which ants follow pheromone trails, with the source code on GitHub. It shows emergent behavior arising from simple rules.

On Hacker News

Linked in ant-simulation threads as a compact, open-source example of emergent behavior.

Recommended by 1 HN people across 1 months · HN mentions 2014–2022

Topics

Search by tags

What people said

newman8r · 2018-12 · Recommendation

Take a look at this visualization [VIDEO] There's a repo in the description. Might not be specifically relevant to your project though

Read the original HN comment ↗
hughrlomas · 2022-07 · Reference

This is great to see. Years ago I created a basic simulation using the same principles of pheromone gradients, one for the nest and one for food. [VIDEO] It a fascinating example of emergent behavior from simple rules. I've been wanting to find time to revisit the concept and produce an updated version, your simulation seems to include everything I wanted to do and more.

Read the original HN comment ↗
hughlomas · 2014-10 · Reference

I loved reading this because I made something exceedingly similar a few years ago, and I'm similarly fascinated with how complex behavior can emerge from such simple rules. [VIDEO] My ants also had no conception of where their home was located, their behavior is entirely pheromone driven. They can "read" pheromones from any adjacent cell. They leave a pheromone every movement depending on which state they are in, either "find food" or "return food". In my system, the pheromones have a strength. Whenever an ant touches the nest, his "nest pheromone" is at full strength (255). Each movement decreases the strength by 1. This sets up a natural gradient of nest strength for ants to follow. They also "deteriorate" each round as yours do. A similar setup is used with food, such that a high food scent is created when they pick up food, and decreases in strength as they return to the nest. So to find food, they try to move up a food gradient or down the nest gradient (away from the nest), while to return food they move up the nest gradient (towards the nest). Their searching consists of a random walking into cells that have no nest scent, or following a food trail. They have an energy cost for moving, and if it's too low they have to eat a piece of food. Returning a piece of food to the hill spawns a new ant. The lines on the right side show the population of each colony and the total food on the board. From these extremely basic rules, they are very efficient at clearing the "world"

Read the original HN comment ↗

Sources

Video by Hugh Lomas, played through YouTube.

Data and selection notes

HN summaries and labels may contain AI errors. HN dates refer to discussions, not video publication.

HN Library: HackerTube export (2026-10-31) and open-index/hacker-news. Upstream summaries and classifications may contain AI errors.

Views, duration and playback status refresh separately from the published catalog. When an update fails, existing data remains visible.

Selection checks
  • SaaS & AI candidates: Topic keywords do not match
  • Editor-approved picks: Editorial review is required

Rule matches identify candidates. They do not guarantee video quality or financial results.

About the library and its sources