How to assign panel types based on weighted distribution?

durian manual.gh (14.2 KB)



So Ive currently created hexagonal cells w/ panel frames and I wanted the panels to be distributed according to a weighted chance. I have setup the chance itself but I do now know how to assign a panel type to a specific value so that it would automatically generate

Weeping and whining as we line up at a 77 degree angle Seven 750cc bikes lined up effortlessly, gazing at each other for a long time Diagonal 77 degrees

:interrobang: :rofl:

based on an anime: https://youtu.be/p_rJLI3tuTw?t=19

1 Like

durian manual a.gh (16.7 KB)

2 Likes

Just a note on picking stuff with the dice :slight_smile: and sorry if you were already aware of that [btw, Heteroptera is just an amazing piece of code]

imagine you have a bag with 9 balls: 4 are white, 4 are black, 1 is red

Cheater Dice picks a random ball for you and tells you its color then puts the ball back into the bag

this means that if you random pick n times, if are lucky enough / unlucky enough you can end up even with many red balls in a row, despite just one of those being in the bag: the bag does not remember what was picked last
same thing for the dice :+1:

if you want a given distribution to be respected fully, meaning that you will have that given distribution of panels per type -regardless of probability- the best option is to populate a full list of all possible types, shuffle it, and use it as it is

I think one of the best ways to do that in GH might be Repeat Data + Jitter

just to visualize the difference of outcomes, the top one is Cheater Dice, bottom one is Repeat Data + Jitter

probability_distribution.gh (10.9 KB)

1 Like

Hey, I did not know that before using the dice but the dice was the only thing I was able to get working, however, I did notice that certain seeds had a huge discrepancy on the results, wherein a number would not even show up.

Thanks a lot for letting me know!

Thank you for helping out! Really appreciate it!