Genetic Algorithm Gene Language

jdavidw13 101 Jan 07, 2008 at 17:07

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?

3 Replies

Please log in or register to post a reply.

monjardin 102 Jan 07, 2008 at 18:32

The modulo operator comes to mind…

jdavidw13 101 Jan 07, 2008 at 21:26

Ah, a cyclical method. This was my initial thought. Thanks for the idea.

ahyeek 101 Jul 30, 2008 at 10:35

Here is a C# .NET simulation to demonstrate how Genetic Algorithm work.
This is a very good entry for GA beginner to see CODE level implementation of Genetic Algorithm.

The sample program can be download: