✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
象鼻虫是一种长有细长鼻部的昆虫,来自Curculionoide超科约97000种。它们中的大多数认为害虫会造成环境破坏,但一些种类,如小麦象鼻虫、玉米象鼻虫和棉铃象鼻虫,都会造成巨大的危害对农作物,特别是谷物的损害。本研究提出了一种新的基于群体的进化算法,称为“象甲损伤优化算法”(WDOA)象鼻虫对农作物或农产品的飞力、鼻力和破坏力。用12个基准单峰和多峰人工景观或优化测试功能。此外,拟议的WDOA用于五项工程以检查其解决问题的稳健性。问题包括旅行推销员问题(TSP)、n-Queens问题、投资组合问题、最优库存控制(OIC)问题、,和装箱问题(BPP)。所有测试的功能都与广泛使用的基准测试相比较粒子群优化(PSO)、遗传算法(GA)、和谐搜索算法(HS)算法、帝国主义竞争算法(ICA)、萤火虫算法(FA)和差异进化(DE)算法。此外,所有问题都用DE、FA和HS算法进行了测试。通过提供精确性和合理的速度,所提出的算法在所有函数和问题上都表现出了鲁棒性和速度。
⛄ 部分代码
%% Weevil Damage Optimization Algorithm (WDOA) Portfolio Problem
% Paper:
% http://www.growingscience.com/jfs/Vol2/jfs_2022_17.pdf
%%----------------------------------------------------------
% Portfolio is a definition in finance which is based on receiving some values (prices)
% as stock or any other financial assets and converting them into returns by aiming to
% increase the return and decreasing the risk. Finally, those solutions which have highest
% return and lowest risk, would be considers as a vector called efficient frontier.
% Normally, portfolio solves by traditional methods such as mean-variance, mean semi
% variance, and mean absolute deviation but not always guaranteed the best solution.c;
clear;
close all;
%% Run App
data=load('mydata');
R=data.R;
nAsset=size(R,2);
MinRet=min(mean(R,1));
MaxRet=max(mean(R,1));
nSol=10;
DR=linspace(MinRet,MaxRet,nSol);
model.R=R;
model.method='cvar';
model.alpha=0.95;
W=zeros(nSol,nAsset);
WReturn=zeros(nSol,1);
WRisk=zeros(nSol,1);
for k=1:nSol
model.DesiredRet=DR(k);
disp(['Running for Solution #' num2str(k) ':']);
%-----------------------------------
out = RunWDOA(model);
%-----------------------------------
disp('__________________________');
disp('');
W(k,:)=out.BestSol.Out.w;
WReturn(k)=out.BestSol.Out.ret;
WRisk(k)=out.BestSol.Out.rsk;
end
EF=find(~IsDominated(WRisk,WReturn));
%% Results
figure;
plot(WRisk,WReturn,'y','LineWidth',2);
hold on;
plot(WRisk(EF),WReturn(EF),'r','LineWidth',4);
legend('','Efficient Frontier');
ax = gca;
ax.FontSize = 14;
ax.FontWeight='bold';
set(gca,'Color','w')
grid on;
xlabel('Risk');
ylabel('Return');
figure;
plot(out.BestCost,'k', 'LineWidth', 2);
xlabel('ITR');
ylabel('Cost Value');
ax = gca;
ax.FontSize = 14;
ax.FontWeight='bold';
set(gca,'Color','c')
grid on;
out.BestSol.Out
⛄ 运行结果
⛄ 参考文献
Weevil damage optimization algorithm and its applications