Grasshopper

algorithmic modeling for Rhino

Hi all, I am having an issue which I cannot resolve.

Have posted related questions in the past few days with some insight, but nothing that quite works.

I am attaching an image of my problem.

Basically I have a Tree with x number of branches each have y number of values.

I want to take one branch, and do calculations between that branch and all the other branches. 

This is not a problem, if I use the [Branch Item] component. Yet this needs to be scalable and I cannot use [Branch Item] for hundreds of branches.

It seems like there should be a solution to this, but I cannot figure it out.

The example problem shown in the image is trying to do a correlation coefficient calculation, although the exact calculation does not matter.

Any help at all is greatly appreciated.

Thanks!

Views: 798

Attachments:

Replies to This Discussion

A current work-around is to use the [Branch Item] and attach the output of the equation to the [Data Recorder], then use a slider to quickly jump through all the branches in the tree.

This works, but it is not ideal.

Hi..

 

I don't know what is the problem exactly..

 

I think the attached image shows proper definition meeting your needs..

 

Do you mean it doesn't work for hundreds of branches..??

 

How about uploading your bad case..??

 

or Use rather Params Viewer + List Item than text Panel..

 

Thank you for the reply.

You are right, there is nothing wrong with that definition.

While I do mean it doesn't work for hundreds of branches, it doesn't even work for 2 branches.

Well, it works I suppose, but just not doing what I thought/want it to do.

Here is an image of "the problem"

What I want is for there to be twice the number of outputs because I am inputting 2 branches here rather than one. So 12 values rather than 6. I actually am not sure what numbers it is computing in this case.

Attachments:

Brian's right...I think a script component is definitely the way to go here.  I've written one that I think will do the trick for you.  Pardon the inelegance of my VB...I'm sure there are much easier ways to do it, but this at least works.

I've gone ahead and restructured the data in your output, because layering in multiple "lookup" paths requires it, so that the resulting cross-referenced datasets indicate both the original "lookup" path as well as all of the raw paths it's being compared to.  Does this accomplish what you need?

Attachments:

As David's VB script..

It is needed to match numbers of lists..

 

For example..

when you calculate 3 lists(A) with 5 lists(B)..

the last list of A is matched to the remain lists of B..

So the coefficients of {0} and {2} might be "1"..

 

If you want n*k Pearson Coefficient..

you need n*k duplicated lists.. (rows/columns)

And David's Script does it..

I am starting to follow how this is *supposed* to be working.
Why are you feeding 1,3,5 into the "lookup" variable? I am unsure of the significance of these numbers here.

I see now. This is completely working for me. Thanks so much!

I am assuming the "1,3,5" branches were just used as examples.

Thanks!

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