MCB419 logo  




Homework

MCB 419 Homework 6 (Spring 2009)


Edge-following behavior

In this assignment, you'll explore an insect-inspired simulation in which physical boundaries in the environment (edges) can be used as an INFORMATIONAL CUE to improve foraging efficiency. Your design will also incorporate elements of TIMING, MEMORY, and ACTION SELECTION.

To optimize foraging efficiency of your bot, you will need to replace the 'edge-follow' code in the following template file: hw06_template.nlogo

Answer the questions found on the 'Assignment' tab and email your responses along with a copy of the netlogo file to mcb419@gmail.com with 'hw06' in the Subject line.

This assignment is due by 11:59PM (midnight) on Tue, Mar 3.

Specific Design Requirements/Guidelines

Controller design hints

Efficient foraging in this scenario requires the ability to switch to a new "edge" once the food along the current edge has been depleted. The bot will need internal mechanisms for TIMING, MEMORY, and ACTION SELECTION (e.g., remembering how long it has been since the last food crumb was found, deciding whether to keep FOLLOWING THE CURRENT EDGE or begin SEARCHING FOR A NEW EDGE).

Bot properties

Your bot has two sensors (snsL and snsR) that detect 'physical' contact with objects in the environment (anything with a color other than blue).

To test for 'contact' you can use the following syntax:

if (contact? snsL) [do something]

contact? snsL - TRUE if the left antenna is in contact with an object  
contact? snsR - TRUE if the right antenna is in contact with an object

The bot has an 'energy' variable that increments every time a food crumb is consumed.

initial energy = 0   
maximum energy = 50 (there are a total of 50 crumbs that can be collected) 

Restrictions

Your bot can move forward or backward at most 1 UNIT PER TICK. It is up to you to enforce this condition when writing your controller code.

The ONLY SENSOR ELEMENTS that your bot can use are its ANTENNAE and its internal ENERGY level. You are not allowed to use other 'sensory-related' variables or functions, such as the absolute coordinates of the bot and its sensors (xcor, ycor), the bot's heading, the distance of the bot from food crumbs, etc. (Note: you are allowed to create additional variables for memory, timing, etc., but you are not allowed to add new sensing capabilities).

Points will be deducted if your code violates any of these restrictions.

Assignment

You can access a copy of the assignment file HERE, or copy and paste from the text below.

=================================================================
MCB 419 Homework 6 (Spring 2009)

When you've finished answering all the questions, email a copy 
of this file (hw06.txt) along with your NetLogo file (hw06.nlogo)
to mcb419@gmail.com with 'hw06' in the Subject line. 

=================================================================


1. For the 'wander' behavior, report the number of crumbs collected 
on each of 5 consecutive trials (1500 ticks), and report the average 
value across all 5 trials.

2. Following the suggestion on the 'specs' tab, modify the code in 
the 'edge-follow' routine to maximize the number of crumbs collected 
per trial. For your final controller design, report the number of 
crumbs collected on each of 5 consecutive trials and the average 
value. (Your target performance should be an average of 40 or more).

THE FOLLOWING QUESTIONS REFER TO YOUR OPTIMIZED EDGE-FOLLOWING CODE

3. Describe any 'memory' elements of your controller design and 
explain how the use of memory improves foraging efficiency in this
scenario.

4. Describe any 'action selection' elements of your controller 
design and explain how 'action selection' improves foraging 
efficiency.

5.  The 'wander' controller is memory-less and implements only a
single action, but it still manages to aquire resources from its
environment. In this assignment you (hopefully) demonstrated that
a more complex controller design can improve foraging efficiency.
In a competitive scenario, which type of controller would have the
advantage?  What implications do you think this has for the 
evolution of brain complexity in the real world? 


=================================================================
END OF THE ASSIGNMENT
=================================================================

Solution

This is just one possible solution. You can download the full NetLogo file (hw06_solution.nlogo), or just look at the code below.



Copyright © Mark E. Nelson, University of Illinois at Urbana-Champaign, 2005-2009. All rights reserved.