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