MONASH UNIVERSITY
SCHOOL OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING
HONOURS YEAR

FIT4012 : Procedural modelling, animation
& artificial life in computer graphics

Assignment Notes


Title :

A simulation of bee foraging: vision and the accuracy versus speed trade-off
Simulation design by A. Dorin and A.G Dyer

Date Due: Refer to main page
Weight: 100% of your final mark for this unit
Submission: CD/DVD-ROM or emailed tar file.

Specifications

bumblebee Overview:  This project examines how bees interact with flowers to collect nutrition. Specifically, the model attempts to explain how different bee foraging strategies affect the success of a hive. This will be a very exciting project with real-world significance for understanding how flowers (and thus agricultural and industrial crops and natural ecosystems) are pollinated.

Aim: This project gives you an opportunity to test your coding skills on a real biological phenomenon that has not yet been fully understood. The best presented and prepared results will be used to assist in understanding how bees forage. It is hoped that they may contribute to the publication of a journal or conference paper on the subject.

Below you will find a summary description of the real bees’ behaviour, their environment, and some suggestions as to what you need to code into your software simulation. During the unit (probably about 3 weeks in), Adrian Dyer will visit to discuss your questions about bees. He is an expert on bee vision and behaviour. Please prepare questions for him as you begin to work on this project.

Make sure you have read the following papers and attended the class discussion:

References.

  1. Morawetz & Spaethe (2012), "Visual attention in a complex search task differs between honeybees and bumblebees", Journal of Experimental Biology, 215, pp. 2515-2523
  2. Dyer, A. G., A. Dorin, et al. (2012). "Colour reverse learning and animal personalities: the advantage of behavioural diversity assessed with agent-based simulations", Nature Precedings (March): 20pp.

Foraging bees must search their foraging patch for "target" flowers that they have learnt provide nectar rewards. They must avoid wasting time by landing on "distractor" flowers that do not offer rewards. When the colours of the target and distractor flowers are very different (e.g. blue and yellow), the bees can accurately assess what type of flower they are looking at. But how does a bee, when presented with a scene containing numerous flowers of different types, scan that scene from its current location to find where the target flowers are?

Morawetz and Spaethe [1] propose that bees of different species may conduct what appears to be a "Parallel" style visual scan (Bumblebees) that is not slowed by distractors, or a "Serial" styled scan (Honeybees) that is more time-consuming when distractors are present. In this simulation we will model Parallel and Serial scan bees as "agents" searching a large grid world to see if we can determine the kinds of environment in which each visual scan strategy is most effective.

1. BEE AGENTS

Bees are central place feeders that leave their hive to search for nutrition provided by flowers. As we are not concerned about bee travel times, only their decision making times (as determined by visual scanning technique), you should model bees that:

Model bee colonies containing 100 foraging agents.

A Bumblebee can travel between 2m/s when foraging and 4m/s when returning to its hive (Spaethe et al. 2001). However, for this simulation, model bees that can travel one grid square per simulation time-step. In general, this travel time may be considered a variable, TravelTime. We are only interested in the effects of different scanning strategies, not flight speed, so we will ensure all bees travel at a standard speed.

Bees can use multiple cues (vision and olfaction) to help find flowers. E.g. (Streinzer et al. 2009). This current model only considers visual search and scan.

In this model, bees can distinguish with 100% accuracy between two flower types, FTarget and FDistract, which occur in their environment. Flower type FTarget offers a reward, FDistract does not. Details of the flowers are given in a section below.

An individual bee knows which flowers it has visited and will not visit a flower twice in a single foraging simulation.

Each time a bee visits a FTarget it collects one reward point.


2. FLOWER DETECTION

Bee spatial acuity is poor, and in real life bumblebees can only detect a plant’s cluster of 3-5 flowers (each flower of 2.5 cm diameter) at a distance of approximately 0.7m (Dyer et al. 2008), (Wertlen et al. 2008). Detection appears to be a step function so we will model it as distances > 0.7m — not detected, distance < 0.7m — 100% chance of detecting a flower that is present. In addition, bees typically see the area in front of them more effectively than to the back. Our model will be based on a grid world of cell size 0.35m, so a bee will be able to see flowers in its neighbouring grid cells as follows.

For our model, we will assume that a bee can detect the presence of a flower in a neighbouring grid cell to the front of it, or to the front diagonals, or to the sides with 100% accuracy when it is foraging. The visible areas for a bee facing North and North East are provided as coloured grey cells in Figure 1 a&b as examples.

A bee will move into a grid cell towards a target if it has not visited that target before. It will then visit that target in VisitTime to collect its reward.

A bee using a Parallel scan digests all of the information it sees about flower locations in its visible range simultaneously (Figure 1 a&b, the bee can see into all of the grey cells and its own cell). This takes a constant amount of time (ParallelTime), regardless of how many flowers it can see and regardless of whether or not there are distractors or targets in its view. It is as if the bee grabbed a "digital image" of the whole scene visible to it and in ParallelTime it spots the pixel of that image that contains the target closest to its front whilst ignoring all the non-target pixels.

A Parallel bee will move towards the unvisited target it sees that has the lowest numbered cell in its visible range. (It prefers to forage forwards.) If there are two target flowers with equal cell numbers, it chooses randomly. If it finds no target it will make a random move into any one of its neighbouring cells and update its heading accordingly.

A bee using a Serial scan examines one flower in its visible region at a time in SerialTime each, until it finds a target, or until it has examined all the flowers it can see and none were found to be targets.

The numbers in the grey coloured cells of Figure 1 a&b show the order in which the Serial bee examines the cells visible to it if they contain flowers. A Serial bee will choose randomly whether to look carefully at a left flower first or a right flower first if two flowers are located in the cells either side with the same number. I.e. The bee will always examine cell 1 first if it has a flower, then the two cells numbered 2 in random order if they both have flowers, then the two cells numbered 3 in random order if these cells contain flowers. It will not spend any time looking in a cell that has no flower. Examining a cell with a flower takes a constant amount of time, SerialTime, to decide from the current position if the visible flower is a target or distractor.

A Serial bee will move towards the first unvisited target it sees in its scan - it stops scanning as soon as it finds an unvisited target. If it finds no target it will make a random move into any one of its neighbouring cells and update its heading accordingly.

bee vision N Bee Vision NE

Figure 1a: A North-facing bee and its surrounding grid cells. Visible cells are coloured in grey.

Figure 1b: A North-East-facing bee and its surrounding grid cells. Visible cells are coloured in grey.

FLOWER DISTRIBUTION

Model the grid world as a torus of dimension 571 x 571 square cells. Each cell corresponds to 0.35m. Hence, the foraging site is 200m across and bees can detect flowers at a maximum distance of 0.35 * 2 = 0.7m as desired.

Flowers are distributed in two ways (for different experiments).

Temperate environmental distribution: flowers of types FTarget and FDistract are distributed uniform randomly across the grid world with one flower at most in a cell. This represents a meadow or open grassy area in which small plants with few flowers are scattered randomly.

Tropical environmental distribution: flowers of type FTarget are distributed uniform randomly but only in the "top left" quarter of the grid and FDistract flowers are distributed uniform randomly but only in the "bottom right" quarter of the grid. This represents a tropical forest in which two giant trees of different types sit in an area with no other flowers.

Each FTarget flower contains 1 unit of reward.

Each FDistract flower contains 0 units of reward.

A reward unit is always available on an FTarget flower. I.e. assume the reward is immediately replenished. (Recall that a bee does not return to the same flower within a single simulation so a flower is always available for other bees only to forage once).

Bees have to search to find flowers, but cannot go further than the foraging boundary (200m square).


EXPERIMENTS

Test 1. A hive containing bees with strategy Serial in the Temperate environment.
Test 2. A hive containing bees with strategy Parallel in the Temperate environment.
Test 3. A hive containing bees with strategy Serial in the Tropical environment.
Test 4. A hive containing bees with strategy Parallel in the Tropical environment.

You must run multiple (e.g. 10) repetitions of the model per test (1-4) and for each density setting (below, N=50, 100) to get a measure of variability in the data generated.

Parameters (to be confirmed by discussion):

7. DEPENDENT VARIABLES

For bee agents, the dependent variable of interest is the amount of nutrition collected by bees from a hive. We want to compare the effectiveness of the two scanning strategies in the different environments.


SUBMISSION DETAILS

All your code should be well-structured and written in C, C++ or Java (including Processing) and should run under a UNIX (or derivative) operating system. Please do not use any non-standard libraries.

The models can be visualised in OpenGL (or JOGL or Swing) if required.

Bees can be drawn as circles on a grid using 2D graphics if you wish. Flowers can be depicted by colouring in grid squares. Some sample OpenGL code to achieve this is given here: GL_routines.cpp, GL_routines.h, main.cpp Within the LINUX environment, build these files into a single executable called circle.out by linking to the GLUT toolkit: g++ -o circle.out GL_routines.cpp GL_routines.h main.cpp -lglut

MARKING BREAKDOWN:

Grid world
Displayed and properly coded.

 

[10%]

Flower agents
Displayed, properly coded, correctly distributed
Correct rewards offered

 

[10%]

Bee agents
Displayed, properly coded, correct nectar storage, visit time [10%]
Correct visual scanning strategies Parallel [10%] & Serial [10%]
Correct movement and heading [10%]

 

[40%]

Report on your simulation results
In addition to your coding, you will need to provide a brief report (3-5 pages only).

Detail:

  1. The testing you conducted to ensure you code is running correctly.
  2. The results you expect.
  3. The simulations you ran.
  4. The results you obtained.
  5. An analysis of your results. What did you discover?
[40%]

BACKGROUND READING AND CITED REFERENCES

Submission Details (fine print):

The assignment is due at the time specified on the main page.

Submit all of the files specified below on a CD / DVD-ROM clearly labelled with your name and ID number or EMAIL a tar file of the source (not executable files) and report in PDF format before the submission deadline. Submissions will be accepted at the General Office in building 63, passed in person to the lecturer or by email only.

You will need to include the following in your submission:

Documentation is important. Marks are allocated within each section for the research you have done. Documentation submitted should include:

Each file of your source code must contain the follwing at the top:

 /* 
  * This software is the original work of <Your Full Name>. ID: <Your ID> 
  * This software is submitted in partial fulfillment of the 
  * requirements for the degree of <Your Degree>, 
  * Monash University
  */ 

You are encouraged to consult reference material as widely as possible, but remember the code you write MUST be your own work. Make sure you think about, and understand, the processes involved rather than blindly copying the work of others.

Please be realistic about what you can achieve given the time constraints. Students invariably spend far too much time on this assignment. As much fun as it is, any time above 50 hours would be better spent on other activities. (e.g. fishing in the Monash pond)

Late assignments will incur mark penalties according to the Fibonacci sequence multiplied by a lecturer-determined scaling factor (e.g. 0.5, 1 or 100). An assignment that is one day late will receive a one mark penalty multiplied by the scaling factor. Assignments two days late will receive a 2 mark penalty, three days late, 3 marks, each multiplied by the factor. The sequence is [1],1,2,3,5,8,13,21... (times the factor). This applies for all days including public holidays and weekends so please submit your assignments punctually!


[ FIT4012 Home Page ]