probabilities of random integers

   4242   2   1
User Avatar
Member
190 posts
Joined: April 2009
Offline
I'm trying to make a tool that lets me control the distribution of values (integers) in a random function.
I want to instance about 20 different geos on points and not just completelly randomly.
So far i've found this way to do this:
round(ch(“../nrOfGeos”)*chramp(“../probabilities”,rand($PT*ch(“../seed”)),0))
I then use a ramp to slide the “probabilities” of the individual geos but this is not really a clean way to do this.

My first question: what would be the vop-sop equivalent of chramp?

Then, how can i “populate” a ramp with points and default values based on the amount of # in a multiparm block list?

Ideally i would like to have 0-1 sliders for every type of geo and use those. But i don't know yet how to get the normalised values and do the math to get the right geo.

I hope somebody can help with some pointers in the right direction, this would be very much appreciated.

Cheers.
User Avatar
Member
192 posts
Joined: Nov. 2008
Offline
the goal here seems to be manipulating arrays in vops. unfortunately, at this stage in the game, doing array manipulation in vops means inline-ing lots of code.

fortunately, in leiu of multidimensional arrays in vops we can use simple points as an array. because points can have any number of attributes, making a multidimensional array becomes pretty easy.

here's an example. kind of fun…

Attachments:
multi_demensional_array_in_sops_lol.hip (166.2 KB)
probabilities.jpg (204.8 KB)

User Avatar
Member
190 posts
Joined: April 2009
Offline
Thanks a lot Brian for this great example.
Smart move to use an attributePromote to sum all probabilites, i've seen it used before but totally didn't think of it.
The for-loops in vops is another part of your hip that i'm not overly familiar with and it proves very powerful.

Thanks again.
  • Quick Links