Grasshopper

algorithmic modeling for Rhino

Hello everyone,

I'm making some hourly solar radiation simulations in a large geometry with more than 1000 individual buildings, so I'm calculating one building at a time. To do this, I created a "buildings" slider to select each building and run the solar radiation simulation and save the result into an excel file. It works, however it takes around 2 hours to compute radiation in all buildings, but I think there's nothing I can do about execution time.

The problem is that I would like to change the Analysis Period automatically and restart the "buildings" slider so that I don't have to check my computed every 2 hours, but I just can't figure out how...

For instance, suppose I want to calculate hourly solar radiation for the 21st of January, from 6am to 7 pm. It would be convenient if I could Animate the "hours" slider so that once the simulation for the last building was finished the "buildins" slider went to 0 again and the hour changed to 7. And so on...

Perhaps a small script with a basic cycle would solve the matter, but I still can't figure out to control the sliders as they have no input options.

Any ideas?

Thanks in advance!

And I'm sorry if this is a basic question or it has been discussed before (I'm new here and I didn't yet find similar discussion on this website).

Views: 2857

Replies to This Discussion

Anemone nested loops - one for the "building slider" and one for the "hour slider".  Replace the sliders with direct output from the loops.

Something like this?

Attachments:

Nice!! Not considered that Anemone would work abit like trampoline as it can only loop when it is done. Be interesting to see which is faster..

Anemone has some new "Fast Loop" components that I've been playing with; one of the differences is that they appear to suppress preview output which makes them less interesting for animations.  And they seem to work better with "local variables" instead of accessing data outside the current loop - meaning it's better to pass all data as loop inputs instead of the "short cut" I used above connecting 'Box' to 'List Item', for example.

Does some thing like this make sense to you too.

Trampoline listens to your computer and when the process is done it starts again have used it a few time for populating/morphing objects over a surface. I would test it with a maybe 5 buildings and 3 hrs to start to see its working ok as don't have any code to link into to test it from this point on here. 

I did not write the Trampoline Component Giulio did a while ago. Link below to the Original Topic

http://www.grasshopper3d.com/forum/topics/timers-and-theengine-scri...

Hope its some help.

I will have a think about how to make a quicker way to make a reset counter so you don't end up with giant lists

P.s You need another Item after the Single building item to select that building from the list.

Attachments:

A little update more for my own interest in seeing if I could count though the hours and the buildings with listing the item index 1000's of times, as Joseph's code maybe better.

Attachments:

What does "better" mean?  I've never heard of 'Trampoline' before...?  Not sure how it works to create a loop?  And I think you need two loops here, one for the hours and another for the buildings.

I'm guessing the solar radiation calcs (simulated by the 'Volume' component in my example) will take some time, relative to the loop overhead, so there may be no advantage in using Anemone's "Fast Loop" components, but they're worth exploring - not so obvious to control though, since you can't see what's happening while they run and I've found it more difficult to trigger the outer loop correctly...

Hmm thinking about it, as I understand it 'Trampoline' Listens for the script to complete and counts, you can input an interval so it only counts on timed intervals, but I mostly use it for background processes where I need it to run as fast as possible. and stops running/listening when its number of reps matches the count.

I have then used this counter to count though the list of buildings, with the item set at True so when its gets to the end of the list of buildings it counts the first again. So i guess that's a loop per say.

As for the time I ask the counter is it is divisible by the number of buildings in the list. If it is true record this. Then I calculate the length of the list to move the hour onto the next one when the list is complete. Thus creating a counter that only ticks when the list of buildings has been run though. As the list only gets to record the true values the recorded list is never going to be longer than 24 :D or how ever many hours you ask it to calculate for.

So does 'Trampoline' listen to the entire GH script?  Or only the part that feeds its input(s)?  Is it possible to have multiple 'Trampoline' components in a single GH file?  Nested like Anemone loops?  I could experiment with it myself but enjoy Anemone so much I'd rather not take the time...  More about "Fast Loop" in a separate post.

Yes the whole script so you can only run one and only with one set of reps I would guess.

Hi Sara - guys, though I don't have a clue what inputs your simulation needs, this may be a way to approach it, using one slider. I'm just showing the principle I had in mind, so you'll have to adjust it to fit your needs (if this is at all applicable to your definition).

Attachments:

That works well Pieter except that it cycles through all times for each building instead of cycling through all buildings for each time...  I guess that's a simple matter of reversing the inputs, so to speak.

I wonder if 'Animate' slider waits appropriately for each calculation to complete?

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