How to automate the optimization process?
It would be helpful for someone
- Who already knows how to set up optimization
- Who has plenty of objects to optimize with an identical template but in the scarce amount of human resource
Benefit
- As this process minimizes the manual operation, it can diminish the takt time.
- So the story changes from "How many human resources you have" to "How many computers you have".
Summary
In this article, I will focus on the methodology on how to automate the optimization process in grasshopper when there are multiple objects and they comply with the identical optimization template.Main
During the time I served as facade consultant, there was a project which aimed to optimize several objects with identical optimization template. At the time, the main platform was CATIA(from Dassault System). Thanks to its special structure which is called Geometrical set, CATIA was eligible for the scenario; put optimizer and trigger in each Geometrical set under consecutive objects.After the project was finished, I wonder "Is the same scenario is possible in Rhino and Grasshopper?" If so, it can give the clue that David can defeat Goliath. Keep in mind that Rhino and Grasshopper cost only $995 and never require a maintenance fee. On the other hand, CATIA - now integrated into the 3DEXPERIENCE platform- costs you more than 10 folds of that of Rhino and Grasshopper.
Rhino pricing(From Rhino official web page) |
CATIA pricing (image from web search) |
On my journey, I bumped into Octopus(One of the third-party optimizer). And from the example they provide, I could find the key.
Galapagos typical flow. Notice that Galapagos itself need to be activated by manual control. |
The point is by combining Anemone(Plug-in specialized for looping) and components included in Octopus and related to the genetic algorithm, it does the work without manual operation. My starting point was "Would it be possible to do the optimization work by having a loop in loop which outer loop provides the index of item and inner does the optimization?". I made an arduous journey for myself.
Long story short, it worked. But it stops after around 1000 iteration. Some of you think that 1000 iteration is huge enough. However, in this project, although the 1000 iteration is enough for one object, as there are a number of objects(here 80) the total number of iteration becomes 1000*n.
Bye-bye, said I to my work. There was no other way. Another rigorous test started. And thankfully, the way was in Octopus again. It can be a digression but octopus has been developed itself for a long time and added some explicit components. In a nutshell, it has a conventional optimizer and a set of new components that are based on SVM(Support Vector Machine), ANN(Artificial Neural Network), etc.
The new components complied with my criteria which are
- It can be activated without a double click.
- it can go through multiple objects.
Key components |
Consecutively, they are in Octopus, Treesloth, native grasshopper components. Here is how it works. On some of the components which have "Run" as input, they usually activated by changing numbers. That means even though your input for the "Run" is not "True" but random number except for "0" it is activated. As a result, if you connected the number slider to the index of the object, more specifically to the "List item" component and Optimizer concurrently, then the optimization and selection of an item will be done at the same time.
And I set the story to export the optimized parameters and then import it after all the work is done, components for the exporting and importing is also crucial. If you don't want to use a third-party plug-in for this process, there is another option which is using python or c-sharp so that you export parameters corresponding to objects one by one via CSV and import again. Here I used "Unpack / Pack" components included in Treesloth. Simply it was based on the fact that I misunderstood those are native.
Original grasshopper code. |
The required time for optimization will depend on a range of factors from computer speed as such to the modeling process setting that each one defines.
After the optimization is done, the final step is to import the parameters and see the result. I'm not sure about it but some people call it phenomena for the result.
exported parameters. It is saved as *.dat. |
Final step. Import parameters and review the result. |
But the general process is as explained above. I hope your comments about this; not only the technical aspect but also the linguistic. And for Korean people. I'll post the Korean version later.
댓글
댓글 쓰기