Code center > Suggestions
Greven's DNA structure!
Numsgil:
Okay.
Things like reversion and deletion and reversal all can (or need to) operate over lengths of DNA. How do we pick how large the event will be?
Carlo:
A few comments on this. Maybe it's not all clear to me, and there are parts that I haven't well understood. Anyway, I'll play as usual the role of the actual darwinbots advocate :D
>allow junk DNA.
Junk dna is _already_ allowed, as anybody can see just by looking at the code of some evolved bot. Gene duplications and condition mutations can easily create tons of junk genes.
--- Quote ---The genome for a bot now is stored in an array. In my DNAS the genome is made up by a single string!
--- End quote ---
Which is exactly the same thing. Strings _are_ arrays of characters. Coding the double value (type, value) of the db array to a single value (byte) string would not change things very much. In fact, each actual dna position can be converted in a three characters sequence. Surely two chars for the value (as 16 bits are needed, and a char is 8 bits) plus a few bits for the type.
Now, I have to explain one thing. There is nothing easier than just mutate randomly the dna array (or string), putting conditions and instructions at random. You can just randomly insert, delete, duplicate and mutate values wherever you like to.
The problem is just that, as we're working on a pc which has limited power, we have to try to favour meaningful, effective mutations. This is (among other things) why I have chosen the genes structure. Because it seemed more easy to mutate without destroying completely the functionality of dnas. And this is also why there are various mutation routines, some acting on whole genes, some _trying_ to deal with complete statements (that is, an instruction with its parameters), some acting just on conditions, and so on. I repeat, you can easily throw away these mutation routines in favour of a single routine which simply creates random mutations without trying to preserve a working dna structure. It is more simple, and more fair: but probably much less effective from the point of view of evolution.
The trick of having a phenotype (which, by the way, has nothing to do with the true concept of phenotype, which darwinbots _already_ has - just think at genes that are unexpressed because their effect is covered by the effect of another gene) is elegant from the point of view of programming - saves calculation time- but it is just an optimization trick, as Shvarz already noted. For example, actual dnas aren't executed as one may expect, that is by scanning the dna for conds, but instead a list of conds is built up at robot's birth, and is checked at each cycle. Optimization, it doesn't really changes the way the things are.
Finally, I don't really get the point of the last part - but maybe I haven't understood what you're saying. Seems you're proposing a token language for the dnas, with instructions expressed with a single letter (that is, a single array position) and numbers expressed in a positional way. Well, in the actual DB instructions already are tokenized (that is, cond isn't really the "cond" string, but is represented by a single position in the dna array). And, well, using a positional notation for numbers would allow breaking a number into its digits by inserting among them, for instance, a new instruction. But this is nothing you can't already do with the appropriate mutation routine: just create a routine which searches for numbers, calculates their decimal digitas, and breaks them the way you want. Nothing easier.
Greven:
Replying Nums posts:
--- Quote ---1. If each command is based on a letter, then you are limited to 48 letters. Or 256 (actually less, since not all character codes are printable) if you use all possible character codes. I don't know if that's a problem now, but if it ever does become a problem (we add more stuff to the language), then we are in a huge way in trouble. The only way to fix it would be to change to either two character codes (which is basically what it is now) or change to an integer array (basically what it is now).
--- End quote ---
Right now we only have 20 commands, when numbers need to be include we have 0-9 and *0-*9, this total up to 40 different letters. Remember we have 26 letters in the english alphabet, with capitalized we get 52, with the numbers 0-9 we get 62 possibly letters to code from. Remember that a sysvar is only a number, and therefore adding direct commands we have 12 possible slots, which should be enough.
--- Quote ---2. You said that in the current version each gene is an arbitrary unit to the program. However, this is an upper level distinction. In the bowels of the program it's just an array.
--- End quote ---
This I know, but what I mean is a bit complicated to explain. In some ways there is noway that there could exist commands outside genes, what I would really like to have.
--- Quote ---I see your idea as more a paradigm to how to approach the existing DNA structure in DB than a reason to drastically change the basic structure. That is, we keep the array of two integer elements.
--- End quote ---
What I tried to explain in my first post is that I could not invent a entire new DNA structure/system without destroying much of what we have now, and that I didnt want to, therefore it is only meant to optimize some few things in what we have now.
--- Quote ---Things like reversion and deletion and reversal all can (or need to) operate over lengths of DNA. How do we pick how large the event will be?
--- End quote ---
This is still open for discussion!
The phenotype is still a array like the DNA is now, but the genotype will be in a string, mainly to optimize mutations, and to have junk DNA.
Greven:
Replying to Carlo's post:
--- Quote ---Which is exactly the same thing. Strings _are_ arrays of characters
--- End quote ---
I know strings are just arrays, but in VB strings have built in commands to modify a string, this will make it easier to build mutation routines, which are faster and more reliable, and less prone to bugs etc.
Regarding mutation and the gene structure.
What is a meaningfull mutation? Do evolution know what a meaningfull mutation is? No, but evolution should and certainly would select against non-meaningfull mutations, if mutations do schewup the DNA of a daughter bot, it will not survive and wont reproduce.
In reallife an entire gene aint suddenly added to a genome or deleted, instead a sequence of the DNA is insert. But I do understand the gene structure and why it is there, but it is evolutions work to develop these, I dont think it is more effecient to have the current system (but I dont say my system is better), because of the strict DNA structure, new thing could evolve that we havent thought of, but this must stand its test of time.
The to the phenotype, as I wrote this phenotype definition is much more complex than I do it in my system, but it is close enough here in DB .
But I do not agree on DB has a some sort of phenotype. Yes it is a optimiztion 'trick' but still in allowes much more of the genome to be unexpressed, now everything is express (or nearly everything). In my system mutations can work meaningfull or not, on the genome without altering the behavior of the bot. In the current system we do also have this as you pointed out, but it is in a much more strict sense than mine, which is much broader.
You must understand than 'my' phenotype is actual what DB is now (the current system with the genome etc.), I just make a direct border. Much of the current system is kept in the phenotype, but before a phenotype exist, we have a genome and a function to determine what the phenotype should allow.
And to the last point:
--- Quote ---Well, in the actual DB instructions already are tokenized (that is, cond isn't really the "cond" string, but is represented by a single position in the dna array
--- End quote ---
This I already know, but the genome is in a array, and that is what my point is about.
I do [span style=\'font-size:21pt;line-height:100%\']NOT[/span] say my system is better. It could endup as I said before, that it is worse, but then so be it! If it is better... well let DarwinBots evolve ;)
Numsgil:
1. I think that the cost/benefit ratio for switching to a string is just too high. Having the current system makes every DNA bit, numbers included, a single cohesive unit, which makes understanding and manipulating the DNA easier.
The only benefits to strings (concatenation, insertion) all can be created for an array, it just takes some more effort. If you get good and solid routines to build on, an array can be just as versatile as a string.
2. When Carlo was talking about 'useful' mutations, he just meant that some mutations are very unlikely to be useful. For instance, when changing a sysvar into another, if you just pick a random sysvar you'll get much less useful mutations that selecting a close sysvar. That's what he was getting at, there are ways to shortcut around obviously deleterious mutations, or mutations less likely to produce favorable results.
For my compelte thoughts on this subject, read My new mutations paradigm.
3. You can put commands between genes. Try it out. So the ability to have Junk DNA already exists. When we talk about adding Junk DNA, what we are really talking about is 'floating' the genes. We mean having the ability for the condition and body of a gene to move around independantly, and the start and end markers for both to move around independantly.
4. There are more than 20 commands. You have the flow commands, logic operators, actual commands, and comparisons.
Your system would work, but the question is is it worth the effort? I don't see the structural changes you suggested as adding anything to the program from the bots' point of view. It just makes DNA manipulation in-program slightly easier.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version