python:基于时变分鳟层竞争的海鞘算法(Time-Based Leadership Salp-Based Competitive Learning ,TBLSBCL)求解23个基本函数

一、基于时变分层竞争的鳟海鞘算法

基于时变分鳟层竞争的海鞘算法(Time-Based Leadership Salp-Based Competitive Learning ,TBLSBCL)由Mohammed等人于2022年提出。

python:基于时变分鳟层竞争的海鞘算法(Time-Based Leadership Salp-Based Competitive Learning ,TBLSBCL)求解23个基本函数_第1张图片

参考文献:

Mohammed Qaraad, Souad Amjad, Nazar K Hussein, Mostafa A Elhosseini, Addressing constrained engineering problems and feature selection with a time-based leadership salp-based algorithm with competitive learning, Journal of Computational Design and Engineering, Volume 9, Issue 6, December 2022, Pages 2235–2270, Addressing constrained engineering problems and feature selection with a time-based leadership salp-based algorithm with competitive learning | Journal of Computational Design and Engineering | Oxford Academic

二、TBLSBCL求解23个测试函数

23个测试函数简介

测试集:23组基本测试函数简介及图像(提供python代码)_IT猿手的博客-CSDN博客

python:基于时变分鳟层竞争的海鞘算法(Time-Based Leadership Salp-Based Competitive Learning ,TBLSBCL)求解23个基本函数_第2张图片

部分代码

from FunInfo import Get_Functions_details
from TBLSBCL import TBLSBCL
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']=['Microsoft YaHei']
#主程序
function_name =7#测试函数1-23
SearchAgents_no = 50#种群大小
Max_iter = 100#迭代次数
lb,ub,dim,fobj=Get_Functions_details(function_name)#获取问题信息
BestX,BestF,curve = TBLSBCL(SearchAgents_no, Max_iter,lb,ub,dim,fobj)#问题求解




#画收敛曲线图
if BestF>0:
    plt.semilogy(curve,color='r',linewidth=2,label='TBLSBCL')
else:
    plt.plot(curve,color='r',linewidth=2,label='TBLSBCL')
plt.xlabel("Iteration")
plt.ylabel("Fitness")
plt.xlim(0,Max_iter)
plt.title("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))

部分结果

python:基于时变分鳟层竞争的海鞘算法(Time-Based Leadership Salp-Based Competitive Learning ,TBLSBCL)求解23个基本函数_第3张图片

python:基于时变分鳟层竞争的海鞘算法(Time-Based Leadership Salp-Based Competitive Learning ,TBLSBCL)求解23个基本函数_第4张图片

python:基于时变分鳟层竞争的海鞘算法(Time-Based Leadership Salp-Based Competitive Learning ,TBLSBCL)求解23个基本函数_第5张图片

python:基于时变分鳟层竞争的海鞘算法(Time-Based Leadership Salp-Based Competitive Learning ,TBLSBCL)求解23个基本函数_第6张图片

python:基于时变分鳟层竞争的海鞘算法(Time-Based Leadership Salp-Based Competitive Learning ,TBLSBCL)求解23个基本函数_第7张图片

python:基于时变分鳟层竞争的海鞘算法(Time-Based Leadership Salp-Based Competitive Learning ,TBLSBCL)求解23个基本函数_第8张图片

三、完整python代码

你可能感兴趣的:(python,优化算法,智能优化算法,python,学习,算法,开发语言,优化算法)