nlopt
nlopt copied to clipboard
How to get the result when I halt nlopt gracefully by throw a ForcedStop exception in python?
try:
xopt = opt.optimize(x0)
except nlopt.ForcedStop as e:
print('Forced Stopped! But it will stop gracefully.')
Everything is fine. However, when exception occurs, xopt is lost.
My question is: how can i recover the optimal by now result xopt when a ForcedStop is thrown and handled.