Even Random Distribution


This user object component takes a list of objects and randomly distributes them into a user specified number of sets. The resultant item count per each set will be equal if the total items is a modulus of the specified set count, or will max the floor total required then add an additional item onto randomly selected sets till the remainder is satisfied.


Even Random Distribution

L In Object List A list of objects to be randomly distributed
N In Integer Item The total number of sets for random distribution
S In Integer Item The seed value for the random function
X In Integer Item An optional cap for the number of runs to try before failing if an impossible or improbable scenario is provided
A Out Integer List The indices of the random selection for the total number of sets
B Out Object Datatree A datatree of the list objects distributed to branches matching the set indices
R Out String Item Notification if the run limit was hit before the goal was achieved


Minimum Requirements

PlatformRhino 5, Grasshopper
VersionGrasshopper 0.9.0075
TypeC# Component