anchor.diff:      ets:insert(Ets, lists:zip(lists:seq(1, ?TRACKER_SIZE),
                                 [senses(At, Block) ||
                                     At <- lists:seq(P,P + ?TRACKER_SIZE - 1)])).
  -
  -%% Speed generated by a motor neuron
  -speed(X) when 0.2 =< X, X < 0.5 -> 1;
  -speed(X) when 0.5 =< X, X < 0.9 -> 2;
  -speed(X) when 0.9 =< X, X < 0.95 -> 3;
  -speed(X) when 0.95 =< X -> 4;
  -speed(_) -> 0.
   
   actuate(Ets) ->
       [{c, _, #vstate{o = C}}] = ets:lookup(Ets, c),
  
positive.code:             G
      end.
  
  
  fit_value(X, List) ->
      F = fun({_, Y}) when Y =:= X -> 1;
             (_) -> 0
          end,
      lists:sum(lists:map(F, List)).
  
  %%% Fitness function stuff
  gen_fit(G) ->
      Res = simulate_run(G),
      Avoids = lists:filter(fun ({X, _}) -> X =:= avoid end, Res),
      ALen = length(Avoids),
      Captures = lists:filter(fun ({X, _}) -> X =:= capture end, Res),
      CLen = length(Captures),
      Avs = fit_value(true, Avoids)/ALen * 1/3 * ?NOF_BLOCKS,
      Capts = fit_value(true, Captures)/CLen * 2/3 * ?NOF_BLOCKS,
  %    io:format("~p -- ~p~n", [Avs, Capts]),
      math:sqrt(Avs) + Capts.
  
  
  new_block(Ets) ->
  
negative.code: 
  refit(#ptype{gtype = G, ref = Ref}) ->
      Fitness = gen_fit(G),
      {Ref, Fitness}.
  
  setup_ets() ->
      case ets:info(genetica_cognitive_ets) of
          undefined -> ets:new(genetica_cognitive_ets,
                               [set, named_table]);
          _ -> nil
      end,
      ok.
  