Week 07 - C. elegans EVOLVE environment

This is the environment for evolving chemotaxis controllers for C. elegans. The bot code has been provided for you in gaWorm.js. You will not need to modify that code. The bot attributes that you will need for your controller are:

Edit the genetic controller Bot.prototype.genetic near the top of this jsbin file to implement the following controller algorithm:


    input: attractant concentration at the nose of the worm
    time constant: tau = 10 + genome[0]
    low-pass-neuron voltage update: Δv = (input - v)/tau
    weighted sum, w = genome[1]*input + genome[2]*v + genome[3]/10
    output nonlinearity: Δheading = constrain(w, 0, 0.2); 
    

The fitness function has been provided for you. Do not change it. It runs the bot through three test environments with peak chemical concentrations of 0.1, 1.0, and 10.0. The integrated, normalized concentration experienced by the bot is used as the fitness measure. In other words, the longer the bot spends near the peak of the concentration gradient, the higher its fitness value. Each trial lasts 1000 ticks. The maximum possible value of the fitness measure is 3000.

After implementing the controller code, evolve a successful genetic controller (fitness typically > 2600). You may need to adjust popSize, crossoverRate, mutationRate and termination criterion. Once everything is working, return to the C. elegans TEST environment and follow the instructions there to complete the homework assignment.


  Num genes: 
  

Fitness vs generation: