Darwinbots Forum
Bots and Simulations => DNA - General => Topic started by: Testlund on April 08, 2008, 02:17:44 AM
-
When I looked at 1 bot's mutations it said 'Delta mutations changed Amplification from 1 in 5000 to 1 in 5097.514'. What does that mean? Nothing I can edit in the mutations dialog.
-
It's a mutation type that isn't enabled in current versions (it was extremely buggy). Basically it would take a length of DNA, replicate it, and insert it randomly back in the genome.
-
Oh, that's a very nice kind of mutations! Too bad it's not working...
-
Eric seems good at fixing buggy features. Maybe if we bug him enough, he'll fix it (there was another mutation type as well, IIRC, that isn't enabled).
-
Oh, that's a very nice kind of mutations!
Does it happen in nature? Otherwise Eric doesn't need to bother.
-
Does it happen in nature?
Absolutely! Ever heard the term "a family of genes"? That's how those families are generated. Say you have a gene that performs an important function. It can't mutate and acquire new functions because its current function is so important. These kinds of mutations create duplicate copies of genes. The duplicate copy can mutate as much as it wants, because "the important function" is performed by the original gene.
One outcome of this process is gene families - closely located genes that preform similar functions. For example, genes responsible for sense of smell are all very similar to each other, but each of them is a little different, which allows it to detect a different chemical. We have hundreds of them, all generated through this process of amplification.
Of course, duplicated genes don't have to preserve their general original function - they can become anything they want. There are examples of that as well.
-
This does sound like a really useful mutation type for evolution, if it's possible to de-bug it. I had a look at the disabled code Amplification code in 2.43 and it doesn't look too scary. I've been wanting to try some new stuff with mutations; if EricL publishes the current version of the code I'd be happy to play around with the Amplification and Translocation (the other disabled mutation: cuts out a section of DNA and reinserts it somewhere else) routines and try to get them working.
-
Ah, translocation, that was it
As far as I know, Eric hasn't played much with those routines, except for fixing a bug in Gauss. If you're ready to start, go ahead and work from the 2.43 source. It should be a simple matter to integrate the two versions.
-
Ah, translocation, that was it
As far as I know, Eric hasn't played much with those routines, except for fixing a bug in Gauss. If you're ready to start, go ahead and work from the 2.43 source. It should be a simple matter to integrate the two versions.
OK, I rewrote the Amplification function in a way that seems to work in the few minutes of testing I have done.
24 mutations of this bot:
cond
*.robage 10 >
start
50 .repro store
100 .aimright store
100 .up store
-1 .shoot store
stop
produced this monstrosity:
cond
>
*.robage 10 start
50 *.robage stop
*.robage 10 >
cond
*.robage 10 cond
50 300 7 >
start
50 *.robage stop
10 .shoot store
>
start
50 .repro store
50 50 300 100 .aimright store
100 *.robage .up store
*.robage 10 start
50 .repro store
start
50 .repro store
start
50 *.robage cond
*.robage cond
50 300 300 50 10 start
50 300 *.robage *.robage -1 7 cond
*.robage *.robage 10 start
*.robage cond
50 300 300 -1 *.robage cond
50 300 .shoot store
stop
I'll let it run overnight on some fast-reproducing bots with a high amplification rate and see if it crashes or anything. What exactly was the problem with the previous code? When I tried to enable it crashed instantly with a subscript out of range error which I didn't track down, but perhaps I messed something up? Was it ever enabled?
-
It was briefly enabled when I first released 2.4. Basically it had crashing errors. The bug list for 2.4 was rather long, so I started to just unplug features in an attempt to stabilize the program. Let's just say it was a learning experience If the code doesn't crash the system, and doesn't produce bogus DNA, and it handles lengths > 1, etc., then you've fixed it
-
if EricL publishes the current version of the code I'd be happy to play around with the Amplification and Translocation (the other disabled mutation: cuts out a section of DNA and reinserts it somewhere else) routines and try to get them working.
I posted the 2.43.1h source when I released that drop, so the most recent code is out there. As Nums says, the mutation code is bascially the same as 2.43 although 2.43.1i contains some important fixes to insertion mutations.
I'd be happy to integrate any changes you make into the mainline or simply spend some time on this area. There's no real reason I havn't played with mutations other than time and priorities. The number of hours I spend per week on DB is limited. What I work on is primarily a function of bugs, feature requests and my own interests. If people want amplification mutations, I'd be happy to prioritize them higher in the work queue...
-
if EricL publishes the current version of the code I'd be happy to play around with the Amplification and Translocation (the other disabled mutation: cuts out a section of DNA and reinserts it somewhere else) routines and try to get them working.
I posted the 2.43.1h source when I released that drop, so the most recent code is out there. As Nums says, the mutation code is bascially the same as 2.43 although 2.43.1i contains some important fixes to insertion mutations.
I'd be happy to integrate any changes you make into the mainline or simply spend some time on this area. There's no real reason I havn't played with mutations other than time and priorities. The number of hours I spend per week on DB is limited. What I work on is primarily a function of bugs, feature requests and my own interests. If people want amplification mutations, I'd be happy to prioritize them higher in the work queue...
I grabbed the 2.43.1h source and tested this Amplification code in it; it seems to work. It needs some new code in other places to allow the setting of mutation probabilities and stuff.
Private Sub Amplification(robn As Integer)
'1. pick a string of DNA, and insert a copy of it elsewhere in the DNA
Dim t As Long
Dim length As Long
Dim startBp As Long
Dim insertBp As Long
With rob(robn)
If .Mutables.Mean(AmplificationUP) < 1 Then .Mutables.Mean(AmplificationUP) = 1
For t = 1 To .DnaLen - 1
If Rnd < 1 / .Mutables.mutarray(AmplificationUP) Then
length = Gauss(.Mutables.StdDev(AmplificationUP), .Mutables.Mean(AmplificationUP))
If length < 1 Then length = 1
If length > .DnaLen - 1 Then length = .DnaLen - 1
startBp = Random(1, .DnaLen - length) 'start of sequence to copy
insertBp = Random(1, .DnaLen - 1) 'insert copy after this base pair
'don't insert in the middle of the DNA we are copying
If insertBp >= startBp And insertBp < startBp + length Then insertBp = startBp + length - 1
MakeSpace .DNA(), insertBp, length
.DnaLen = .DnaLen + length
'MakeSpace may have shifted the location of the string to copy
If startBp > insertBp Then startBp = startBp + length
Dim I As Integer
For I = 1 To length
.DNA(insertBp + I).tipo = .DNA(startBp + I - 1).tipo
.DNA(insertBp + I).value = .DNA(startBp + I - 1).value
Next I
.Mutations = .Mutations + 1
.LastMut = .LastMut + 1
.LastMutDetail = "Amplification duplicated a string at position " + Str(startBp) + " of length " + Str(length) + _
" and inserted the copy at position " + Str(insertBp + 1) + " during cycle" + _
Str(SimOpts.TotRunCycle) + vbCrLf + .LastMutDetail
End If
Next t
End With
End Sub
-
I think amplification mutations would be great for the same reason they're in the nature, to allow vital genes to be duplicated and then mutated. With gene duplication bot's could evolve more conditional behaviour. For example there could be multiple genes that control shooting, some overriding others.