Just an idea.
You have f(genome) -> (w_1, w_2, ..., w_n)
, where f
generates w
based on the genome
.
You could for example use a hash function h
and compute [h(w_1, ..., w_(n/2)), h(w_(n/2+1), ..., w_n))]
.
Normally a hash function should give very distinct outputs for small change in inputs. But not always. You can look for hash functions that are continuous (small change in input, small change in output). This kind of function would be used for similarity search, http://en.wikipedia.org/wiki/Locality_sensitive_hashing might provide some ideas. This way you could actually use the hash directly on the genome.
Otherwise, you could try to split the genome or the weights and give the splits different purposes. Let's say n = 4
.
(w_1, w_2)
affects x
(w_3, w_4)
affects y
You could then compute x
as (w_1 + w_2*Random_[-1,1])/2
, where Random_[-1,1]
is a random number from the interval [-1,1]
and assuming that w_i \in [-1,1]
for all i
.
Similarly for y
.
Your genetic algorithm would then optimize how fast and how randomly the Critters move in order to optimally find food. If you have more weights (or longer genome), you could try to come up with a fancier function in a similar spirit.
This actually shows that with genetic algorithms the problem solving shifts to finding a good genome representation and a good fitness function so don't worry if you get stuck on it a bit.