From news-rocq.inria.fr!jussieu.fr!math.ohio-state.edu!howland.erols.net!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!news.maxwell.syr.edu!news.idt.net!nntp.farm.idt.net!franz Thu Mar 6 11:19:51 1997 Article: 7208 of rec.games.corewar Path: news-rocq.inria.fr!jussieu.fr!math.ohio-state.edu!howland.erols.net!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!news.maxwell.syr.edu!news.idt.net!nntp.farm.idt.net!franz From: franz@azstarnet.com (George Lebl) Newsgroups: rec.games.corewar Subject: Evolution Date: 6 Mar 1997 07:08:16 GMT Organization: IDT Lines: 206 Message-ID: Reply-To: franz@azstarnet.com NNTP-Posting-Host: 199.245.121.184 X-Newsreader: slrn (0.9.2.0 BETA UNIX) I've written a few scripts and progs to run some evolution on my computer .... the tiny hill proved to be perfect for this as the fights are FAST!!!! here's what i got so far in Generation 11 ;redcode-94x ;name Warrior #112 / Generation #11 ;author Evolution ;assert CORESIZE==800 SEQ.F <171,#273 SPL.AB #616,$664 JMZ.F <6,$4 SPL.AB #616,$664 MUL.X {17,}201 SLT.AB *14,{9 SPL.AB #616,$664 MOV.A >244,$10 SPL.AB #616,$664 JMZ.F <6,$4 SPL.AB #616,$664 MUL.X {17,}201 SLT.AB *14,{9 SPL.AB #616,$664 SPL.AB #616,$664 DJN.AB {1,<530 SEQ.I #589,<643 DIV.X @436,$0 SUB.F $118,}133 SUB.F $118,}133 END 0 in generation 15 ... not much change no new goodies evolved ... the algorithm to about 16th generation was flawed so didn't work perfectly ;redcode-94x ;name Warrior #528 / Generation #15 ;author Evolution ;assert CORESIZE==800 SPL.I {162,<103 SPL.AB #616,$664 SEQ.I <15,>709 SPL.AB #616,$664 SPL.AB #616,$664 MUL.X {17,}201 JMN.BA <660,$2 SNE.A }14,@80 SPL.AB #616,$664 SPL.AB #616,$664 SPL.AB #616,$664 SEQ.AB >6,>672 SLT.I }4,@25 SPL.AB #616,$664 SPL.AB #616,$664 MOV.I >7,}4 DAT.F <18,<78 SUB.F $118,}133 SLT.AB @454,$16 DJN.AB {1,<530 END 9 in generation 17, starting to get interesting, notice the mov bombing instructions in this code ;redcode-94x ;name Warrior #939 / Generation #17 ;author Evolution ;strategy ??? Random ??? ;assert CORESIZE==800 DAT.A >327,{18 SPL.AB #616,$664 MUL.AB {17,{96 SEQ.I <15,>709 SPL.AB #616,$664 SPL.AB #616,$664 MUL.X {17,}201 DIV.BA }20,*19 MUL.BA <10,@83 SPL.AB #616,$664 SPL.AB #616,$664 SNE.A >53,*3 SLT.I }4,@25 SPL.AB #616,$664 SPL.AB #616,$664 MOV.I >7,}4 MOV.I >7,}4 DAT.F <18,<78 SUB.F $118,}133 JMZ.F <6,$4 END 13 and now i'm up to generation 18 testing the 19th generation as i type :) ;redcode-94x ;name Warrior #699 ;author Evolution ;strategy ??? Random ??? ;assert CORESIZE==800 DJN.BA >16,<11 SPL.AB #616,$664 MUL.AB {17,{96 SEQ.I <15,>709 JMP.B >1,{7 MUL.X {17,}201 JMZ.AB @294,>16 SNE.A }14,@80 SPL.AB #616,$664 SPL.AB #616,$664 SPL.AB #616,$664 SEQ.AB >6,>672 SEQ.AB >6,>672 SLT.I }4,@25 SPL.AB #616,$664 SPL.AB #616,$664 MOV.I >7,}4 DJN.B }310,}374 DAT.F <18,<78 SUB.F $118,}133 END 13 I have yet to analyze how exactly these warriors work, but the score is going up slightly .... against a test set of warriors with all kinds of different strategies plus a few of the same generation warriors the random generated warriors were about 650 at max now i'm up to 880 the genetic algoritm is too simple to work perfectly ... i mutate an instruction by ust picking a new one and i cross over only at whole instructions of the total population i pick 10 best and mix each with each 10 times to produce 1000 new warriors ... this should produce a single strategy, since it's ten best genetic algorithm ... once one strategy is marginally better it gets reproduced ... what first evolved were jmp #'s and spl #'s ... with added jmp > and similiar ... this concept grew and reproduced into many warriors creating a lot of spl/spl warriors with a following bombing/??? instruction ... in the later 16+ mov instructions as bombing routines starting to appear ... going from about 400 in a thousand to 1700 instructions in thousand warriors in generation 19 here's some statistics for generation 19: rotten:~/evol$ cat [0-9]/*.red | grep MOV | wc -l 1788 rotten:~/evol$ cat [0-9]/*.red | grep JMP | wc -l 409 rotten:~/evol$ cat [0-9]/*.red | grep JMN | wc -l 437 rotten:~/evol$ cat [0-9]/*.red | grep JMZ | wc -l 1154 rotten:~/evol$ cat [0-9]/*.red | grep DJN | wc -l 518 rotten:~/evol$ cat [0-9]/*.red | grep SPL | wc -l 6845 rotten:~/evol$ cat [0-9]/*.red | grep MUL | wc -l 1416 rotten:~/evol$ cat [0-9]/*.red | grep DIV | wc -l 398 rotten:~/evol$ cat [0-9]/*.red | grep ADD | wc -l 224 rotten:~/evol$ cat [0-9]/*.red | grep SUB | wc -l 1554 rotten:~/evol$ cat [0-9]/*.red | grep SLT | wc -l 1029 as you can see the spl instruction is VERY common. in generation 15 djn was much higher but is probably loosing to mov, which is gaining popularity Rigth now the best warriors are self killing coreclears with extra selfsplitting and several non-critical instructions usually executed too due to the random nature of the warriors I will leave it for at least the next few days ... (I've been running it since yesterday and am quite pleased with the progress ... since mov bombing finally evolved:) i have last tried the 15th generation warrior on the hill with 48 (i think) points (tiny hill that is) if someone is interested in the scripts i can send it but i doubt it is aything earth breaking ... best would be to generate object code and do genetics on that and maybe hack pmars to read this code and i would probably compile the pmars main (changed name) into my code to save a system call ... as it is it's running on my first console and does about a generation every 20 minutes or so now that dat bombing is in ... :) used o take a while with the jmp bombing, which was not very effective ...:) any comments???? Franz -- -------------------------------------------------------------------------------- Sex Pistols RULE!!! franz@azstarnet.com