Grasshopper

algorithmic modeling for Rhino

Hello,

since I am not understanding whether this can be a bug in Galapagos or some other problem, I would like to address this topic here:

Firstly, what is my algorithm doing: it is generating different configurations of a given building area, means it is splitting the total area up to 2-4 buildings with 2-4 floors each. Then it is choosing the position of the buildings on the site and since they should not overlap, a loop is resolving the overlapping. Afterwards the energy demand is calculated for every zone (zone = 1 floor) and summed up to total building energy demand values for each configuration ´(another loop from Anemone). The last step is to calculate the life cycle perormance which is a third loop because this has to be done for each building separately.

This setting should undergo an optimization with Galapagos where the fitness value is the average value from the life cycle performance. But here comes the problem.

Before the fitness value is even calculated, Galapagos moves the sliders and a new configuration has to be evaluated. This leads to the "undefined" fitness values in the Galapagos results (see attached picture). It seems like Galapagos doesn`t give the algorithm enough time to calculate the results which it actually needs as the fitness.

Has anybody an idea how I could solve this problem? Is there any way to make Galapagos "wait" a bit longer? It is my masters thesis so it is very important for me to find a workaround.

Thanks!

   

Views: 1965

Replies to This Discussion

That is true, Galapagos does not know how to wait for a secondary process to complete before harvesting fitness values and moving on. If you want to use Galapagos in such a setting, you must find a way to delay the completion of the solution until all relevant data is calculated.

Ideally the component which performs the secondary calculation has a way to pause the GH solution while it's busy, but if you don't have access to the source code, that's not something you can change.

How many sliders do you have? I ask because for a small number of sliders there may be a reasonably easy way to use a custom algorithm to explore the problem space.

Thank you for replying David!

My algorithm is depending on 26 sliders and is very huge.

But I have access to the codes for every calculation used in my algorithm. How could I make GH (especially Galapagos) pause while another part of the algorithm is still working?

I already tried the time.sleep(5) approach with Python but it stopped the whole calculation which didn`t serve the problem solving.

I'm not even sure it is possible in your particular case, it depends on how secondary calculations are performed and eventually fed back into GH. What needs to happen is that the solution may not complete until all data is available.

What components are you using that perform calculations outside of the GH solution?

It is everything calculated within one algorithm. I didn`t use components outside of GH.

It seems that Galapagos is waiting for the first loop to complete which is solving the building overlap but when it comes to the energy analysis loop (only mathematics without any of the energy add-ons which are available) and the following life cycle performance loop it starts to ignore them or finish the energy loop partly. Last both loops take less than 5 seconds to finish the calculations.

How does Galapagos determine when it should move on since it is not waiting for the results for the fitness value?

I would understand if it would not recognize calculation results from outside components since they are not part of the GH algorithm, but I don`t understand how it can just ignore the last parts of one single flowing calculation?

Is there a way of blocking the sliders for Galapagos until the calculations are finished?

I just realised you mentioned Anemone in your original post. I'm pretty sure Anemone runs multiple solutions as part of how it accomplishes the loops. This confuses Galapagos as the completion of the first solution is its cue to start collecting fitness values. It doesn't realise that there's more iterations coming up that it should wait for.

I don't think there's a good solution for your problem, because the delay you want GP to wait for isn't happening outside of GH, the problem is that there are solutions/iterations within GH that GP needs to ignore. There's no mechanism available for doing this.

I see one potential way forward, which is to have a second file featuring duplicates of your sliders, a C# component, a single fitness output and the Galapagos object, and this file invokes the original file, relays all slider modifications and knows enough to wait until the original file is done before it completes itself. This is certainly not easy, and I'm not even really sure it will work because the problem still remains that the second file needs to wait on the first file, while running on the same thread. There are severe logistics issues with a setup like this.

The other potential way forward is to ditch Galapagos and switch to a completely custom algorithm which is smart enough to take the anemone stuff into account. However 26 sliders means you're dealing with a massive search space so you'll need to implement a searcher which does not suffer from the curse of dimensionality.

You *may* be able to get around this behavior of anemone by using the "Fast loop start" and "Fast Loop End" components instead of the normal ones - I believe this uses a different mechanism to calculate results that doesn't result in multiple solutions in GH. I could well be wrong though! 

That is a great idea!

I tried to replace the components to "Fast loop start" and "Fast Loop End" but these loops were extremely slow in comparison with the normal ones. I am not sure but it might be because it is recalculating the whole algorithm over and over again. This would be not necessary because only the last part counts for the calculation. Therefore I tried to insert a D0 value into the "Fast loop start" component but this didn`t help at all.

Hi Julia, did you ever get a solution to this?

Hi,

I'm facing a similar problem. I tried to simulate the outdoor wind environment with Butterfly and optimize the maximum value of the wind speed ratio(WSR) in construction area with Galapagos. However, It seems that Galapagos can't wait to finish all the steps of calculation. In most situations, an individual generated by Galapagos can be calculated its mesh, but its mesh won't get though the simulation process. Galapagos won't wait to simulate but carry on with wrong data even if the WSR output will be "Null". 

I wonder that if anyone give me some advice on this problem? Thanks very much.

Yi

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service