My PSO codes gives different results after each run

16 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Walter Roberson
Walter Roberson il 18 Mag 2017
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.)

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by