鸭嘴兽错误:未定义名称“Hypervolume”

2024-09-28 21:01:53 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用集成在Python的Platypus包中的NSGA 2来解决一个具有两个目标和两个决策变量的多目标优化问题。这是我查看超级卷的代码

from platypus.algorithms import NSGAII
from platypus.experimenter import experiment
from platypus.experimenter import calculate
from platypus import *

if __name__ == "__main__":
    algorithms = [NSGAII]
    problems = [Belegundu]

    # run the experiment
    results = experiment(algorithms, problems, nfe=10000, seeds=10)

    # calculate the hypervolume indicator
    hyp = Hypervolume(minimum=[0, 0, 0], maximum=[1, 1, 1])
    hyp_result = calculate(results, hyp)
    display(hyp_result, ndigits=3)

但是,我收到的错误是“未定义名称‘Hypervolume’”


Tags: thefromimport目标resultresultsexperimentcalculate