NetLogo banner

NetLogo Publications
Contact Us

Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Farsi / Persian


NetLogo User Community Models

(back to the NetLogo User Community Models)

[screen shot]

If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".(The run link is disabled for this model because it was made in a version prior to NetLogo 6.0, which NetLogo Web requires.)


This is a natural/artificial selection model that shows the result of two competing forces on natural selection of the speed of prey. Which force dominates depends on the behavior of predators.

One force is that predators that chase prey, tend to catch slower moving prey more often, thereby selecting for prey that are faster over many generations of offspring.

Another force is that predators who wait for their prey without moving, tend to catch prey that are moving faster more often, thereby selecting for prey that are slower over many generations of offspring.

By also adjusting whether bugs try to avoid the predator and the predictability of their motion, a different one of these competing forces will tend to dominate the selective pressure on the population.


You assume the role of a predator amongst a population of bugs. To begin your pursuit of bugs as a predator, press SETUP to create a population of bugs, determined by the six times the NUMBER-BUGS-EACH-SPEED slider. These bugs that are created are randomly distributed around the world and assigned a speed.

When you press GO the bugs begin to move at their designated speeds. As they move around, try to eat as many bugs as fast as you can by clicking on them. Alternatively, you may hold the mouse button down and move the mouse pointer over the bugs.

The six different speeds that a bug might move at are distributed amongst six different sub-populations of the bugs. These speeds are genetically inherited. With each bug you eat, a new bug is randomly chosen from the population to reproduce one offspring. This bug's offspring is an exact duplicate of the parent (in terms of its speed, orientation, and location). The creation of this new offspring keeps the overall population of the bugs constant.

Initially there are equal numbers of each sub-population of bug (e.g. ten bugs at each of the 6 speeds). Over time, however, as you eat bugs, the distribution of the bugs will change as shown in the "Frequency of bugs" Histogram and the "Number of Bugs vs. Time" graph. In the histogram, you might see the distribution shift to the left (showing that more slow bugs are surviving) or to the right (showing that more fast bugs are surviving). Sometimes one sub-population of a single speed of bug will be exterminated. At this point, no other bugs of this speed can be created in the population.


NUMBER-BUGS-EACH-SPEED is the number of bugs you start with in each of the six sub-populations. The overall population of bugs is determined by multiplying this value by 6.

SPEED-FACTOR is an overall speed coefficient to use to speed up or slow down all the bugs, without making their motion jerky. This is an important slider to adjust to compensate for different speed platforms the model might run on.

SPEED-COLOR-MAP settings help you apply color visualization to the speed of the bugs. The "all green" setting does not show a different color for each bug based on its speed". Keeping the color settings switched to something besides "all green" can tend to result in the predator (the user) unconsciously selecting bugs based on color instead of speed.
The "rainbow" setting shows 6 distinct colors for the 6 different speeds a bug might have. These color settings correspond to the plot pen colors in the graphs.
The "blue red" setting shows the lower half of the speeds of the starting population as blue, and the upper half as red.
The "purple shades" setting shows a gradient of dark purple to light purple for slow to fast bug speed.


This histogram tends to shift right if you assume the role of chasing easy prey.

This histogram tends to shift left if you assume the role of waiting for prey come to you. (The same effect is achieved with moving the mouse around the view randomly)


Wait in one location for the bugs to come to you by placing the cursor in one location and holding down the mouse button. All bugs that run into you will be eaten.

Chase bugs around trying to catch the bug nearest you at any one time by holding the mouse button down and moving the cursor around the view after the nearest bug.


The Bug Hunt Speeds model includes bugs that wander in a path that is not a straight line and allow you to set whether the bugs avoid the predator. Both of these characteristics as well as speed are inheritable characteristics in the Bug Hunt Scurry model.

A HubNet version of the model with adjustable starting populations of bugs would help show what happens when two or more competitors assume similar vs. different hunting strategies on the same population at the same time.


Bug Hunt Camouflage


Inspired by EvoDots software:

To refer to this model in academic publications, please use: Wilensky, U. (2005). NetLogo Bug Hunt Speeds model. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

In other publications, please use: Copyright 2005 Uri Wilensky. All rights reserved. See for terms of use.

(back to the NetLogo User Community Models)