Code center > Suggestions

Recombination mechanism

<< < (3/7) > >>

Carlo:
Shvarz, your UID system gave me an idea. I think UID would be a good thing, being basically a shortcut to actually comparing dna portions to look for similar parts. On the other hand, it would require changes in the way dnas are stored. What do you think of this: without the need to modify anything anywhere else, we just change the sexual reproduction routines. We insert a new routine which calculates a number (let's call it idcode) from each gene (say, just by calculating the sum of the type-value sequence in the gene, or something like that). Then, we take each gene from one of the parents, and we couple it with the gene with the closest idcode number. When genes have been coupled, we take one of them from each parent and build a new dna. We should decide what to do with genes that remain uncoupled.

Now, to be clear, an example. Say we have a gene

cond
  *.eye5 0 >
start
  10 .up store
stop

If we assign a value to each instruction, variable and number, we can easily make a sum of these values and obtain a code which is not unique for that gene, but has very good chances to be unique in that dna. An important feature of this code is that, unlike a hash code, it is only slightly changed by little variations.
Now, say that the calculated idcode for this gene is 100.

A mutated copy of this gene, say

cond
  *.eye7 0 >
start
  10 .up store
stop

may have idcode=102

Now, if we have two dnas, with genes: (where 1, 2, ... are different genes, 1a, 1b,.. are slightly mutated copies of the gene 1, and there's an idcode associated to each gene)

dna1...............dna2
1-100.............1-100
1-100.............2-324
2-324.............3a-64
2a-320...........3b-66
3-60...............4a-410
4-400.............5-150
4b-390

You understand that it is relatively simple to mix these two dnas. You should couple each gene of dna1 with one of those with more similar idcode on dna2. You may decide randomly which gene to couple if there are two or more with similar idcode. For example, you may decide to couple either gene2 or gene2a from dna1 to gene2 in dna2.

If you wish to have a more fine crossing, you may even decide to go further and split the coupled genes somewhere inside them and mix the two ends.

Numsgil:
The only problem with that is its still gene-centric.  We should be moving away from treating the genes as whole units.

Carlo:
I'd prefer to leave apart the discussion about possible new structures for the dna language, and implement rapidly this kind of sexual reproduction. If we (you) are ever going to change the dna structure, you'll change also this, among many other things. But let's have immediately what we can have now.

Numsgil:
We should build up from A to B.  The code is already fairly strung out and inconsistant.  Coding something that just needs to be coded over later is wasteful.

And remember what's wrong with the current sexual reproduction system:  It's gene centric.  If all you're after is mixing up the genes between bots, it does just fine.

A more complex, chromosome based system is what we should be considering, and working toward in small but self consistant and robust steps.

Carlo:

--- Quote ---We should build up from A to B. The code is already fairly strung out and inconsistant. Coding something that just needs to be coded over later is wasteful.
--- End quote ---
First, it's not said that we're really going to change the dna language. I don't really see any need for that, except maybe going in the direction of less programmability and understandability of the language itself.


--- Quote ---And remember what's wrong with the current sexual reproduction system: It's gene centric. If all you're after is mixing up the genes between bots, it does just fine.
--- End quote ---
It seems to me that nobody said that. Shvarz's point, that is correct, is that the mixing of genes how it is made now don't work when genes are duplicated (because sometimes  the zig-zag procedure cuts off a valid gene). But this method solves the problem perfectly, and it's also biologically sound.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version