Code center > Suggestions
More realistic mutations
Guest:
Dim a as integer
Dim b as integer
Dim c as integer
Dim d as integer
a = Int(Rnd * 10)
b = Int(Rnd * 255)
c = Int(Rnd * 20000)
d = IIf(Int(Rnd * 2) = 0, -1, 1)
theoutput = Choose(Int(Rnd * 3) + 1, a, b, c) * d
'theoutput is the final output
Numsgil:
Ah, much better. Now I can see how it works. :D
Botsareus:
Again I forgot to logon , great
Dont forget to add Randomize unless ofcorse its already there
This way we can have better chance of having small numbers without worrying about not having big numbers, theoutput is the final output
ranges for "a" , "b" , and "c" can be tweaked by PY and NUM, make "b" match the length of sysvars for example; I don’t recommend tweaking the range for "a" , I like it like that its a good range for that .shoot command
***
Well? Did you try it Num? Does PY like it too?
Numsgil:
I started replying but then I had to look up a link and I got distracted. <_<
This is an attempt at a gaussian distribution, right?
An interesting technique, did you come up with it yourself?
trying to do rnd * 2 to come up with a random bit has some subtle flaws (the distribution can be off).
Check this link on random numbers.
Chapter 7.
Botsareus:
Yes I did. So can we apply it to the problem for more realistic mutations ?
lest time I checked "IF int(rnd*2)=0" worked fine , checking now to be sure...
Nice link but I think I will Invent stuff myself before I find what I am looking for in there....
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version