You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No artists with labels found to put in legend. Note that artists whose label start with an underscore are ignored when legend() is called with no argument.
I also meet this proble
UserWarning: No artists with labels found to put in legend. Note that artists whose label start with an underscore are ignored when legend() is called with no argument.
plt.legend()
problem = ea.Problem(name='moea quick start',
M=3,
maxormins=[-1,1,1],
Dim=6,
varTypes=[0]*6,# 初始化varTypes(决策变量的类型,0:实数;1:整数)
lb=[0.04,0.075,0.11,100000,100000,100000],
ub=[0.15]*3+[1000000,700000,400000],
evalVars=objective
)
构建算法
Field = ea.crtfld('RI', problem.varTypes, problem.ranges,problem.borders) # 创建区域描述器
algorithm = ea.moea_NSGA2_templet(
problem,
ea.Population(Encoding='RI',Field=Field ,NIND=100),
MAXGEN=500, # 最大进化代数
logTras=20) # 表示每隔多少代记录一次日志信息,0表示不记录
algorithm.mutOper.Pm = 0.5 # 修改变异算子的变异概率
algorithm.recOper.XOVR = 0.9 # 修改交叉算子的交叉概率
求解
res = ea.optimize(algorithm,
#prophet=ini,
verbose=True,#是否打印详细优化信息过程
drawing=1,#是否画优化过程图
outputMsg=True,#参数控制是否在优化完成后输出最终的结果信息
drawLog=True,#参数控制是否绘制优化过程中的日志或记录
saveFlag=False)#参数控制是否将优化结果保存到文件中
The text was updated successfully, but these errors were encountered: