Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSO算法 #2

Open
longtimenoseeyou opened this issue Jun 26, 2022 · 2 comments
Open

PSO算法 #2

longtimenoseeyou opened this issue Jun 26, 2022 · 2 comments

Comments

@longtimenoseeyou
Copy link

你好,博主。我尝试运行你的pso算法,发现会出现500次迭代并不能收敛的情况,以及有时可以实现收敛,却不能达到你最优平均解11791的情况。请问一下,是需要调节哪些参数吗?

@roadwide
Copy link
Owner

self.groupSize=500 #鸟的个数、粒子个数
self.addrSize=48 #位置的维度,也就是TSP城市数量
self.w=0.25 #w为惯性系数,也就是保留上次速度的程度
self.pChange=0.1 #变异系数pChange
self.pReverse=0.1 #贪婪倒立变异概率

以上参数可以调节。另外,程序是具有随机性的,并不是每次结果都一样,不一定每次都收敛到最优。

@longtimenoseeyou
Copy link
Author

好的,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants