Multi-objective optimization with Honeybee: How to check that the definition is fully calculated?

This might a problem for @DavidRutten :wink::

I’m trying to optimize a multi-objective optimization problem involving energy analysis and photovoltaics in Honeybee, using my own component. It works well for a while, but after a couple of hundred simulations, my component receives only two objectives instead of three (i.e., the energy analysis has not been computed).

When I retest the parameters for the step when this happens, everything is fine and there are three objectives. Therefore, I suspect that the problem is with how I check that the definition is fully calculated (in combination with the way Honeybee runs EnergyPlus as an external process.)

This is the code I’m using (which seems to work fine for single-objective optimization):

while (_doc.SolutionState != GH_ProcessStep.PreProcess || _doc.SolutionDepth != 0) { }

        _doc.NewSolution(true);

        //Wait until the grasshopper solution in finished
        while (_doc.SolutionState != GH_ProcessStep.PostProcess || _doc.SolutionDepth != 0) { }

Any tips are appreciated! Thanks!

For what it’s worth, the solution is attempting the same simulation twice.
I’m not sure why it works, but it does :slight_smile:.