Code center > Suggestions

Sex repro botsareus style!

(1/2) > >>

Botsareus:
hmm, did not look at the source before posting this topic, I hope what I suggest here is way better although the DNA  will probably grow exponential on every reproduction.


The idea here is to have robots find average values for there every store command if two robots point to the same store memory location. Or, to create additional  code so the child has code from both parents…

EX:

Parent A:

Cond
Boolean1
Start
.up inc
50 .aimdx store
Stop
Cond
Boolean2
Start
25 .dx store
Stop

Parent B:

Cond
Boolean3
Start
.up dec
77 .aimdx store
Stop
Cond
Boolean4
Start
15 .dx store
Stop

What happens is the robot changes the stores into the first unused memory location, sums them, and writes a new gene where the code is executed:

Step1 find memory locations for aimdx and dx
Lets say 998 , 999

Step2 create sum:

Resulting Bot:

Cond
Boolean1
Start
.up inc
50 2 div *998 add 998 store
Stop
Cond
Boolean2
Start
25 2 div   *999 add 999 store
Stop
Cond
Boolean3
Start
.up dec
77 2 div  *998 add 998 store
Stop
Cond
Boolean4
Start
15 2 div  *999 add 999 store
Stop
Cond

There must be exceptions for stuff like -1 shoot…

Step3 new gene:


Cond
Boolean1
Start
.up inc
50 2 div *998 add 998 store
Stop
Cond
Boolean2
Start
25 2 div   *999 add 999 store
Stop
Cond
Boolean3
Start
.up dec
77 2 div  *998 add 998 store
Stop
Cond
Boolean4
Start
15 2 div  *999 add 999 store
Stop
Cond
Start
*998
.aimdx
Store
*999
.dx
store
Stop

The mutations will be done after the combined dna is generated.

Now lets say there is another robot that wants to sexrepro:

Parent C:

Cond
Boolean7
Start
50 .tie store
Stop
Cond
Start
-90 .aimdx store
Stop

Then the resulting robot is:

Cond
Boolean1
Start
.up inc
50 3 div *998 add 998 store
Stop
Cond
Boolean2
Start
25 2 div   *999 add 999 store
Stop
Cond
Boolean3
Start
.up dec
77 3 div  *998 add 998 store
Stop
Cond
Boolean4
Start
15 2 div  *999 add 999 store
Stop
Cond
Boolean7
Start
50 .tie store
Stop
Cond
Start
-90 3 div  *998 add 998 store
Stop
Cond
Start
*998
.aimdx
Store
*999
.dx
store
Stop

To make the system even more efficient we may have to add code that does this:

50 .aimsx store

Changes to

-50 .aimdx store

and

50 .sx store

Changes to

-50 .dx store

Etc.

P.S.

Nice new look of the forum 8)


Botsareus:
Thought about it a little more, maybe it will be possible to skip the new memory usage completely:

Like so:

Cond
Boolean1
Start
.up inc
50 3 div *.aimdx add .aimdx store
Stop
Cond
Boolean2
Start
25 2 div   *.dx add .dx store
Stop
Cond
Boolean3
Start
.up dec
77 3 div *.aimdx add .aimdx store
Stop
Cond
Boolean4
Start
15 2 div  *.dx add .dx store
Stop
Cond
Boolean7
Start
50 .tie store
Stop
Cond
Start
-90 3 div  *.aimdx add .aimdx store
Stop
Cond

ikke:
I think, evolutionary speaking, the most important part of sexual reproduction is sexual selection. The penalty on sexual selection (replicating only half your genes) can only be offset by making sure the foreign half is at least as good and preferably better than your own.
Cross over can be like it is now with some additional preconditions: species or genes ( or whatever your unit of selection is going to be) can only cross over if their code overlaps for say 80%.
I wouldn't average in the DNA, but in code execution: execute the average of all .up store etc.

Billy:
I think that the lines of code should mix, not the genes. I also think that sexrepro should only work if the parent bots had the same number of genes.

Botsareus:

--- Quote ---I wouldn't average in the DNA, but in code execution: execute the average of all .up store etc.
--- End quote ---

That is an idea. However this means we have to drastically change the way the code is processed.

Actually I have improved on my original design:
We can have the reproduction event convert everything into stores (with making non-action-output-memory not overlap from both DNAs)
Then it can select 50% stores from one robot and 50% from the other.

(I have no time right now to clarify what I mean by "non-action-output-memory")

P.S.
Numsgil, I would love to start helping you out on DB3 since I did learn some c#. However I still do not have free Wi-Fi where I live now (it broke a while ago). And my mom does not want to pay extra for internet (because we already pay for Wi-Fi in the rent). I am using the club house computers right now.

Navigation

[0] Message Index

[#] Next page

Go to full version