SyntaxError:解析(迭代)时出现意外的EOF

2024-05-29 09:34:38 发布

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

我在运行这部分代码时出错。尝试了一些现有的解决方案

import optimizers.GA as ga
import benchmarks
import csv
import numpy
import time
import warnings
import os
import plot_convergence as conv_plot
import plot_boxplot as box_plot
warnings.simplefilter(action="ignore")
def selector(algo, func_details, popSize, Iter):
    function_name = func_details[0]
    lb = func_details[1]
    ub = func_details[2]
    dim = func_details[3]
    if algo == "GA":
     x = ga.GA(getattr(benchmarks, function_name), lb, ub, dim, popSize, Iter)
    else:
        return null
    return x
def run(optimizer, objectivefunc, NumOfRuns, params, export_flags):

Tags: nameimportplotdefasfunctiondetailsfunc
1条回答
网友
1楼 · 发布于 2024-05-29 09:34:38

您尚未在函数run中写入任何内容。 试试这个:-

def run(optimizer, objectivefunc, NumOfRuns, params, export_flags):
    pass

相关问题 更多 >

    热门问题