But l have encountered a problem when distributing data from root to child
then to leafs. l'm looking for something like this:
*level 0 root : * data= rand(10000) # generate 10000 random
values
*level 1 10 child * for each child attribute a certain number of
generated values , divide the data generated in the root between the childs
for example child 1= 1000 child 2 = 500 child3 = 750
child4 = 1500 child 5= 2000 child6 = 250 child 7= 1500 child8 = 500 child
9= 1000 child 10= 500
the sum gives you = 10000 values
*level 2 leafs :*
each child has a certin number of leafs . let's suppose that child 1 has 4
leafs. then data should be shared as folllows :
child 1 = 1000 values
leaf 1 = 500 leaf 2 = 200 leaf 3= 100 leaf 4 = 150 leaf 5 = 50 and the
sum equal to 1000 (child 1 = 1000 values)
do that for each child.
l'm trying to do that since yesterday but l failed, l keep trying , any
help please
On Monday, July 4, 2016 at 2:09:25 PM UTC+2, Andre Bieler wrote:
>
> Well for 1) this is pretty much exactly what is being done in my example
> code.
> The difference is that it prints out the content of "data". (But I put the
> index of
> each child into that "data" varialbe)
>
> My suggestion is that you insert a new field in the MyNode type, this
> variable
> can then hold an index. E. g. for child1 this index is 1, etc.
>
> Then do the same thing my example does in the end, but print out this
> index instead
> of data.
> I think you should try implementing this on you own, it will probably help
> you understand
> what is going on in the code. If you have problems doing so you can come
> back with more
> questions.
>
> Cheers,
> Andre
>