Code center > Dead-End and Solved Suggestion Requests
Advanced Randomness Generation Thread
PurpleYouko:
OK Here is the code which inserts a NEW condition.
--- Code: ---' inserts a new condition
Public Function DNAInsertCond(n As Integer, x As String, DNAto As String) As Integer
Dim t As Integer, k As Integer, inizio As Integer
Dim a As Integer
Dim b As Integer
Dim genestart As Integer
t = 1
DNAInsertCond = 0
With rob(n)
While Not (.DNA(t).tipo = 4 And .DNA(t).value = 4)
If rob(n).DNA(t).tipo = 4 And rob(n).DNA(t).value = 1 Then
If Random(1, Int(rob(n).mutarray(8) / SimOpts.MutCurrMult)) = 1 And DNACondsInGene(n, t) < MaxDnaCond Then
DNAInsertCond = DNAInsertCond + 1
x = x + "Condition inserted at pos " + CStr(t + 1) + " through " + CStr(t + 3) + vbCrLf
k = t
inizio = t + 1
If DNAMakeSpace(n, t + 1, 3) Then
.DNA(t + 1).tipo = 1
.DNA(t + 1).value = rob(n).usedvars(Random(1, rob(n).maxusedvars))
.DNA(t + 2).tipo = 0
If Random(1, 10) = 1 Then
.DNA(t + 2).value = Random(-10, 0)
Else
.DNA(t + 2).value = Random(0, 32000)
End If
.DNA(t + 3).tipo = 3
.DNA(t + 3).value = Random(1, 6)
x = x + "new condition = " + varname(CStr(.DNA(t + 1).value))
x = x + " " + Str$(rob(n).DNA(t + 2).value)
x = x + " " + Condname(rob(n).DNA(t + 3).value) + vbCrLf
DNAto = DNAto + " " + varname(CStr(.DNA(t + 1).value))
End If
End If
End If
t = t + 1
Wend
End With
End Function
--- End code ---
Note the line....
.DNA(t + 1).value = rob(n).usedvars(Random(1, rob(n).maxusedvars))
This line puts a random value into the DNA file at a position equal to the first part of the conditional statement.
It does appear that it is only able to grab a value from the "Usedvars" list which contains the memory values of all the sysvars.
From this code it does indeed appear to be impossible to generate a condition like..
*55 24 !=
since *55 does not appear in the "Usedvars" list
Is this what you are getting at Bots?
:D PY :D
Botsareus:
Yes that [you]one[/you] of the problems.
Read the other two also.
(PY FINALY YOU GETTING IT :) :) :) )
That a problem
That a problem
PurpleYouko:
I don't quite follow what you mean though.
Are you saying that it isn't possible to change the conditional at the end of the 3 part condition?
eg. from...
*.vel 30 >
to....
*.vel 30 !=
:D PY :D
Botsareus:
"Are you saying that it isn't possible to change the conditional at the end of the 3 part condition?"
NO you got it right before , no no thats not it.
I am talking about *55 in your example , not about the conditional
-----------------------------------------------------------------------------------------------
--- Quote ---From this code it does indeed appear to be impossible to generate a condition like..
*55 24 !=
since *55 does not appear in the "Usedvars" list
Is this what you are getting at Bots?
--- End quote ---
Thats it man thats what I am talking about.
PurpleYouko:
OK I think I finally understand what your problem is.
I will check it out and see what can be done. Shouldn't be too hard.
I do think that the vast mojority of mutations aught to point to something that makes sense though.
It makes a lot more sense for a new condition to read something like...
*.ypos 567 >
than if it came out as...
*567 284 !=
or...
*894 *28 !%=
The first one is usable while the other two are just garbage. That is why the mutations are designed to point toward something usable in the present system.
It should be possible to get garbage conditions and actions though
:D PY :D
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version