Hi guys
I’m here to ask you a question because I have a problem writing a script. Heiwayuuri-2D.gh (19.6 KB)
Here is Mahdiyar’s c# script, But I want to change this with start & end point.
And this script, if the biggest value is already selected, then it stops But I wants to change this script to grow the next big value until that get to the end point.
II tried to change it, but I don’t know, so I ask a question. I’d really appreciate it if you could answer
Aside from the arguable methods used there, if I understand correctly you want to create a “snake” going from one point to another one, each time jumping to the highest number available. But the problem is there are situations where it could get stuck (if you loop back) depending on the original distribution of numbers.
Like, I just did ONE test randomly and it gets stuck : starts on bottom left at 90 and attempts to go to 35 on top right. Road gets blocked at 25…
Thank you so so much for your reply!!
I asked autor, but it was posted 4 years ago, so it’s hard to expect an answer.
My final goal is to start from first point and go second point, and in the process, follow the highest number possibly, not necessarily the highest number.
And if there are the same number around one grid, that put it together with block.
Actually I’m going to use the one called from the excel file like the picture above rather than putting in random numbers.
So, is there a way to retrace the path that have taken when they are stuck, or jump and get as high as they can to reach final destination?
Did I said like talking to a stupid robot? No I forgot that part I guess.
Anyway:
What is “vale” for the grid ? Maybe a 1-10 number randomly assosiated with a grid pt? (like the weight of some Graph node?).
What means “network”? Maybe a collection of points? Or the connections of these points in the order of finding them? (Points are called Nodes in Graphs).
Is the grid seriously big? (in order to use things the likes of RTree on some custom object defined via a Class (Properties: grid pt , idx, rnd pt weight/ number)).
Your explanation on the “blocked” (i.e. visited) pt event is poor: You mean expand the search (i.e. go from the 8 prox neighbors to the next 16 … blah, blah) until a non visited pt is found?
Other than that a basic tip:
When searching - in this case - for prox neighbors populate 2 arrays: the Idx Array with the indices found AND the Num Array with the “numbers” assosiated with these indices (i.e. points). Then do a sync sort (Array.Sort(Num, Idx)) and get the LAST item in the idx Array (that points to the biggest value in Num).
Well … I’m just the manager. Others do that sort of stuff (plus I hate computers, Windows, A.I., Gin Tonic, any Toyota and any Harley Davidson).
But I assigned this to my top dog IT guru (of gurus).
Genius said: since all the Graph conn things are internal … I’ll use a Mesh in order to get the VV Conn > Recursive “expansive” search (using multi “start points” ) > Until the End of Time > Elementary.
I said: I don’t understand an iota … can you elaborate more? Guru said: imagine this, then just add node weights (thus voids in the collections):
Update (I hate that dog):
Guru said: done (Recursive stuff, multi start points, expansion loop control etc etc) , where’s some extra bones?
Lord said: wait a minute: in an existed C# … you’ve just added a few lines and a Weights clause. And for one minute job you ask bonus bones ? Guru said: a pro cuts the mustard with minimum effort while demands maximum reward(s).
On that matter that idiot dog did a poor solution.
Using multi start “points” (in fact Mesh Face random indices) results are a bit on the primitive side (but very fast no matter the N of Faces) . But the 1M question is: who’s gonna notice if the logic is correct or bananas? Meaning: another academic case lost in the big rabbit hole ???