pymoo
pymoo copied to clipboard
Relaunch a simulation if it didn't run
I am using pymoo to find the optimal parameters for a datamatchin problem. In other words, I have a black box simulator getting parameters X as input, and returning values Y_pred as output, which need to match some ground truth experimental values Y. I cast this as an optimization problem, where
results['F'] = [np.mean(Y-Y_pred**2)]
The black box simulator is resource-intensive, so I use parallel computing. For various reasons, sometimes a simulation, ran with subprocess may time out even if it wasn't actually run, or if the run wasn't completed. In case of timeout, I'm able to catch the sp.TimeoutExpired exception.
- Is it possible to tell
pymooto skip an individual? - If not, is it possible to retry the same individual once?
I don't want to assign the run a large penalty, e.g., results['F'] = 99999, because I'm not sure if the candidate was bad or not. In some cases, it may be possible that the simulation didn't run at all.
What about simply using a try...catch.. in the problem evaluation?
you can in the catch part set your objective value to a large value or also implementy a retry strategy.