Genetic Algorithm Gene Language

Started by
2 comments, last by LorenzoGatti 16 years, 3 months ago
Hello all, I'm hoping to gain a little insight on a particular problem involving gene languages. In my implementation of GA, I've defined my gene language as a binary string consisting of 8 digits. A single gene, then, can represent one of a possible 256 values. For the most part, I won't have 256 distinct objects to be represented by the entire range that my gene can represent. This presents a problem for me when I go to mutate or reproduce chromosomes. The process will usually cause the new chromosome to have genes that are invalid (values that don't represent anything in my language). For example, say I have 15 objects I want represented by my gene language. That means a valid gene is within the set of all 8 digit binary strings that correspond to the values 0-14. So how do I go about mapping or transforming the other 241 binary strings in the language to one of those in my set?
Advertisement
Why not just restrict the range of values to those that are valid? In your example, logical AND the byte with 15, giving values corresponding to your 15 objects, and zero would indicate the absence of any object.
Essentially just truncating the value and maxing it out at my limit of defined objects in the language. This would work, although I think my chromosomes would wind up containing mostly the highest value object in my language.
You are using a completely wrong representation. If a gene has K alternatives, its representation must be a number between 0 and K-1 and the whole genome is a large number represented in radix K; there is no reason to allow nonsense values.

There is also no reason to apply meaningless bitwise operators: you can cover all your crossover and mutation needs with the two meaningful operations that do not introduce nonsense genes, i.e. copying a valid "parent" value or choosing randomly one of the K valid values.

Omae Wa Mou Shindeiru

This topic is closed to new replies.

Advertisement