Darwinbots Forum

Bots and Simulations => Evolution and Internet Sharing Sims => Topic started by: Elite on February 15, 2006, 12:59:45 PM

Title: Mutation Rates
Post by: Elite on February 15, 2006, 12:59:45 PM
What are the best mutation rates to use for a mutation sim?

I find that the default settings are too low. After 120,000 cycles I ended up with two mutations:
Quote
Changed cond at pos 13 from  != to  !=
Changed val at pos 45 from 0 to 0
And I had increased the mutation factor by 2x!

 :(

I've had some sucess in the past from using 4-8x mutation rates.

What settings have you lot had sucess with?
Title: Mutation Rates
Post by: PurpleYouko on February 15, 2006, 02:24:54 PM
you have to resist the urge to bump up the mutation rates too high.
Ideally we only want one mutation every few generations otherwise you just end up with a screen full of robots with nothing in common with each other when what we really need is evolution of a species as a whole.

I normally use somewhere between 1000 and 2000 for pretty much all of the values. Even this can appear painfully slow though.

I actually just had the weirdest thing happen while continuing with my quest to get "firstbot" (a bot made by "Bots-are-us" that travels excusively in straight lines) to develop rotation.

What actually happened was that one or more of them figured out how to make and fire viruses, then promptly forgot how to move and died out so I never actually saw their DNA. :(
When I checked back in I found that some of my veggies (not mutating) were constantly shooting. Further investigation showed that the primary movement and shooting gene from Firstbot had been transferred to them.

Now I have a few that have somehow become 2-bot MBs and are even sharing energy. I can't figure out how though  :unsure:
Title: Mutation Rates
Post by: Numsgil on February 15, 2006, 02:40:03 PM
You want an upper bound of, on average, one mutation that actually does anything once per generation.  More than that and you introduce some seriously weird effects (which theoretical biology has been aware of for quite some time).

The lower the mutation rates, the stronger natural selection forces will be to weed out mutations, but the longer you have to run the sim to see anything.

I usually aim for one mutation per 2 or 3 generations if my bot has a shorter genome (say, under 100 bp).
Title: Mutation Rates
Post by: Elite on February 15, 2006, 02:49:51 PM
How odd ... viruses

No wonder I wasn't getting much. My mutation rates were all set to 5000. I seem to have a comfortable mutation rate at the moment, between 1000-3000 with an 8x multiplier. Slightly high but the bot I am using is rather cannibotistic and bad mutations get eaten  :evil:

Some bots somehow found a way of unfixing vegs (which still mystifies me  :huh: ). Now all the vegs are unfixed.

Here's what I started with:
Code: [Select]
cond
*.eye5 0 !=
start
-1 .shoot store
stop

cond
*.eye5 0 !=
start
20 .up store
*.eye6 *.eye4 sub .aimdx store
stop

cond
*.eye5 0 =
start
314 rnd .aimdx store
stop

cond
*.nrg 10000 >
start
10 .repro store
stop

cond
*.numties 0 >
start
32000 .tielen1 store
stop

end

Here's a random bot now after around 250,000cy:
Code: [Select]
cond
  *.eye5  0 !=
start
 -1  .shoot store
stop

'''''''''Gene  2: Last 'stop' at position  9'''''''''

cond
start
 add -668  20  1  *146 rnd store
  *.refshoot  *.veldn  *.eye4 sub  5  786 store
stop

'''''''''Gene  3: Last 'stop' at position  26'''''''''

cond
  *.eye5  0 !=
start
  20  .up store
  *.eye6  *.eye4 sub  .aimdx store
 store
 rnd
stop

'''''''''Gene  4: Last 'stop' at position  42'''''''''

cond
  *.eye5  0 =
start
  314 rnd  .aimdx store
 add
stop

'''''''''Gene  5: Last 'stop' at position  53'''''''''

cond
  *.nrg  10000 >
start
  10  .repro store
stop

'''''''''Gene  6: Last 'stop' at position  62'''''''''

cond
  *.numties  0 >
start
  32000  .tielen1 store
stop

'''''''''Gene  7: Last 'stop' at position  71'''''''''

end
Title: Mutation Rates
Post by: Elite on February 15, 2006, 02:57:57 PM
Firstbot, hmm, I was playing with that idea, the absolute minimal starting bot.

Code: [Select]
cond
start
-1 .shoot store
20 .up store
stop

cond
*.nrg 4000 >
start
40 .repro store
stop
Title: Mutation Rates
Post by: PurpleYouko on February 15, 2006, 03:07:52 PM
This is th egenome that I am using right now.

Code: [Select]
'Perfect Bot for evolution
'FirstBot is the official name

'/*****proper reproduction 1

cond
*.nrg
20000
>
start
50
.repro
store
'if time to reproduce store it
1
972
store
stop

cond
'/after robot reproduces it reproduces more until energy less then 3000
*972
1
=
start
50
.repro
store
stop

cond
*.nrg
3000
<
start
0
972
store
stop

'\*****proper reproduction 1

cond
start
-1
.shoot
store
10
.up
store
stop

'poop gene added because these stupid idiots
'keep getting altzheimers and getting fixed in place
cond
*.waste 10 >
start
-4 .shoot store
10 .shootval store
0 .fixpos store
stop
end

I had to add the waste disposal and unfixing gene to the end because otherwise they always ended up fixed to the spot after a while.

I am also running with scripts enabled and set to detect, pause and highlight any bot that evolves any kind of turning command.

So far, one bot developed a gene that stored 0 into setaim when its energy got lower than 3000. The trait didn't last long though as the thing constantly reproduced because it lost one of the repro conditions in the process. For a while though, there was a huge mass of similar bots all heading to the right and pumping out babies. It was quite funny.
Another bot replaced .up with .aimdx and just sat spinning and shooting for a while. There were briefly about 10 of these but again the trait didn't last.

The sim just paused again. better go and look at what's happened.

Another one just did the same thing. I have a group of rotating gun turrets for the moment.
Title: Mutation Rates
Post by: PurpleYouko on February 15, 2006, 03:08:30 PM
I need to add a notification sound when the sim pauses. That would be cool.  B)
Title: Mutation Rates
Post by: Griz on February 15, 2006, 03:39:33 PM
Quote
I need to add a notification sound when the sim pauses. That would be cool.  B)
yes. nice you have scripts to pause when something happens.
that's the big problem for me ... finding mutated bots with useful dna
changes or interesting behaviour that I might be able to save or enhance
with a minor tweak  before they are superceded by what may be a more
'successful' bot,  [whatever one determines that to be].

btw ... for Perfect Bot ... are you using 2.37.6 or 2.4?
same question to Elite for his Evo bots ...
using his StoreBreedDie bots in 2.37.6 vs 2.4 gives results
that are completely different.

so I want to be sure I use your bots in the same sim you do ...
and with similar settings or it's a completely different ball game.

thanks for all the bot codes ...
all good stuff to check out.
Title: Mutation Rates
Post by: PurpleYouko on February 15, 2006, 03:54:37 PM
I always use 2.37.6 as it is more stable than 2.4.
Title: Mutation Rates
Post by: PurpleYouko on February 15, 2006, 04:19:07 PM
here is one that mutated a virus gene. Doesn't seem to be firing it though. Possibly because it is trying to shoot gene 50.  <_<
Title: Mutation Rates
Post by: Elite on February 15, 2006, 04:33:45 PM
Aaaaaaaaaagh ... who's been tampering with the alga ...

Somehow, the bots have been:
1) Unfixing the alga
2) Giving the alga shooting genes
Vegetables aren't meant to fight back ...  :blink:

Somehow, a few vegs ended up with this in their gene code ...
Code: [Select]
cond
  *.eye5  0 !=
start
 -1  .shoot store
stop
And more alga in other parts of the field are doing it too  :blink:

There's something really weird going on ...
Title: Mutation Rates
Post by: Elite on February 15, 2006, 05:11:21 PM
At nearly 5 hours exactly all the bots died  :(  due to harrassment by the mysterious evil vegs  :blink:
Still, a rather interesting introduction to the weird world of evosims  :)

Here's a virus I hope will help gene transfer between species:-
Code: [Select]
cond
*.nrg 1000 >
start
*.genes rnd .mkvirus *.vtimer -1 mult 1 add mult store
100 .vshoot *.vtimer 1 sub abs 1 sub -1 mult mult store
*.mkvirus 1 add  .delgene *.mkvirus *.thisgene sub dup mult sgn mult store
stop

Which I will be running with a virus-immune veg:-
Code: [Select]
cond
start
 50 .repro *.nrg 6000 sub sgn mult store
 15 .aimdx *.nrg 6000 sub sgn mult store
 .delgene inc
 .delgene inc
stop
end
Title: Mutation Rates
Post by: Griz on February 15, 2006, 05:39:48 PM
Quote
At nearly 5 hours exactly all the bots died sad.gif due to harrassment by the mysterious evil vegs blink.gif
creature from the Black Lagoon ... or the Blob!!! ;)
Poison Ivy?

hey, evolution is evolution. congrats. ;)
Title: Mutation Rates
Post by: Endy on February 16, 2006, 03:15:11 AM
I've been having some oddball effects myself. The bots appear to be benneficialy losing their deletion gene, then gaining too many genes and dying out. Maybe setting the deletion gene level higher will help out some more. :unsure:

Are your veggies able to mutate? I've had alga occasionally use:

(0) 314 rnd store

and manage to become mobile. Any time the sim repops them, it'll restore them to their initial dna; so maybe you can use that to check wether its the plants dna or the bots doing it.
Title: Mutation Rates
Post by: PurpleYouko on February 16, 2006, 08:47:17 AM
My veggies are non-mutating and the shooting gene that a bunch of them started using (on two seperate occasions now) was lifted straight out of "Firstbot".
Title: Mutation Rates
Post by: Elite on February 16, 2006, 11:46:42 AM
Same here, definately a virus. The veggies were mutation-disabled.

The 'veg unfixing' thing is happening to me quite frequently now. I have to use a veg that refixes automatically.

 :wacko:

BTW: PY, that mutant virusbot isn't trying to vshoot gene 50; it's trying to vshoot a nonexistent virus with a range of 50. You need to .mkvirus first to fire a virus. I've got no idea how those genes are getting into the vegs. Altzheimering their shoot genes into .mkvirus maybe?
Title: Mutation Rates
Post by: PurpleYouko on February 16, 2006, 12:24:26 PM
You are right. I dunno what the heck is going on.

I have a really strange scenario right now.
When I left the sim about an hour ago, all the bots were travelling at a pretty much uniform speed in all the same directions (plus the 180 degrees opposite direction of course)
Now they are suddenly zipping around all over the place at a bunch of different speeds. They all still go straight though.

I have one small family group who are shooting sideways at various different angles instead of straight ahead. I can't figure out quite how though.
Title: Mutation Rates
Post by: Elite on February 16, 2006, 01:08:43 PM
Evolution sims are so interesting.

Running one with this bot:
Code: [Select]
cond
*.robage 0 =
start
stop

cond
start
-1 .shoot store
stop

cond
start
20 .up store
stop

cond
*.refeye *.myeye !=
start
*.eye9 *.eye1 sub .aimdx store
stop

cond
*.nrg 3000 >
start
50 .repro store
stop

cond
start
stop

cond
start
stop

cond
start
stop

end
Lots of space for mutation here  :D

*Runs sim*

Yey, it works!
Title: Mutation Rates
Post by: Numsgil on February 16, 2006, 01:51:38 PM
There's a problem with viruses in 2.37.6 that I think explains what's happening.

See, mkvirus starts a timer if a valid gene number is used.

When that timer runs out, the virus at .mkvirus is copied and shot out.  If a gene is inserted in the mean time, where the mkvirus sysvar used to point to is now a different gene.

Meaning that the wrong gene can end up being copied.
Title: Mutation Rates
Post by: PurpleYouko on February 16, 2006, 02:34:35 PM
I just had one start to swim backwards  :D

Mutated .up to .dn  B)
Title: Mutation Rates
Post by: Elite on February 16, 2006, 03:43:36 PM
Check out this bot:

Code: [Select]
'Animal Minimalis mod

def stress 50

cond
*.eye5 0 >
*.refeye *.myeye !=
start
*.refveldx .dx store
*.refvelup 30 add .up store
stop

cond
*.eye5 50 >
*.refeye *.myeye !=
start
-1 .shoot store
*.refveldx .dx store
*.refvelup .up store
stop

cond
*.eye5 0 =
*.refeye *.myeye = or
start
314 rnd .aimdx store
stop

cond
*.nrg 4000 >
*.stress 1 <
start
33 .repro store
stop

cond
*.nrg 4000 >
*.stress 0 >
start
33 .mrepro store
stop

cond
*.pain 50 >
start
.stress inc
stop

cond
*.pleas 50 >
start
.stress dec
stop
end

When stressed, it hyper-mutates it's offspring. Haven't tested it yet, just thought it was an interesting idea.

Heh, backwards  :lol:  there's always at least one bot doing something stupid  :D

I had one that used the reverse of animal minimalis' turning system - it span if it saw something and kept spinning it could see nothing in particular  <_<
Title: Mutation Rates
Post by: Elite on February 16, 2006, 04:31:45 PM
Here's a good evo tip -

Double up key genes. Double up your repro genes so that big berthas cannot get rid of them so easily, and you can double restrictive genes so they can't be broken as easily.

I also sometimes add 'spare genes' and junk DNA to my evobots to give evolution more to play with.
Title: Mutation Rates
Post by: Elite on February 16, 2006, 05:23:40 PM
Talk about junk DNA ...

cond
  *345  *192 ~=
 -9  *.velscalar >
 -9  *.velscalar =
start
stop

cond
 -9  *.velscalar >
 -9  *.velscalar >=
 -9  *.velscalar >=
  *.robage  0 <
start
  *889
stop

cond
 -9  *.nrg >
 -9  *.velscalar >
 -9  *.velscalar >
 -10  *.aimshoot >
 -9  *.velscalar >=
start
  *.refypos -1463
stop

cond
  *.tielen2 -447 >
start
  *421 rnd div  *.backshot -1169 dec
 div inc
 -288 dec
 div inc
 dec
 div inc
  *757 -1169  *420 div
stop

cond
  *.strbody  0 =
start
  *.in2 -1169 div rnd
stop

cond
  *.strbody  0 =
start
  *.in2 -1169 div rnd
stop

cond
 -91 -144 >=
start
  *334 -1  .shoot store
 inc
 inc
 div  *306 inc
 add  *515 dec
  163  202  *416 mult
stop

cond
start
  21 div  21 div div store
  *430  1 rnd -283  20  0 rnd  19  1 rnd dec
  1 rnd store
  *579
stop

cond
start
  21 store
 dec
 -375  *679  452  457  *.shsx  *853 store
 -977 div dec
 store
 -977 dec
 inc
 inc
 dec
 add div  977  *846
stop

cond
  *.refdx  730 !=
  *.body  745 %=
  *.memval  *.fixed !=
  *.memval  *.fixed !=
start
 add -392 add mult  447 add mult div  *.reffixed mult  *345 add  265  *.trefaimsx store
 rnd div  281  *.trefaimsx rnd  *237  *.reftie -614 dec
 rnd  *.hitdn dec
 dec
 rnd  448 rnd inc
  448 rnd sub inc
 -201 inc
 -201 rnd sub mult  *54  *.velscalar  *.trefxpos  173  *.myvenom store
 rnd  1488  *.eye9 store
  *.ypos -986 rnd store
  *.ypos rnd  662 rnd  *.eye1 add inc
 dec
 dec
 add  *.eye1  201 rnd add  774 dec
 dec
 mult inc
  *679 rnd inc
  *679 rnd  *519  *.shootval  *.sun  *.tielen3 inc
 store
 store
 div store
 div mult  *.hitdx  *129  6 -32 mult inc
 -24
stop

cond
  *.shootval  730 !=
  *.refdx  730 !=
  *.body  745 %=
  *.memval  *.fixed !=
  *.memval  *.fixed !=
start
 add add mult  447 add mult div  *.reffixed  *345 add  265  *.trefaimsx store
 rnd div  265  *.trefaimsx rnd  *237  *.reftie dec
 rnd  *.hitdn dec
 rnd  448 rnd inc
  448 rnd sub inc
 -201 inc
 -201 rnd sub mult  *54  *.velscalar  *.trefxpos  173  *.myvenom store
 add  1488  *.eye9 inc
 dec
  *.ypos rnd sub store
  *.ypos rnd rnd  *.eye1 add inc
 dec
 add  *.eye1  201 add  774  1032 -971 dec
 dec
  *679 rnd inc
  *679 rnd  *.shootval  *.sun  *.tielen3 inc
 store
 store
 sub div store
  *892  *129  6 -32 inc
 -24
stop

cond
  *.refeye  *.hitup !=
start
 -823 inc
 inc
 dec
 inc
 inc
 dec
 inc
  *.refdn dec
 dec
  *163 add  *.trefvelmyup dec
  *255  *.pleas mult -57 sub -56 rnd sub -56 rnd sub  *546 -56 rnd sub  237 -56  *435 rnd sub  *948 dec
  *948 dec
 mult div inc
  *258 add  748 -42 inc
 div  174 -1111 inc
  *.vtimer  418 div  *.eye1  *.numties sub  *.eye1  *.numties sub  *.eye1  *.numties sub -759  *.vtimer  *.eye1 dec
 div  402 div  *.trefvelyoursx  *.eye9  *.pwaste sub  *.eye1 sub  .aimdx store
  79  45 -666  283  *.trefage store
 -24 dec
stop

cond
  *977  *.myvenom >
  *.trefshoot  *.myvenom >
  *.fixlen  *.hitup >
start
  994 store
 rnd inc
  *.eye9  96 add  *.venom sub  *270 div  *270 store
 div  *270 div  *.velscalar  *.refpoison  *.velscalar  *.velscalar div  *.tieang sub  *270 add mult store
 mult -178  *.memval -237  *.deltie sub  *188  *948 rnd  *.vtimer  *172 mult -1388  *.setboy  34 -613  *892 -487  *994 sub  *.mydn  *892 sub inc
 sub  *.eye1  *892 dec
  *.eye1 store
  *892 sub add store
 div  *.shdx  435 div  *892 store
 dec
 add  *.trefvelyoursx  *.eye9  *.eye1 rnd  *.eye9  *.eye1 rnd  *.eye9  *.eye1 rnd sub inc
 dec
  *.eye9  *.eye1 -781  *.hitdn  *691 div -781  *.hitdn div -1173 -28 sub  *143 -601 -27 sub store
  *192  5 div div add  5 div inc
 div div inc
 div -850 dec
 -850 dec
  *561 rnd -24 -434 dec
stop

cond
  *.trefypos  *.trefdx !%=
  *.hit  *.hitdx =
  *.nrg  7868 >
  *.nrg  8017 !%=
start
 dec
  51  .repro store
  1 div  *75 dec
 sub  109 inc
 rnd dec
 mult store
 rnd  1400 -232 -375  *601 inc
stop

cond
  *.eye5  *493 !%=
start
  *29  129  *.trefxpos -1660  *71
stop

cond
start
 sub mult  129 dec
  *.in1  *.poisoned mult
stop

cond
  *986  *.dn <
start
 -330 rnd div -330 rnd div dec
 dec
  *.daytime inc
 dec
  *.daytime inc
 -609 inc
  *.refshoot
stop

cond
start
 -971 dec
 rnd -971 dec
 rnd  860 add inc
  174 sub sub  174 sub inc
 -784 dec
 rnd  *.trefdx sub sub  919 div rnd dec
 div rnd mult  *681  325
stop

cond
start
 -971 dec
 rnd  *222 -971 dec
 rnd  *59  870 sub inc
 -929 add div  507 sub rnd  *.trefshell inc
 -459 sub sub  *.tielen3  901 div sub add  *.trefnrg  919 div sub rnd mult  *681  *893  322
stop

cond
start
  *778 mult mult  *778  *.vshoot mult mult  *38 div  *874 dec
  *38 div sub div  *38 div  *362  254 add dec
 div store
 mult sub rnd inc
 -448  *.vtimer dec
 dec
  *.body -1143  101  358  205 dec
 div div -262 sub -184  *734 rnd dec
 mult  *.veldn -890  *38  205 div
stop

cond
 store
  *.shsx  *.refypos sub  *.refshoot  *38 sub dec
  *38 sub dec
 inc
  *433  *.myties inc
  *433  *38 inc
  *433  *38 inc
  *433  *.hitdn mult  .hitup store
  *.tielen4  *38  210 rnd
stop

end
Title: Mutation Rates
Post by: Endy on February 22, 2006, 09:41:32 PM
If you really want to be restrictive:

Code: [Select]
'Last Gene
cond
*.dnalen *.dnalenInitial !=
start
.delgene inc
stop

You can also use *.thisgene to a good effect:
Code: [Select]
'Gene1
cond
*.refeye *.myeye !=
*.eye5 35 >
start
*.thisgene sub .shoot store
stop

Any mutants have to first figure a way around these before anything else can appear.