Week 04 template

  YOUR NAME HERE
  
  due date: Tue Feb 07 by 9:00 PM
  email to: mcb419@gmail.com
  subject: hw04
  email content: url link to your jsbin project and answers to questions 
  

Introduction

In this assignment you will explore the effects of different kinesis strategies in a non-uniform environment. The spatial pattern shown below represents some scalar quantity that varies across space. It could represent nutrient density, light intensity, temperature, pH, etc. For convenience, we will refer to it as temperature, and interpret the red regions as hot and the blue regions as cold. But it really doesn't matter what we call it. The main goal of the assignment is to see how different kinesis strategies can lead to different spatial distribution of agents across the environment.

Methods

Simulation specifications
canvas: width=400, height=300
boundaries: wrapped
temperature profile: use the pattern provided by the template code
bots: num=100; use the defaults provided by the Bot constructor
number of trials: 1 trial per controller
statistics: report mean and SD of the temperature distribution after 2000 ticks

Controller Specifications:
Let T(x,y) represent the temperature at the location of the bot; 0 ≤ T(x,y) ≤ 1.
A function "getTemperature(x,y)" is provided; var temp = getTemperature(x, y);
wander: speed = 0.5; heading += 0.5 * random(-1,1);
orthokinesis (+): speed = T(x,y); heading += 0.5 * random(-1, 1);
orthokinesis (-): speed = 1 - T(x,y); heading += 0.5 * random(-1, 1);
klinokinesis (+): speed = 0.5; heading += T(x,y) * random(-1, 1);
klinokinesis (-): speed = 0.5; heading += (1 - T(x,y)) * random(-1, 1);
run-tumble: speed = 0.5; if (T(x,y) < "previous T(x,y)"){heading = random(TWO_PI);}
Note: the run-tumble contoller is slightly more complex because you need to store the previous temperature; it's up to you to figure out how to implement this.

Instructions

Implement the simulation scenario and controller strategies as specified above. For each controller, run the simulation for 2000 ticks and then measure the final temperature mean and standard deviation (spread) across the population. Because you are averaging over a population of 100 individuals, you will only need to run a single trial for each controller. As you will see, different strategies lead to different spatial distributions. Some strategies produce a bias toward warmer regions, some toward colder regions, and some have little effect on the average temperature.

This week everybody should implement the "Run Experiment" button so that it automatically steps through each controller, runs the trial, calculates the statistics and fills in the HTML table.

In addition to filling out the table, answer the following questions in the body the email that you submit.

  1. About how long did you spend on this assignment?
  2. Why is orthokinesis more effective than regular klinokinesis in causing the bots to "prefer" certain regions of the environment?
  3. Why is adaptive klinokinesis so much more effective than regular klinokinesis in causing the bots to "prefer" certain regions of the environment?

Results

For each controller, report population mean and standard deviation of the temperature distribution. NOTE: this week we are reporting the standard deviation, not the standard error, make sure you understand the difference: standard deviation vs standard error

Controller Average Temp
MEAN (SD)
wander
(independent of temp)
mean (sd)
orthokinesis (+)
(speed increases with temp)
mean (sd)
orthokinesis (-)
(speed decreases with temp)
mean (sd)
klinokinesis (+)
(turn noise increases with temp)
mean (sd)
klinokinesis (-)
(turn noise decreases with temp)
mean (sd)
run-tumble
(tumble if temp is decreasing)
mean (sd)
grey
(stay in grey; keep moving)
OPTIONAL

Optional (advanced)

Develop a new controller that causes the bots to favor temperatures near 0.5 (the grey zones in the image) while maintaining a constant speed of 0.5. Add the "grey" controller to the end of the list of controllers in the menu. Rerun the full analysis on all seven controllers and fill in the HTML table, and answer the following questions in the body the email.

  1. Briefly describe the strategy that you used to implement the grey controller.
  2. The "grey" and "wander" controllers should give rise to similar mean temperatures, but very different standard deviations. Explain.