Py you sayed there was a way to insert new instructions , ex: "50 .repro store"
How is this:
While pos <= endg
If Random(1, prob) = 1 Then
If MakeSpace(DNA, pos, 1) Then
DNA(pos).tipo = 2
DNA(pos).value = Random(1, 9)
x = x + "Inserted instr," + Instrname(DNA(pos).value) + ", at pos " + CStr(pos) + vbCrLf
InsertRandomInstr = InsertRandomInstr + 1
End If
End If
pos = pos + 1
Inseting a whole new instruction 3 parts man , all it seems to be doing is inserting mathematical opperators. I am too lazy to write the correct code, I beat you are too, so I am just letting you know because you had me convised that it actualy worked for a while
Duplicate an instruction actualy works. But because it does not duplicate from one gene to another, SPLIT gene must work.
FIXED: SPLIT WORKS , just replace with this:
'appears to be broken. genenum never > 0 Too bad , fixed by BAU
If Random(1, CountGenes(rob(n).DNA)) = 1 Then
a = a + SplitRandomPos(rob(n).DNA, (rob(n).mutarray(5)) / SimOpts.MutCurrMult, x)
End If
:P
B)BAU 2005