Packing Objects with Galapagos

by Tuğrul Yazar | May 22, 2012 22:34

After the starting point of the Galapagos[1], 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.

packing objects

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;

[GHX: 0.8.0066]Download[2]
packing objects[3]
Endnotes:
  1. Galapagos: http://wiki.bk.tudelft.nl/toi-pedia/Galapagos_Optimization
  2. Download: https://www.designcoding.net/decoder/wp-content/uploads/2012/05/2012_05_22-packing.ghx
  3. [Image]: https://www.designcoding.net/decoder/wp-content/uploads/2012/05/2012_05_22-packing-def.jpg

Source URL: https://www.designcoding.net/packing-objects-with-galapagos/