geatpy-dev / geatpy

Evolutionary algorithm toolbox and framework with high performance for Python
http://www.geatpy.com
GNU Lesser General Public License v3.0
2.02k stars 726 forks source link

KeyError: 'gd',试图打印帕累托解的相关数值时出错 #197

Closed cliff0149 closed 3 years ago

cliff0149 commented 3 years ago

Describe the bug 我在给出的多目标demo中加入了:
if myAlgorithm.log is not None and NDSet.sizes != 0: print('GD', myAlgorithm.log['gd'][-1]) 语句,然后报错:Traceback (most recent call last): File "D:/Downloads/geatpy-master/geatpy-master/geatpy/demo/moea_demo/moea_demo2/main.py", line 30, in print('GD', myAlgorithm.log['gd'][-1]) KeyError: 'gd' 因为原demo只能看帕累托解的个数,而我想看看其他指标如IGD,HV等等,就照着文档里的demo加了上述语句,结果报了错,请问这是为什么?

geatpy-dev commented 3 years ago

这是因为你跑的那个模型没有给出理论最优解。不能去计算GD和IGD。

cliff0149 commented 3 years ago

好的明白了谢谢