What is the output when Particle Swarm Optimization exceeds MaxTime

조회 수: 13 (최근 30일)
Paul Safier
Paul Safier 2022년 11월 14일
댓글: Paul Safier 2022년 11월 15일
I ran the following PSO code and the MaxTime was exceeded. The code spit out a result, but I don't know: Is it the best solution so far? Is it the one that was currently being solved when the time ran out? Is it the last completed function evaluation?
SwarmSize = 500;
FunctionTolerance = 0.001;
MaxIterations = 500;
MaxTime = 57600; % seconds
options = optimoptions("particleswarm","UseParallel",true,'SwarmSize',SwarmSize,'InitialSwarmMatrix',InitialSwarmMatrix,'Display','iter','FunctionTolerance',FunctionTolerance,'MaxIterations',MaxIterations,'MaxTime',MaxTime);
dwellT = particleswarm(@(dwellT) condToEdge_fnc(dwellT),numZones,lb,ub,options)
Optimization ended: the total optimization time in seconds exceeded OPTIONS.MaxTime.
dwellT =
0.9026 0.9199 0.8728 0.9822 1.0000 0.8732 0.9660 0.8537 0.8557 0.8841

채택된 답변

Alan Weiss
Alan Weiss 2022년 11월 15일
I believe that the code returns the point giving the best (lowest) objective function value encountered.
Alan Weiss
MATLAB mathematical toolbox documentation

추가 답변 (0개)

카테고리

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

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by