algorithmic modeling for Rhino
I wanna do some optimization in Honeybee. I tried Galapagos coupling with Honeybee. The problem is I need to automate a procedure which optimization is a part of it. But Galapagos has an editor and needs to be started manually, therefore it is not a good option for me. A friend of mine here suggested me to develop my own algorithm for my optimization. I want to know if anybody has done it before here. I do appreciate any suggestion and feedback.
Thanks a lot
Replies are closed for this discussion.
I have never done this myself but I can offer my thoughts on this.
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.
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.
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.
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 (http://tt-acm.github.io/DesignExplorer/). 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 :)
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.
Hope this helps! Good luck in your study! Let us know how it goes.
Thanks a lot for your comment and time.
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.
I will work on it in the next days and will let you know when I had a progress. :)
Thanks again for your time.
I've also been trying to use custom optimization tools such as DEAP - Distributed Evolutionary Algorithms in Python
But have not been able to make it link with grasshopper so far :-/
As far as I can recall, DEAP depends on Numpy on the backend. This means that you'll likely have a real hard time getting it running in Rhino/Grasshopper.
Any other idea to do that?
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!
I will work on it to see if there is a way to do that or not.
Thanks a lot for your suggestion and time. :)
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. Here is a very old post on how to do it with Matlab. You can create a similar workflow from inside a Python script.
Thanks for your comment.
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!