Packing Objects with Galapagos
After the starting point of the Galapagos, there came another attempt to utilize this beautiful addition of David Rutten. This time, I worked over the night to tell it what I want. The aim was (or seemed to be) simple at first sight. I wanted several shapes (not one) to fit into an area, as smallest as possible, without overlaps. This is packing objects. A bounding box and area components quickly gave me the first fitness value. The area of the bounding rectangle should be as small as possible. That is a sentence I think Galapagos could easily understand.
However, when I came to the other sentence, that is “without overlaps” that was the big question. My partial solution was to identify the total area of the shapes and check it with the present “unified” area of the shape. I found no way to tell Grasshopper that one or several objects in a set overlap.
The third challenge of packing objects was to evaluate these two to create a single fitness number. As I cannot tell Galapagos that these objects should never collide, then the overlapping curve areas are multiplied by 20. Also, I divided the total size of the bounding rectangle by 10 to decrease its effectiveness. Then, these two numbers are added together to create Galapagos fitness value. The funny thing is to see it actually working. Whenever it creates an overlap, it suddenly draws back. I felt I’d terrified Galapagos. It tries to decrease the total bounding area carefully, without overlapping.
Although I’ve changed the Galapagos parameters, it cannot fully solve this problem. Maybe I’ve programmed it wrong but somehow it now seems to me a little out of the Galapagos’ context. Here is my working file, feel free to use and advance it;