Optimization by custom algorithm in Honeybee - Grasshopper2024-03-29T12:00:39Zhttps://www.grasshopper3d.com/forum/topics/optimization-by-custom-algorithm-in-honeybee?groupUrl=ladybug&commentId=2985220%3AComment%3A1621660&x=1&feed=yes&xn_auth=noHi Mostapha,
Thanks for your…tag:www.grasshopper3d.com,2016-10-19:2985220:Comment:16216602016-10-19T18:08:44.550ZSaeedhttps://www.grasshopper3d.com/profile/Saeed390
<p>Hi Mostapha,</p>
<p>Thanks for your comment.</p>
<p>I guess regards to my project I should do it in the first way you said (if I understood it correctly). because I need to define the variables out of the optimizer and then optimizer just automatically generate values of the variables and evaluate the objective function. before I used GenOpt coupling with EnergyPlus and here Galapagos with Honeybee; but since I haven't written an optimization code by myself, I wanted to see if somebody has…</p>
<p>Hi Mostapha,</p>
<p>Thanks for your comment.</p>
<p>I guess regards to my project I should do it in the first way you said (if I understood it correctly). because I need to define the variables out of the optimizer and then optimizer just automatically generate values of the variables and evaluate the objective function. before I used GenOpt coupling with EnergyPlus and here Galapagos with Honeybee; but since I haven't written an optimization code by myself, I wanted to see if somebody has done it here then maybe I could use the same algorithm and also know how to integrate it with Honeybee. Above, John suggested DEAP, but it seems there are some difficulties to use it in Grasshopper! </p> Any other idea to do that?tag:www.grasshopper3d.com,2016-10-19:2985220:Comment:16214842016-10-19T17:52:45.892ZSaeedhttps://www.grasshopper3d.com/profile/Saeed390
<p>Any other idea to do that?</p>
<p>Any other idea to do that?</p> Hi John,
I checked the websit…tag:www.grasshopper3d.com,2016-10-19:2985220:Comment:16215642016-10-19T17:52:04.917ZSaeedhttps://www.grasshopper3d.com/profile/Saeed390
<p>Hi John,</p>
<p>I checked the website, at the first glance it seems very handy, actually, that is what I need. But if I can not connect it to honeybee then I won't be able to use it!</p>
<p>I will work on it to see if there is a way to do that or not.</p>
<p>Thanks a lot for your suggestion and time. :)</p>
<p>Saeed</p>
<p>Hi John,</p>
<p>I checked the website, at the first glance it seems very handy, actually, that is what I need. But if I can not connect it to honeybee then I won't be able to use it!</p>
<p>I will work on it to see if there is a way to do that or not.</p>
<p>Thanks a lot for your suggestion and time. :)</p>
<p>Saeed</p> Hi Theodore,
Thanks a lot for…tag:www.grasshopper3d.com,2016-10-19:2985220:Comment:16215602016-10-19T17:47:27.873ZSaeedhttps://www.grasshopper3d.com/profile/Saeed390
<p>Hi Theodore,</p>
<p>Thanks a lot for your comment and time.</p>
<p>Because I have many variables, I think I need to use evolutionary algorithms; it is kind of impossible to consider all possible design combinations of the search space. I checked also DesignExplorer, that also doesn't work for my project.</p>
<p>I will work on it in the next days and will let you know when I had a progress. :)</p>
<p>Thanks again for your time.</p>
<p>Saeed</p>
<p></p>
<p>Hi Theodore,</p>
<p>Thanks a lot for your comment and time.</p>
<p>Because I have many variables, I think I need to use evolutionary algorithms; it is kind of impossible to consider all possible design combinations of the search space. I checked also DesignExplorer, that also doesn't work for my project.</p>
<p>I will work on it in the next days and will let you know when I had a progress. :)</p>
<p>Thanks again for your time.</p>
<p>Saeed</p>
<p></p> Well, you can always wrap the…tag:www.grasshopper3d.com,2016-10-19:2985220:Comment:16213542016-10-19T13:08:03.672ZMostapha Sadeghipour Roudsarihttps://www.grasshopper3d.com/profile/MostaphaSadeghipour
<p>Well, you can always wrap the optimization code in a python script and execute it from inside Grasshopper (IronPython). Something like, run the analysis for a generation, push the data to the optimization algorithm, get the next generation and run it inside Grasshopper, and so on. The other option is to set-up the parameters from inside a python script and then use Grasshopper/Honeybee for running the analysis. …</p>
<p>Well, you can always wrap the optimization code in a python script and execute it from inside Grasshopper (IronPython). Something like, run the analysis for a generation, push the data to the optimization algorithm, get the next generation and run it inside Grasshopper, and so on. The other option is to set-up the parameters from inside a python script and then use Grasshopper/Honeybee for running the analysis. <a href="http://www.grasshopper3d.com/profiles/blogs/matlab-grasshopper" target="_blank">Here is a very old post</a> on how to do it with Matlab. You can create a similar workflow from inside a Python script. </p> As far as I can recall, DEAP…tag:www.grasshopper3d.com,2016-10-19:2985220:Comment:16209682016-10-19T07:48:44.913ZAnders Holden Deleuranhttps://www.grasshopper3d.com/profile/AndersHoldenDeleuran
<p>As far as I can recall, DEAP depends on Numpy on the backend. This means that you'll likely have a real <a href="http://www.grasshopper3d.com/forum/topics/install-numerical-python-in-rhino-python?commentId=2985220%3AComment%3A1616466" target="_blank">hard time</a> getting it running in Rhino/Grasshopper. </p>
<p>As far as I can recall, DEAP depends on Numpy on the backend. This means that you'll likely have a real <a href="http://www.grasshopper3d.com/forum/topics/install-numerical-python-in-rhino-python?commentId=2985220%3AComment%3A1616466" target="_blank">hard time</a> getting it running in Rhino/Grasshopper. </p> I've also been trying to use…tag:www.grasshopper3d.com,2016-10-19:2985220:Comment:16209642016-10-19T07:42:06.643ZJohn Sullivanhttps://www.grasshopper3d.com/profile/JohnSullivan
<p>I've also been trying to use custom optimization tools such as DEAP - Distributed Evolutionary Algorithms in Python</p>
<p><a href="https://github.com/DEAP/deap" target="_blank">https://github.com/DEAP/deap</a></p>
<p></p>
<p>But have not been able to make it link with grasshopper so far :-/</p>
<p>I've also been trying to use custom optimization tools such as DEAP - Distributed Evolutionary Algorithms in Python</p>
<p><a href="https://github.com/DEAP/deap" target="_blank">https://github.com/DEAP/deap</a></p>
<p></p>
<p>But have not been able to make it link with grasshopper so far :-/</p> Hi Saeed,
I have never done…tag:www.grasshopper3d.com,2016-10-19:2985220:Comment:16212292016-10-19T05:40:29.036ZTheodoros Galanoshttps://www.grasshopper3d.com/profile/TheodorosGalanos
<p>Hi Saeed,</p>
<p></p>
<p>I have never done this myself but I can offer my thoughts on this.</p>
<p></p>
<p>The way I see it there are two optimization workflows. One has to do with an automated optimization of alternative scenarios through usually evolutionary algorithms like Galapagos or Octopus. The other has to do with a kind of brute force technique that goes through ALL possible design iterations and produces results for each one.</p>
<p></p>
<p>It might sound weird, but it seems to me…</p>
<p>Hi Saeed,</p>
<p></p>
<p>I have never done this myself but I can offer my thoughts on this.</p>
<p></p>
<p>The way I see it there are two optimization workflows. One has to do with an automated optimization of alternative scenarios through usually evolutionary algorithms like Galapagos or Octopus. The other has to do with a kind of brute force technique that goes through ALL possible design iterations and produces results for each one.</p>
<p></p>
<p>It might sound weird, but it seems to me that the evolutionary optimization techniques are better suited for later stages of development where most of the variables have been semi-locked in and the program can be allowed to show us the best alternative. But used during early design it kind of turns the whole design improvement process into a black-box which doesn't seem right to me. Maybe other users have comments on this.</p>
<p></p>
<p>In terms of time I do believe that both techniques have similar demands, although evolutionary techniques might arrive to an end result faster due to the selection process. Setting up the second method also takes a bit more time in order to create the GH structure that saves and stores results for each iteration.</p>
<p></p>
<p>The advantage of the second technique is that it enables you to browse through all results and make conscious decisions based on several different parameters and parameter ranges (which very often change during design). To do that you can use TT's DesignExplorer utility which Mostapha also worked on (<a rel="nofollow" href="http://tt-acm.github.io/DesignExplorer/" target="_blank">http://tt-acm.github.io/DesignExplorer/</a>). In practical cases this is invaluable, because it is something you can show to a project team and work with them to improve the design. The second advantage of this method is that you don't actually need to create your algorithm :)</p>
<p></p>
<p>But be careful! The number and range of the parameters will exponentially increase the time required. Although this is an issue with both methods.Thankfully the Fly! component in HB, which is used to run all iterations, will inform you of that before you run. Try searching the forum for keywords that apply to this and you can find a few definitions shared.</p>
<p></p>
<p>Hope this helps! Good luck in your study! Let us know how it goes.</p>
<p></p>
<p>Kind regards,</p>
<p>Theodore.</p>