👨🎓个人主页:研学社的博客
💥💥💞💞欢迎来到本博客❤️❤️💥💥
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
📋📋📋本文目录如下:🎁🎁🎁
目录
💥1 概述
📚2 运行结果
🌈3 Matlab代码实现
🎉4 参考文献
💥1 概述
文献来源:
本研究提出了一种改进版本的基于供给需求的优化(SDO)算法,这是一种最新开发的元启发式搜索方法。为了更有效地在SDO中对供需过程进行建模,使用适应度-距离平衡(FDB)方法确定了指导搜索过程的候选解决方案。为了测试和验证开发的基于FDB的SDO算法的性能,使用了现代基准测试套件CEC 2017。该套件有四种不同的类型和三十个不受约束的测试问题。在30/50/100维度上设计这些问题,以测试和验证所提算法在不同类型和维度的搜索空间中的性能。此外,还使用了20个工程设计问题来测试和验证所提出的FDBSDO变化在约束工程设计问题中的性能。使用非参数统计检验方法分析两项实验研究的数据。根据分析结果,在所有实验研究中,FDBSDO 变体与基本算法相比表现出更好的性能,具有约束/无约束、单峰/多模态/混合/组合问题类型和不同维度。FDB选择方法的实现消除了SDO算法过早收敛的问题。所提出的FDBSDO算法具有灵敏搜索的能力,有效地提供多样性,并在开发与探索之间建立强大的平衡。
📚2 运行结果
>> clear
>> Main
Best Fitness: 0
Best Solution:
1.0e-188 *
1 至 6 列
0.030433970441272 0.119285342992284 -0.200357222030440 0.297422355785162 0.243943075698639 -0.066134217605201
7 至 12 列
-0.079233582258019 -0.488406887382094 0.151556329519022 -0.473651848193521 0.598352840736898 -0.240617155620562
13 至 18 列
0.116284366732831 -0.102563552154731 -0.335148677375002 0.164411860537615 -0.070082082065116 -0.199061711671232
19 至 24 列
0.464975445730445 -0.147034098632501 0.155336436796199 0.360279584383305 -0.470133243231548 -0.317090202768799
25 至 30 列
-0.105189174352339 -0.241764658403916 0.225006961945101 0.740405936122786 0.169874040382366 0.293869821353759
>>
部分代码:
function []=fdb_sdo()
% FunIndex: Index of function.
% MaxIt: The maximum number of iterations.
% MarketSize: The size of markets.
% Dim: The size of commodities in each market.
% Alpha: The supply weight.
% Beta: The demand weight.
% BestX: The best solution found so far.
% BestF: The best fitness corresponding to BestX.
% HisBestFit: History best fitness over iterations.
% Market: The population of markets.
% Low: The low bound of search space.
% Up: The up bound of search space.
% Initialize n markets each of which has a commodity.
[MarketSize, Dim, maxIteration, Low, Up] = problem_terminate();
MaxIt = ceil((maxIteration / (MarketSize*2)));
CommPrice = zeros(MarketSize,Dim);
CommPriceFit = zeros(MarketSize,1);
CommQuantity = zeros(MarketSize,Dim);
CommQuantityFit = zeros(MarketSize,1);
Matr=[1 Dim];
for i=1:MarketSize
CommPrice(i,:)=rand(1,Dim).*(Up-Low)+Low;
CommPriceFit(i)= problem(CommPrice(i,:));
CommQuantity(i,:)=rand(1,Dim).*(Up-Low)+Low;
CommQuantityFit(i)=problem(CommQuantity(i,:));
if CommQuantityFit(i)<= CommPriceFit(i)
CommPriceFit(i)= CommQuantityFit(i);
CommPrice(i,:)= CommQuantity(i,:);
end
end
for Iter=1:MaxIt
a=2*(MaxIt-Iter+1)/MaxIt;
F=zeros(MarketSize,1);
MeanQuantityFit = mean(CommQuantityFit);
for i=1:MarketSize
F(i) =(abs( CommQuantityFit(i)-MeanQuantityFit)+10^(-15)); % Equation (7)
end
FQ=F/sum(F); % Equation (8)
MeanPriceFit=mean(CommPriceFit);
for i=1:MarketSize
F(i) =(abs( CommPriceFit(i)-MeanPriceFit)+10^(-15));%Equation (10)
end
FP=F/sum(F); % Equation (11)
MeanPrice=(mean(CommPrice));
for i=1:MarketSize
Ind=round(rand)+1;
Alpha=a*sin((2*pi)*rand(1,Matr(Ind))); % Equation (16)
Beta=2*cos((2*pi)*rand(1,Matr(Ind))); % Equation (17)
k=find(rand<=cumsum(FQ),1,'first'); % Equation (9)
CommQuantityEqu=CommQuantity(k,:);
if rand>0.5
CommPriceEqu=rand*MeanPrice;% Equation (12)
else
k=find(rand<=cumsum(FP),1,'first');
CommPriceEqu=CommPrice(k,:); % Equation (12)
end
% Supply function (supply relation of producers)
fdbIndex = rouletteFitnessDistanceBalance(CommQuantity, CommQuantityFit);
NewCommQuantity=CommQuantity(fdbIndex,:)+Alpha.*( CommPrice(i,:)-CommPriceEqu); %Equation (13)
NewCommQuantity=SpaceBound(NewCommQuantity,Up,Low);
NewCommQuantityFit = problem(NewCommQuantity);
if NewCommQuantityFit<= CommQuantityFit(i)
CommQuantityFit(i)=NewCommQuantityFit;
CommQuantity(i,:)=NewCommQuantity;
end
% Demand function (demand relation of consumers)
NewCommPrice=CommPriceEqu-Beta.*(NewCommQuantity-CommQuantityEqu );% Equation (14)
NewCommPrice=SpaceBound(NewCommPrice,Up,Low);
NewCommPriceFit = problem(NewCommPrice);
if NewCommPriceFit<= CommPriceFit(i)
CommPriceFit(i)=NewCommPriceFit;
CommPrice(i,:)=NewCommPrice;
end
end
% Replacement
for i=1:MarketSize
if CommQuantityFit(i)<= CommPriceFit(i)
CommPriceFit(i)= CommQuantityFit(i);
CommPrice(i,:)= CommQuantity(i,:);
end
end
end
[ bestFitness, index] = min(CommPriceFit);
bestSolution = CommPrice(index, :);
fprintf('Best Fitness: %d\n', bestFitness);
disp('Best Solution:');
disp(bestSolution);
end
function X=SpaceBound(X,Up,Low)
Dim=length(X);
S=(X>Up)+(X<Low);
X=(rand(1,Dim).*(Up-Low)+Low).*S+X.*(~S);
end
🌈3 Matlab代码实现
🎉4 参考文献
部分理论来源于网络,如有侵权请联系删除。
W. Zhao, L. Wang and Z. Zhang, "Supply-Demand-Based Optimization: A Novel Economics-Inspired Algorithm for Global Optimization," in IEEE Access, vol. 7, pp. 73182-73206, 2019, doi: 10.1109/ACCESS.2019.2918753.