I’m trying to use the goal CurveCollide in conjunction with Galapagos. To be more specific, I have multiple curves (circles and rectangles (polylines) with a center point) on a plane and I want to minimize the distance of certain pairs of center points without any overlap between the curves.
To better illustrate the problem, I have attached a file which is split into two parts. The first is labeled “Kangaroo Solver and Grab”. Any of the curves can be grabbed and moved around. I use the output of the Kangaroo Solver to get the center points of all the curves, create lines between the ones I’m interested in and calculate the total length. I want to use this value as the fitness parameter for Galapagos.
The second part is labelled “Kangaroo Zombie Solver and Galapagos”. It consists of the same curves (two circles and two rectangles). The genes are the X and Y coordinates of the center points and additionally the rectangles can also be rotated. The idea is that the curves, which are created based on the genes, are altered using CurveCollide so there is no overlap between them and using the altered curves to calculate the fitness parameter as described above.
Unfortunately, the implementation of Kangaroo doesn’t work as intended and a lot of the solutions are still infeasible, i.e. the curves overlap. Furthermore, I was struggling to obtain the output curves which are being used to calculate the fitness parameter. I ended up putting together a C# component based on the CustomIteration file on Daniel Piker’s GitHub repository.
The main question for me is, if the approach using Kangaroo can even work and if so, how? I also tried penalizing the fitness parameter if there is any overlap. This worked to some extent but created a lot of infeasible solutions.
Kangaroo_CurveCollide_Galapagos.gh (35.7 KB)