algorithmic modeling for Rhino
Hi !
I am trying to use Galapagos to cycle through a finite number of cases which represent numeric inputs.
The "heart" of the definition is a proxie for a much-much more complicated algorithm which was designed to get a discreet number of inputs, but can not process data trees.
Galapagos does indeed find the case number which gives the "max" (in this case) target value, but keeps cycling wildly although here, there are only 11 possible gene pools since there is just one gene with 11 integer values.
Is there a way to trick Galapagos into cycling only once ?
I guess I could use "Loop" tools instead, but I thought that this could be a quick solution to my problem.
Cheers,
Tags:
Olivier,
You are trying to get the slider value which is as close to the target value plugged in the fitness?
-Luis
Hi ! all,
To Luis : Yes :)
To Miguel :
the example is somewhat misleading because I included components who actually find the solution.
But let's suppose this can't be done by any other way than cycling manualy through the 11 cases and taking note of the result in each case, and then finding the case which yields the largest value...
Hi Luis,
We have huge definitions to check steel elements against EC3, the European construction code for steel.
Today, our definition was designed to accomodate a single load case which is comprised of :
-Axial load
-Bending Y
-Bending Z
-Torque
-Shear Y
-Shear Z
The problem is that it is very difficult to know, amongst the many load cases which one is going to produce the lowest safety factor on the steel element.
If the definition had been designed to accept a data tree as input, and not only discreet values, there would be no issue (or maybe just a long waiting time for GH to process all the cases).
What I am trying to do is to calculate the safety factor for each load case one by one through my existing definition, and find out which load case is the most un-favorable for my steel element.
I'm looking into Anemone right now, but I can't seem to be able to do simply what Galapagos does.
Cheers,
How many cases are we talking about? I still don't think you need to resort to looping or Galapagos. If I am understanding correctly, each load case, instead of being one number, is a branch on a tree with items related to the loads and bending you list. You have another list with known profiles, and their properties. Is the result you are after the profile which is safely above, but closest to the load case? If you can provide some sample data, I think we can work it out through other means which will be both faster and more compatible with your workflow (IMHO).
...not exactly.
This is meant to be just a checking algorithm, not an optimization alorithm.
The section and length of the element is defined, and then checked against a certain loading.
You have to believe me Luis, it would be a real nightmare to make the check work with a tree as inputs rather than discreet values.
I will send you the beast if you want to see for yourself.
This leaves a question : why does Galapagos seem to cycle wildly when the genes are based on a single integer slider ?
Cheers,
Galapagos needs some sort of way to know when to stop. You configure this with the Options panel. Even though there are 11 options, Galapagos will try all of them over and over and over depending on the Options. For example, if we look at the default settings in this order:
Population: Number of iterations / generation 50 - Galapagos tries 50 slider positions each generation. When it finishes 50, it looks at the results and takes from the best results based on your fitness.
Initial Boost: Factor for the first generation 2. You want to ensure Galapagos sees as much of the solution space as possible in order to not miss any potential solutions. The first generation is multiplied by this factor. If Population is 50, the first generation will be 50x2 = 100 slider positions.
Maintain and Inbreeding deal with what you keep between Generations.
Max Stagnant: Number of generations to try AFTER finding a better solution 50. If Galapagos finds a great solution in Generation 2 (Gen 0 = 100 tries, Gen 1 = 50 tries, Gen 2 = 50 tries) it will go another 50 Generations (50x50 tries) before it stops to ensure it did not miss anything.
Your solution space consists of 11 options, which is much less than any of the other parameters are suggesting. Galapagos flails wildly in your case because you told it to. You told it to try 50x50(+50 for initial boost) number of times to find the best value.
Hence why I do not think this is the best option. You said it, this is not an optimization problem. If it is not an optimization problem, why use a genetic algorithm solver which is predominantly used for optimizing parameters?
I wouldn't necessarily want to see the definition, I'm more curious about the data. For example, can you send the data for 10 structural members and some load cases? (again, I could be entirely oversimplifying it).
In any case, I changed Max. Stagnant to 5, Population to 11. So Galapagos will stop (5x11)+11 tries AFTER the best solution is found. It found the solution pretty quickly.
Luis, Eurocodes are tough enough already.
Running a tree through the algorithm instead of discreet values would be a real nightmare...
Thanks for the explanation on Galapagos.
I understand that it was not designed to solve such a "dumb" optimization scheme ; I just hoped I could hack it to do the job nonetheless and carry on to other more interesting subjects...
Cheers,
Hi Olivier,
You could set max.stagnation and population to your case numbers?
Igor
Hi Igor !
Thanks a lot ; I tried changing these values but turned back when I saw that the boxes turned orange or red.
I must admit that I didn't understand exactly what these settings meant.
The only problem now is that I need to fiddle in the Galapagos interface each time I need to change the population count...
Cheers,
"The only problem now is that I need to fiddle in the Galapagos interface each time I need to change the population count..."
Yes, that is not good. If you set your population to number of cases it should work. Beacuse Galapagos sends 11 cases to be tested.
cheers
I believe you do not need Galapagos for what you are trying to do.
What I do not understand is that you already have the optimum value as "Largest Target Value", Galapagos in this simple case is not of any help.
What do you really need? the slider to represent the best index?
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson.
Powered by