pymoo icon indicating copy to clipboard operation
pymoo copied to clipboard

Handling crashes in PSO

Open oarcelus opened this issue 1 year ago • 1 comments

I am trying to implement a PSO for a model. Sometimes, depending on the combination of input parameters, the model crashes and returns None. How should I handle this case with pymoo? Maybe postprocessing the _evaluate function to give a default value to those cases that crashed?

oarcelus avatar May 24 '24 06:05 oarcelus

Yes, I would sorround the third-party code with a try-catch and then set the objective to a large value (or introduce a inequality constraint to be 1 if failed and 0 if it succeeded. both will work)

blankjul avatar May 27 '24 16:05 blankjul