How to force ga and particleswarm to stop ONLY on max iterations reached

조회 수: 2 (최근 30일)
ga and particleswarm has a few stopping conditions I don't want it to stop running once tolerance is met, but continue for max iterations. Tried to do this by setting TolFun to 0 but doesn't work.
options = optimoptions('particleswarm','OutputFcns',@mypsoutputfun, 'MaxIter',MaxGeneration_fun,'SwarmSize',n_pop_ps,'Display','none','StallTimeLimit', 1,'TolFun', 0)

채택된 답변

Walter Roberson
Walter Roberson 2015년 9월 4일
I would suggest an experiment of setting the stall limit fairly high. You could try inf but that might not be accepted. Memory might be allocated for holding this many values so you might not be able to get too wild.
  댓글 수: 2
JMP Phillips
JMP Phillips 2015년 9월 4일
편집: JMP Phillips 2015년 9월 4일
For particle swarm found I have to set 'StallIterLimit' >= MaxIter which effectively guarantees tolerance stopping condition is never reached. Same for StallGenLimit in GA.
hemanth chaduvula
hemanth chaduvula 2020년 6월 16일
Dear sir
If I set 'StallIterLimit' >= MaxIter then it shows following error
"Matrix dimensions must agree". Please solve my issue.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Particle Swarm에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by