When a bee colony grows too large, it divides in two through a process called swarming ). The queen and approximately half of the workers leave to establish a new colony, while the remaining workers and a daughter queen remain at the original site. The departing bees come to rest on a nearby tree while a remarkably small number of scouts search for new nesting locations. Each reports the distance and direction to a candidate site by performing a waggle dance. At first, the scouts may be visiting and deliberating over more than ten candidate locations. Over a few days, however, the number of candidate locations will reduce. [1]
It is tempting to assume that all of the scouts reach an agreement (i.e. come to consensus) before the colony takes flight to be guided by the scouts to their new home. Tom Seeley of Cornell showed that this is not the case! Instead, the colony will take flight when the scouts have reached a quorum. That is, when a sufficient number of the scouts agree, not necessarily all the scouts. Despite the fact that the colony may take flight with dissenting opinions about the direction it should travel, the colony will collectively select the location that has the quorum-number of scouts voting for it. [1]
In this laboratory exercise, we will implement a modified version of the Boids algorithm to model bees in flight. Then, we will give a configurable number of those bees a preferred direction of travel as described in Effective leadership and decision-making in animal groups on the move by Couzin, Krause, Franks, and Levin. We will conduct experiments to determine how many scouts are required to steer the colony, and compare our results to Couzin et al's mathematical results and Seeley's field measurements. Graduate students will be asked to implement dynamic weighting in their biased groups (as described in the Couzin paper). They will be asked to demonstrate collective consensus in their swarm. This is all demonstrated in the video below.
You are challenged to create the largest swarm that you can manage, subject to the constraint that the swarm must animate at 30 fps. This will require that you think about optimized arithmetic, rearranging the algorithm, parallelization strategies, and overclocking (among other things!).
This laboratory exercise combines the results from two articles:
4760 students will create a system that enables them to replicate the results shown in Figs 1-2 of the Couzin paper. 5730 students will be able to replicate all results from that paper.
Key concepts: Boids algorithm, fixed point arithmetic, computer animation, optimization, VGA, UART
Experience shows that students prefer these webpages short. For that reason, plese find the reading and background materials on the webpages linked below. Please note that the information in these readings will be critical for completing the lab.
Note that these checkpoints are cumulative. In week 2, for example, you must have also completed all of the requirements from week 1.
turnfactor
: 0.2visualRange
: 40protectedRange
: 8centeringfactor
: 0.0005avoidfactor
: 0.05matchingfactor
: 0.05maxspeed
: 6minspeed
: 3maxbias
: 0.01bias_increment
: 0.00004biasval
: 0.001 (user-changeable, or updated dynamically)Write a ProtoThreads C program which does the following:
turnfactor
: 0.2visualRange
: 40protectedRange
: 8centeringfactor
: 0.0005avoidfactor
: 0.05matchingfactor
: 0.05maxspeed
: 6minspeed
: 3maxbias
: 0.01bias_increment
: 0.00004biasval
: 0.001 (user-changeable, or updated dynamically)
- The boundary conditions (box, top/bottom wrapping with configurable width, top/bottom & left/right wrapping)
- The number of boids in each biased subset
- The strength of the bias for each subset
- [5730 students only] Enable/disable dynamic updating for the bias strength of each subset
Your written lab report should include the sections mentioned in the policy page, and: