Stop fmincon and continue routine.
10 views (last 30 days)
Show older comments
Hello. Thanks in advance for your help.
I am solving certain problem by using a genetic algorithm, after 'x' iterations i try to improve some chromosomes by calling a fmincon function, using a SQP solver. The problem is that sometimes the SQP gets stuck and i do not know the reason (i am guessing that it can be a problem while computing the hessian or something like that, when i press ctrl -c matlab always says that the operation has been terminated In fmincon (line 910) [X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] = sqpLineSearch(funfcn,X,full(A),full(B),full(Aeq),full(Beq), ...).
Ok, what i want to di is to stop the search after some time; but i do want the algorithm to continue with the next chromosome (something like break in a for loop or a return in a 'while'), i.e, i do not want to stop and lose the results of the whole simulations (Genetic Algorithm and some SQP's).
I tried 'return' and it still gets stuck, 'break' is not possible outside a for, when i use a timer and put an error message, the simulation stops and i lose the simulations results.
Any help will be appreciated. Thanks.
0 Comments
See Also
Categories
Find more on Genetic Algorithm in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!