Jump to content

foreach problem


Recommended Posts

I am debugging a network but I'm not sure where it goes wrong.

I want a nested foreach loop.

The first foreach loops by number. The inner foreach loops over groups.

To test this setup I included an xform that multiplies size by 0.9. The first foreach works because the object reduces in size. The inner loop doesn't work and I don't understand why.

And yes, both have different stamp value names.

foreachhmm.hip

Link to comment
Share on other sites

Well I solved that problem (tick the merge/apply points boxes) but it turned out to be unrelated to why my thing didn't work (I think).

Baah, I'll just post the whole problem then:

I am trying to set up k-means clustering.

http://en.wikipedia.org/wiki/K-means_clustering

But something isn't working. The idea is to find the mean position of groups, then re-create the groups with the new mean, etc until you have a nicely balanced set of groups.

Somehow it only iterates once and doesn't change anything...

Any ideas?

kmeans.hip

post-4013-1307503342_thumb.jpg

Link to comment
Share on other sites

It looks like you are close to what you are wanting. How close are the brown and blue boxes? Are they set apart in the depth axis from this view? Have you tried a simpler model? For some reason my gut is kicking that there is some sort of error being generated in the algorithm around the blue/brown boxes, since the green box looks like it is working perfectly. Of course, this is all just conjecture based on what I read on the wiki page and what I could understand of the math with what I know. Did you start them setup in an equilateral triangle? I might try that to see if it works under ideal circumstances, then start tweaking things until it gives me what I want.

edit: Nevermind... lol.

Edited by Adam Ferestad
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...