Selecting Percentage of Random Points

Hi Everyone,

I am new to Grasshopper and need help with what I think should be a pretty straightforward task.

What I would like to do is be able to select a specific percentage of random points. However, I want to be able to select multiple different sets of random points based on number slider inputs.

For example, I populate a field of 100 points and then set slider 1 to 0.20, slider 2 to 0.40, and slider 3 to 0.40. My desired result is to have three sets of points- the first group with 20 randomly selected points, the second with 40 randomly selected points and the third with 40 randomly selected points. Ideally, all 100 points have been selected and no point has been selected twice.

The problem that I am having is that my current definition passes unused points from the first group along to the second group for the second round of selection of random points. Using the example above what I end up with is 40% of 20% not 40% of the whole.

Any thoughts on how to get each slider to sample the desired percentage of the whole while ignoring already selected points?

I have attached the *.gh file for the work I have done so far.

I appreciate the help in advance!
-Thomas

Random Percentages of Plants.gh (37.3 KB)

This is a more “parallelized” solution.
Don’t be scared to dive in tree management ! :joy: (you should, but go anyway)
Random Percentages of Plants_re.gh (18.5 KB)

2 Likes

This is exactly what I am looking for! Thank you so much for your response. Diving into tree management will definitely be on my to-do list. I believe I follow the logic behind why your definition does what my initial one could not. Thanks again for your help!

Best,
Thomas

You can use Random reduce

Random Percentages of Plants2.gh (14.0 KB)

1 Like