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)

相关推荐
末央&1 分钟前
【C++】priority_queue的底层封装和实现
开发语言·c++
da-peng-song5 分钟前
python学习—详解word邮件合并
python·学习·word
Better Rose15 分钟前
【2025“华中杯”大学生数学建模挑战赛】C题:就业状态分析与预测 详细解题思路
c语言·开发语言·数学建模
明明跟你说过19 分钟前
深入浅出 NVIDIA CUDA 架构与并行计算技术
人工智能·pytorch·python·chatgpt·架构·tensorflow
天天扭码19 分钟前
一分钟吃透一道面试算法题——字母异位词分组(最优解)
前端·javascript·算法
网络安全研发随想21 分钟前
C语言核心结构+难点精讲+工程技巧
c语言·开发语言·算法
superior tigre34 分钟前
C++学习:六个月从基础到就业——面向对象编程:虚函数与抽象类
开发语言·c++·学习
ademen40 分钟前
关于 IntelliJ IDEA 中频繁出现的 Kotlin 及其核心作用
java·开发语言·kotlin
李煜鑫1 小时前
关于视频的一些算法内容,不包含代码等
算法·音视频·语音识别
get lend gua1 小时前
游戏数据分析,力扣(游戏玩法分析 I~V)mysql+pandas
python·mysql·leetcode·游戏·数据分析