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

是什么原因移除Popuplation,setChrom方法? #130

Closed
rhl713 opened this issue Jun 30, 2020 · 2 comments
Closed

是什么原因移除Popuplation,setChrom方法? #130

rhl713 opened this issue Jun 30, 2020 · 2 comments

Comments

@rhl713
Copy link

rhl713 commented Jun 30, 2020

如题,目前只看到将初始化种群放在算法模板这一处改变。
我在做一个大规模的VRP问题,配送点会超过5000点,随机初始化的种群根本不能完成任务。即使更新2.5版本,目前我还是使用setChrom,在mian进行初始化。

@geatpy-dev
Copy link
Owner

@rhl713 您好呀!感谢您的问题。情况大概是这样:前面版本的Population.setChrom()函数,有部分编程水平不是很高的用户反映使用不便,比如种群有100个个体,但先验知识里面的染色体只有一两条的情况,同时这些用户经常忘记在调用setChrom()后对种群的其他参数进行及时的更新。

于是后面就删除了setChrom(),引入了一个更为简便的“先知种群”的设置方法,即把先验知识存储到一个“先知种群”对象里面,然后直接传给算法模板的run()函数即可。详见soea_demo10。
image

@rhl713
Copy link
Author

rhl713 commented Jun 30, 2020

好的,非常感谢。
另外,PsyPopulation里面有几个异常输出应该漏了格式化 i。
‘error in PsyPopulation: Chrom[i] is None. (种群染色体矩阵未初始化。)'

@rhl713 rhl713 closed this as completed Jun 30, 2020
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