algorithmic modeling for Rhino
Hi
I'm looking for the lightest/quickest way to see if just one item in a list is true.
as it is for now, im using the "average" component, to see if my average is above 0 as seen below:
I'm just thinking if this can be done easier using script. This is currently 1% of my data, so the calculation time is important. I've tried with mass addition instead of average, but MA is slowerl.
Best, Mathias
Tags:
just FYI:
Tried dispatch and cull, all of them are slower than the average function.
Processing times with my list:
Average: 10s
Mass addition: 20s
cull: 20s
dispatch: 2min
Maybe a VB script can do it better.
Ah too bad. I tried the following lines in C# script components, but they take much longer
x.Max() which returns the maximum value in a list x
x.Contains(true) which checks whether a list x contains the value "true".
But it is possible that the script components are slower since they have to build the code first, as opposed to custom components for Grasshopper which are build in Visual Studio first.
In the meanwhile, I tried out the FSim (Find Similar Member in a set) component to look for "true" on a lot of sublists, that seems to be the fastest for "my" test case.
Btw, you should move this post from Sample and example files to General Discussion, then you might get more responses.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by