This simulation works by giving each boid a speed variable which does what it says on the tin, controlling how fast it is. Faster boids burn energy faster, and slower ones burns energy slowly. If a boid runs out of energy, it dies. Also, if a boid eats food, it reproduces, and it's offspring's speed will be changed randomly. The simulation will give you more boids with a slow-to-medium speed, as the slower ones won't burn energy faster, guaranteeing a long life.
Fast boids are green, medium ones are yellow, and slow ones are red. And in the graph below, the red is boids and the yellow is food.