I have to lists A and B. List A has “a” branches and List B has “b” branches. Each branch holds a random number of items. In the example case (see attached my .gh file.), each branch of List A has N=284, whereas N=1 for branches of List B. N might differ from branch to branch within the same List.
What I ultimately want is to generate two output lists, both with “a x b” branches. Both outputs, when placed side by side, would define all possible combinations between the branches of List A and the branches of List B. But, in a specific order/way. As such:
The list generated from List A would be the 1st branch of A, repeated “b” times. Then, the the 2nd branch of A repeated “b” times, followed by the 3rd branch of A repeated “b” times and so one.
As for the list generated from B, its 1st “b” branches (branches from 0 to “b-1”) would be the same as List B. From branch “b” to “2xb -1”, we would have another repetition of List B, until we would have “a” repetitions of List B.
I’ve been playing with the Holistic component but the problem is that I can’t achieve this specific order and, more importantly, the number of items per branch from the original Lists are not being kept…
I had never played with the maintain/renumber options within the Branch Component! Thanks for that.
However, it is not quite right yet, I think… This is what you proposal achieves (in my new .gh file, I changed the size of List B to 3 branches to reduce complexity):
Oh, yes, you can remove the “Series” components and use directly the “P” output of Tree Statistics components… that way it should work with any tree structure.
you are right, I didn’t really double check the order of branches… sorry for that
in simple words:
you want to repeat each single branch in A, times {number of branches in B}
and
repeat the whole data structure in B, times {number of branches in A}
the number of items in each branch doesn’t really matter because entire branches are just repeated/duplicated “as they are”