Sign in to follow this  

Genetic Algorithm Gene Language

This topic is 3629 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 3629 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this