mponent or whatever) implements the IGH_InitCodeAware interface you will have to add a method called SetInitCode(string) which will be called after the constuctor and you'll get whatever came after the equals symbol. Thus, if the user double clicks and types 'YourComponent = 4, true, 99%' then the string passed to SetInitCode will be " 4, true, 99%". You'll be in charge of parsing and interpreting it.…
Integer = 0 To 9
val *= 2
lst.Add(val)
Next
Since val is a ValueType, when we assign it to the list we actually put a copy of val into the list. Thus, the list contains the following memory layout:
[0] = 2
[1] = 4
[2] = 8
[3] = 16
[4] = 32
[5] = 64
[6] = 128
[7] = 256
[8] = 512
[9] = 1024
Now let's assume we do the same, but with OnLines:
Dim ln As New OnLine(A, B)
Dim lst As New List(Of OnLine)
For i As Integer = 0 To 9
ln.Transform(xform)
lst.Add(ln)
Next
When we declare ln on line 1, it is assigned an address in memory, say "24 Bell Ave." Then we modify that one line over and over, and keep on adding the same address to lst. Thus, the memory layout of lst is now:
[0] = "24 Bell Ave."
[1] = "24 Bell Ave."
[2] = "24 Bell Ave."
[3] = "24 Bell Ave."
[4] = "24 Bell Ave."
[5] = "24 Bell Ave."
[6] = "24 Bell Ave."
[7] = "24 Bell Ave."
[8] = "24 Bell Ave."
[9] = "24 Bell Ave."
To do this properly, we need to create a unique line for every element in lst:
Dim lst As New List(Of OnLine)
For i As Integer = 0 To 9
Dim ln As New OnLine(A, B)
ln.Transform(xform)
lst.Add(ln)
Next
Now, ln is constructed not just once, but whenever the loop runs. And every time it is constructed, a new piece of memory is reserved for it and a new address is created. So now the list memory layout is:
[0] = "24 Bell Ave."
[1] = "12 Pike St."
[2] = "377 The Pines"
[3] = "3670 Woodland Park Ave."
[4] = "99 Zoo Ln."
[5] = "13a District Rd."
[6] = "2 Penny Lane"
[7] = "10 Broadway"
[8] = "225 Franklin Ave."
[9] = "420 Paper St."
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
Added by David Rutten at 6:26am on September 9, 2010
combination is nearly 0 (of course with 1 try). You have about 100 (?) dimensions... its just impossible to do it well. Even with billions of random genotypes for 1st generation.
Its like 1:googol (10^100) to succeed. If youll try and run it on your pc, youll probably consume all the energy in universe, and it will take longer time than our universe will exist.
Sorry :(
EDIT : As David wrote in his post - every added dimension results with almost half of "success ratio". So as with one slider you have e.g. 1:2 ratio of success, with 100 sliders you have :
1:633825300114114700748351602688 (2^99)
To somebody more familiar with math -> correct me if Iam wrong :)…