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

为什么最优解找出来了,但是图却画不出出来 #373

Open
wangzihao1234567 opened this issue Jul 27, 2024 · 2 comments
Open

Comments

@wangzihao1234567
Copy link

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)#参数控制是否将优化结果保存到文件中
Uploading Snipaste_2024-07-27_22-31-35.png…

@wangzihao1234567
Copy link
Author

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.

@wnsmiling
Copy link

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()

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