(Trying to) use Galapagos solver in Grasshopper to generate a 5-degree, single span, 6 control vertices NURBS curve that has a few specified properties that are used in the fitness function. Attached is a screen shot that gives an overview of a result so far. The curve is shown in the screen shot (to the side of the fitness landscape) with the 6 CV’s numbered (note, there is a very small (specified) gap between CV 0 and CV 5; it is an open curve). I think I have the fitness landscape (mesh) shown as best as I can figure out how to do it, and I highlighted a few items of interest:
1st solution - purple dot;
the last solution in the list (which is actually a copy of the best solution and has been added to end of list) - the cyan dot, and
the best solution (yellow dot) where it fell in the landscape,
as well as highlighting the “best” several solutions which (in this case) have fitness values less than 15.
The “genomes” are comprised of 4 inputs: x and y positions each for CV1 and of CV2.
Note, CV0 and CV5 are fixed. CV3 and 4 are mirrored from CV2 and 1.
The fitness function here needs to be minimized - 0.0 would be a perfect solution. That meant the reciprocals of the fitness values are fed to the fitness landscape component.
2 questions at the top of my list are:
Is there a process that will result in smaller residual errors in the fitness function components? Not sure why I can’t get the fitness value to get much closer to 0? The input sliders are maxed out at 6 decimal places; is that an underlying cause? Some fitness parameters seem to stop getting better with remaining errors on the order of 1e-3 or 1e-4 of the desired value and I would like to get to 1e-6 or better on all of them. I suspect that the answer revolves around the fitness function. Maybe my fitness function does not yet generate the right amount of pressure. I tried earlier using various exponents (whole numbers and fractions) in the fitness function, but using relative weights seemed to work better. But, looking for some guidance.
The fitness landscape is very spiky, with several nearly equal solutions implied. My manual experimentation seemed to find only 2 general solutions, one where the CVs are what is shown in the screen shot and a second solution where CVs 2&3 are spread further apart but still forward of the leading edge, and with CVs 1&4 located aft of the maximum width of the shape. I do not know if that solution is captured within the fitness landscape shown here, or not; some more investigation is needed. But, could it be that some of those landscape spikes are actually nearby “parts” of the primary solution, just developed at a different time in the process? I just fed the fitness value list (after taking the reciprocal and scaling to get the max value equal to 1.0) into the landscape component. Is there a recommnded way to pre-process the fitness value list? Seems like there could be some sorting done to get similar genes close together, but nothing I tried has panned out yet.
I experimented some more trying to understand how the fitness landscape function works and can be used. I have not found much information about how to use this component, so mostly trial and error. But, I think I am running into a resolution limit due to int32 data type that the genome uses. Apparently, the sliders are mapped to int32 type data used by the genomes, which has an overall range of about 4e6. Possibly not quite enough resolution in my case to truly find and map the optimum peaks. I suppose I can drop the slider ranges down some, but that runs the risk of missing the optimum point all together. Another related mystery is that the sliders are set up to output 6 decimal places, but the genomes record only 4 decimal places. Maybe a recorder component issue - something else to look into? Anyway, I seem to be dropping some needed bits somewhere.
The fitness landscape shows lots of peaks, implying lots of potential “optimum” solutions. But, looking into some of these optimum peaks spread out across the whole landscape, several look to be associated with the same genome (i.e., the same x-y positions), so this seems to imply the optimum solution peaks are distributed in time throughout the landscape as the solver maybe approaches a given optimum multiple times from different directions at different times in the process. So, is there a way to rearrange the landscape to co-locate the peaks associated with the same genome (CV position), maybe by sorting on the genes somehow? This might even be made easier by having the truncated gene values.
I sorted the fitness landscape peaks, selected the highest peaks and pulled out the CV positions at those highest peaks. The points are in virtually the same location (within ~0.02%) for all the selected fitness landscape peaks. This confirmed the highest 1+% of the fitness landscape peaks are really the same optimum solution (the optimum CV locations), just found (or rediscovered) at different times from different directions in the optimization process. Next, I would like to find the 2nd optimum solution, which I think is buried in the landscape somewhere. Maybe there are more, but I am pretty sure this curve has at least 2.
And, I need to figure out a way around the numeric (im)precision issue to be able to get each of the fitness function errors down within desired tolerances.
This approach seems as though it can work. By experimenting with various forms for the fitness function, my tolerances can be met for the major parameters of length, thickness, position of max thickness. The L.E. radius and the curvature at the trailing edge are close, but not within my desired tolerance. Maybe too many constraints and/or not enough CV’s with current approach.