Code center > Bugs and fixes
Genetic Distance / Generational Distance
Numsgil:
For commit messages, a sentence or two is usually fine, but be as precise as you can. You don't know when you might leave the program to work on other stuff, and you want whoever looks at it next (yourself included) to have an idea of where you left off. For instance, a bad message would be: "physics stuff". What physics stuff? GUI work or engine work? Is it in a finished state? A better message would be: "Fixing bounciness issue when bots collide. Updating physics options form with a new slider to control bounciness.".
Botsareus:
I don't think the crossover code works correctly at all:
I set up this test:
--- Code: ---Private Sub MDIForm_Load()
'debug
Randomize
Do
Dim dna1(9) As block
Dim dna2(11) As block
ReDim rob(1)
dna1(0).value = 100
dna1(1).value = 200
dna1(2).value = 300
dna1(3).value = 400
dna1(4).value = 500
dna1(5).value = 600
dna1(6).value = 700
dna1(7).value = 800
dna1(8).value = 900
'
dna1(9).value = 1
dna1(9).tipo = 10
dna2(0).value = 111
dna2(1).value = 2
dna2(2).value = 3
dna2(3).value = 4
dna2(4).value = 400
dna2(5).value = 500
dna2(6).value = 600
dna2(7).value = 8
dna2(8).value = 9
dna2(9).value = 10
dna2(10).value = 11
'
dna2(11).value = 1
dna2(11).tipo = 10
rob(0).DNA = dna1
rob(0).DnaLen = DnaLen(rob(0).DNA)
rob(0).spermDNA = dna2
rob(0).spermDNAlen = DnaLen(rob(0).spermDNA)
Crossover 0, 1
Dim i As Integer
For i = 0 To UBound(rob(1).DNA)
MsgBox rob(1).DNA(i).value
Next
MsgBox "reset"
Loop
'debug
--- End code ---
and it is ether returning the DNA or the SpermDNA
it should be returning one of the four below:
--- Code: ---111,2,3,4,400,500,600,700,800,900,1
100,200,300,400,500,600,8,9,10,11,1
--- End code ---
it is only returning:
--- Code: ---100,200,300,400,500,600,700,800,900,1
or
111,2,3,4,400,500,600,8,9,10,11,1
--- End code ---
is this output wrong or am I missing a step?
Numsgil:
I think it has a threshold where if the DNA is dissimilar enough, it doesn't do the crossover at all.
Botsareus:
surely this has to be similer enough (same result :():
--- Quote ---'debug
Randomize
Do
Dim dna1(100) As block
Dim dna2(100) As block
ReDim rob(1)
Dim i As Integer
For i = 0 To 99
dna1(i).value = i
dna2(i).value = i
Next
dna1(0).tipo = 1
dna1(1).tipo = 1
dna1(2).tipo = 1
dna1(99).tipo = 1
dna1(98).tipo = 1
dna1(97).tipo = 1
dna1(100).value = 1
dna1(100).tipo = 10
dna2(100).value = 1
dna2(100).tipo = 10
rob(0).DNA = dna1
rob(0).DnaLen = DnaLen(rob(0).DNA)
rob(0).spermDNA = dna2
rob(0).spermDNAlen = DnaLen(rob(0).spermDNA)
Crossover 0, 1
Dim k As String
k = ""
For i = 0 To 99
k = k & " " & rob(1).DNA(i).tipo
Next
MsgBox k
Loop
'debug
--- End quote ---
btw, what is the threshold % anyway? because I found no code at all that looks like it is checking for dissimilarity
Numsgil:
It smells like it's just plain broken then. You should probably attempt to fix it or check out a previous version and see if you can isolate which release it broke (and figure out what the change was).
I don't remember the threshhold percent. I think it was supposed to be like 50%. This is the relevant thread where Eric was discussing what he was trying to do.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version