Skip to content
Processing flocking example for CTAG video
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Processing flocking example for CTAG video

Demo Flocking:

Demo Path Following:

Bee Flocking

Usually Bees don't flock like birds but this can be used to understand the agent. This visualization is based on flocking example by Daniel Shiffman. Every bee in formation flock together with three main forces effecting them Separation, Cohesion and alignment.

Bee's steering towards a interesting point(flower or flock) is calculated using


After filling from flower, bees are not really effected for few seconds.

###parameters flowerDistance : Distance to attract bee

onFlowerState : Different state of bee i.e steered to Flower, onFlower, just sat.

onFlowerDuration : will sit on flower for this duration (millisec)

nextOnFlowerDuration : will not be active (attracted, aligned etc) for this duration (millisec)

Ant lanes

left and drag to draw the path which ants can follow. ( path is highlight in debug mode[hit space] )

right click to add new ant with random max speed and force;

###parameters some parameter explaination

AntFollowing.pde > SMOOTH_DIST [to skip the points that are recorded while draging, two adjacent point will have atleast SMOOTH_DISTANCE between them in path]

Vehicle.pde> PLOC_FACTOR are the frame use to lookahead to accelerate towards that location on the path if ant is away from path.

You can’t perform that action at this time.