algorithmic modeling for Rhino
Hi guys, I'm trying to convert a given adjacency matrix to a visualised weighted directed graph in rhino and feel a little out of my depth. Does anyone know a way I can do this?
The final result should show something like this image to the right in rhino.
The methodology doesn't really matter, as long as it can be applied to any given adjacency matrix.
If anyone solves this Ill send them some sweets. Cheers!
Tags:
Replies are closed for this discussion.
Thanks again peter!
Sorry if I may seem 'ignorant' but I'd like to ask a couple if "simple" questions. I am relatively new to the grasshopper discussion and am unsure about the terminology you are using.
First, I'd just like to clarify when you say 'Nth iteration', 'AEC', what do you mean?
Secondly, why is the script so powerful in the wrong hands?
to save time, I'm looking through python stack exchange for a simple generator to create one in grasshopper components. Still looking.
Nth iteration means that you have read the Bible for the Nth time. I do hope that you did that, he he. After that there's at least 4 other books waiting (around 666 pages each).
AEC means Architecture Engineering Construction = acronym that describes idio ... er ... I mean "respectful" engineers like yours truly.
Going from adj matrices (via cluster analysis) to dendrograms is something worth millions within a variety of sectors (economics, statistics, genetics, war games and ...er ... AEC). That's the reason that I don't expect to find source code for that easily (if at all).
NMath library (and others) provide some methods for that (but you still need some work for the "graphics" part) ... but they cost a "bit" (especially the multi threading capable versions and/or the CUDA "accelerated" ones [Google: Nvidia CUDA]).
http://www.centerspace.net/blog/drawing-dendrograms/
BTW: Creating an HAC hard dendrogram with C# in GH (from scratch) although entirely doable ... er ... requires a certain experience. If you are not on that level I would strongly suggest to stop wasting your time.
BTW: But even assuming that you can do the HAC ... you'll need "some" lines of code more in order to "translate" relations, desires,demands,whatever into topology. Hey ... that's exactly what the Aurora Project does.
Yes of course I have read it N' times! ;)
I haven't had a chance to play with your script properly yet, don't have all the plugins for it installed.
Concerning your prescribed reading material: I should admit, I'm a little over whelmed with all the reading material you have sent me as well as my own research into the topic.
Concerning giving up: No I will not give up! It doesn't need to by C# it could be anything as long as you can see the result in rhino. Anything will do.
Sorry I missed interpreted your previous question,
Preferably you would fill up the adjacency matrix via a visual display/manual frame that was 'transformable' much like the one I have showing below. this would make it easy for the user to change a parameter, for example, the importance of the judges views over the witnesses and see the affect on the formatting of the courtroom. This would mean instead of a feed product output of the matrix, the matrix would be available within the script for the user to modify at will and see the transformation within grasshopper. Is there a way to do this? Your C# code works off a random number generator, can I replace this with my own feed of the matrix?
Er ... hmm ... but the scope of the left part of the LAST def attached is to feed MANUALLY and INTERACTIVELY the @#$#$ matrix. If the right part (the old one) receives a user defined matrix it works with that matrix. Simple eh? (I mean "simple", he he).
If you still can't get the gist of how to do it > Plan Z > live session > Skype
I do not believe that the dendogram is the answer. The dendogram only deals with the allocation of participants within a space, and we already know this. The question is is actually finding the 'orientation' of the tables and chairs of the participants within the courtroom.
Obviously any HAC is not the answer (Did I said that?) since it gives you only a collection of possible (general case) hierarchical relations of spaces (say participant's chair footprint). Actually an HAC is a "translation" of any Adj Matrix
But the HAC is the start of Ariadne's thread: you should start building topology (for a given HAC) by arbitrary combining bottom-top ("closely" related) spaces having always in mind spatial restrictions (in this very simple case: courtroom layout, when in a general case: building codes).
And since this is in fact an ill-defined problem ... the solution (and the management of potential "equally" successful ones) is far more challenging than you can imagine (i.e. "translating" HAC to topology).
As I said the HARNESS hospital system was the very first large scale attempt for doing that ... but this was 30 years ago ... lot's of things happened since (and leaving code aside ... the CUDA initiative was the critical factor missing with regard processing power).
I seriously doubt that you can find open code for doing this type of stuff.
Hi Peter,
No I wasn't writing it off completely, I just haven't found one dendogram that deals with straight-line relationships (sightlines are straight).
Somehow the sightlines and the restrictions of the courtroom need to be combined.
Vector Summation in this case maybe helpful.
If its possible, to make a straight armed HAC but also have attached vectors that would connect and represent the sightline relationships between the various participants.
This would influence the orientation of the seating and fixtures might work. The force of the participant vectors who's sightline connectivity was more important would be stronger than those that are less important. we could use a force average that would find the balance between the two and orientate the tables and chairs to face the 'optimal' direction.
I acknowledge there maybe a few iterations of what is 'optimal'.
Well ... in this case the "building" codes (so to speak) are just a combination of allowed court layouts (we can't do whatever we want) and the sight-line potential solution "validation" criterion.
The orthodox way to deal with this is to use it as a filter: does the x solution variant breaks this law? If yes "how much"? Because it is more than possible for such kind of problems (ill defined, that is) that there's no perfect solution achievable. But what is perfect anyway ? ... and who (real-life, real complex projects) cares about that?
Of course the simplest the problem ... the more important becomes (on a "local" world) any compliance with any rule. But the big picture is another animal.
Remember: is the compromise of our goals what we are really after AND NOT the 100% "perfect" solution. If the entropy is the measure of failure ... we are looking in fact for the less entropy AND NOT for the zero entropy. Anyway ... in this simplest of all cases ... if you are lucky (Karma matters as well, he he) you can achieve "perfection"... but in real-life things are waaaaaaay different.
So ... if you attempt to attack that kind of stuff without a certain "flexibility" ... you'll find yourself chasing your tail.
So the 1M Q is actually: by what means we can manage the most "successful" solutions? And up to what point we accept "deviations" from the ideally expected? And by what means can we monitor these "deviations"?And by what means are we sure that the Adj Matrix is correct? And what if cells were different?
blah, blah.
BTW: What library you use for HAC? Or you did it from "scratch"?
BTW: The most classic mistake in ill defined problems is to attempt to "squeeze" (or "engulf") local/global rules (or building codes) into adj matrices: NEVER DO that.
Adj Matrices are your desires (that MAY or MAY not being fulfilled ... because ... er ... life sucks, he he).
Rules on the other hand are flexible (if just one [of "few"] has no eye-contact: well ... so be it, life sucks) or very strict (building codes) animals.
The catch is to fit desires into rules and not the other thing.
Ok forget the building codes and the rules of a courtroom. Is it possible to have a dendogram and use the clusters to form forces that push and pull the courtroom participants together or apart? for example, you create a force that is strong enough to act as a clustering mechanism and also an orientation mechanism?
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