min/max value in a group & weighted randomness

   1196   0   0
User Avatar
Member
15 posts
Joined: Sept. 2016
Offline
Hi there,

for my current project, I need to do two important things. I need to get the lowest/highest value of an attribute in a group, and I need to select a random point in a group with a weighted chance.

For the first one, I wanted to use the max/min function, but obviously it doesn't work on groups. Therefore I am using a workaround. example:

  • Generate Group A, each point with a random number.
  • Append the random attribute to an array running on my “array point” (well, it's a group with one point)
  • Use the min/max function to get the lowest/highest value within the array and save it on the point (two extra attributes needed)
  • Next wrangle running on Group A, get the max/min value with the point function and work with it

This is the only way I found, but not the best one. Is there another, more elegant and memory saving method?

The other problem is that I need to get a weighted chance to work and to select a random point within Group A. But some points should be chosen more often than other, based on the weighted-chance. I am currently working on a method to get it work on 1-10k points, but will need a little bit of advise or help

If you have any advices or solutions, don't be shy, just reply
Check out my profile: https://vimeo.com/user750491 [vimeo.com] Feel free to leave a comment if you like a video :)
  • Quick Links