My PSO codes gives different results after each run
6 次查看(过去 30 天)
显示 更早的评论
I have developed a PSO code for 4 variables (maximization problem). Now when I run the code, each time the results shows different values. i,e, for 10 different runs, the code gives 10 different gbest values.Is it normal? How to select the optimum value as the answer?
0 个评论
采纳的回答
Walter Roberson
2017-5-18
That is typical. PSO tends to use random numbers to create the population. If you do not reset the random number seed between runs, then you will get different answers.
Selecting the best one is slightly complicated if you have constraints, as the one that at first looks to be the lowest value might have more constraint violation than another that looks worse. For this reason, you might want to take all 10 partial solutions and use them as initial population members and run the PSO for one cycle, and take the result that the PSO considers best out of all of them (presuming the PSO measures constraint violation in determining which is best.)
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Particle Swarm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!