Grasshopper

algorithmic modeling for Rhino

Hi,

I wanted to understand how the "seed" works inside the random component.I was just interested in getting the domain that gives most unique numbers of outputs. Since I need to plug this inside Octopus(E.A). So I did a quick test within a domain 0 to 1 with varying decimal points in numbers and kept increasing the "seed" domain successively to attain the maximum unique numbers. But I received an error after the 4th decimal place. I don't know why because I never asked for integers in the first place.

Thanks in advance.

Views: 820

Attachments:

Replies to This Discussion

Anyone with any bright ideas?

Any ideas guys

It seems that you are exceeding the maximum integer value: 2147483647.

Put 2147483648 in a panel and plug it to a integer parameter and you will see how that value is the first one positive that does not accept.

This is because this number in binary is 11111111111111111111111111111111 (32s 1), and gh works with int32, the type that stores 32-bit integer numbers.

My dear Watson

If Omens are OK (min, max, count, Karma) you may find the attached useful (play with decimals as well).

Attachments:

Added some "visual" stuff (that has absolutely no meaning ... therefor is valuable, he he).

Works on thin/thick mode. Avoid the thick option if you have BIG N of numbers in mind

Attachments:

Hi Peter,

Longtime, thanks for the script; fancy visuals. Until next time.

Regards,

Aditya

Moral: when you are after unique randoms (if possible: given the range, the accuracy and the amount of numbers) use a HashSet and be a happy bunny.

For instance if you want to make a gazillion unique randoms between 1 and 2 with accuracy 2 decimals ... well ... keep trying until the end of days, he he.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service