CEC2017(Python):蜣螂优化算法DBO求解CEC2017

一、CEC2017简介

参考文献:

1\]Awad, N. H., Ali, M. Z., Liang, J. J., Qu, B. Y., \& Suganthan, P. N. (2016). "**Problem definitions and evaluation criteria for the CEC2017 special session and competition on single objective real-parameter numerical optimization**," Technical Report. Nanyang Technological University, Singapore. ### 二、蜣螂优化算法DBO求解CEC2017 #### (1)部分Python代码 ``` from DBO import DBO import matplotlib.pyplot as plt import numpy as np import cec2017.functions as functions #主程序 function_name =6 #测试函数 1-29 SearchAgents_no = 50#种群大小 Max_iter = 100#最大迭代次数 dim=30;#维度只能是 10/30/50/100 lb = -100*np.ones(dim)#下界 ub = 100*np.ones(dim)#上界 fobj= functions.all_functions[function_name-1] BestX,BestF,curve = DBO(SearchAgents_no, Max_iter,lb,ub,dim,fobj)#问题求解 #画收敛曲线图 if BestF>0:     plt.semilogy(curve,color='r',linewidth=3,label='DBO') else:     plt.plot(curve,color='r',linewidth=3,label='DBO') plt.xlabel("Iteration") plt.ylabel("Fitness") plt.xlim(0,Max_iter) plt.title("CEC2017-F"+str(function_name)) plt.legend() plt.savefig(str(function_name)+'.png') plt.show() print('\nThe best solution is:\n'+str(BestX)) print('\nThe best optimal value of the objective funciton is:\n'+str(BestF)) ``` ![](https://file.jishuzhan.net/article/1742781654738407425/4dbe241e41cc1528b2c09a8a99321cd0.webp) #### (2)部分结果 ![](https://file.jishuzhan.net/article/1742781654738407425/c8f817a689c96e414d20723ce577b038.webp) ![](https://file.jishuzhan.net/article/1742781654738407425/096da7e8a8f647dbf1a34780d62d300a.webp) ![](https://file.jishuzhan.net/article/1742781654738407425/136f9f4545714471be1e5e4d5b9f66d4.webp) ![](https://file.jishuzhan.net/article/1742781654738407425/7b48e5bd60c921b1172bab97453b52a9.webp) ![](https://file.jishuzhan.net/article/1742781654738407425/04fc43dfec5f74dd8b9a5f1af6b7a6f8.webp) ![](https://file.jishuzhan.net/article/1742781654738407425/de5b7d23cdb2589f8a25a3672b67c425.webp) ### 三、完整Python代码 ![](https://file.jishuzhan.net/article/1742781654738407425/d8ce3a5879549189d1a3490e96fc4590.webp)

相关推荐
Vaclee12 分钟前
JVM超详解
开发语言·jvm
m0_64880493_江哥15 分钟前
Python实现随机选播视频的示例代码
前端·python·音视频
Ialand~20 分钟前
深度解析 Rust 的数据结构:标准库与社区生态
开发语言·数据结构·rust
Lester_110130 分钟前
嵌入式学习笔记 - 用泰勒公式解决 tanh函数
笔记·学习·算法
sunshine~~~39 分钟前
【笔记】macOs arm架构安装虚拟机Ubuntu环境:ROS2 + Python开发
arm开发·笔记·python·macos·ros2
在坚持一下我可没意见42 分钟前
Java 网络编程:TCP 与 UDP 的「通信江湖」(基于TCP回显服务器)
java·服务器·开发语言·笔记·tcp/ip·udp·java-ee
杜子不疼.1 小时前
【Rust】异步处理器(Handler)实现:从 Future 本质到 axum 实战
android·开发语言·rust
学习编程之路1 小时前
Rust内存对齐与缓存友好设计深度解析
开发语言·缓存·rust
无限进步_1 小时前
C语言字符串连接实现详解:掌握自定义strcat函数
c语言·开发语言·c++·后端·算法·visual studio