✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
本文提出了一种多目标粘液模算法 (MOSMA),它是最近开发的粘液模算法 (SMA) 的多目标变体,用于处理行业中的多目标优化问题。最近,为了处理优化问题,已经为优化社区提出了几种元启发式和进化优化技术。在评估多目标优化 (MOO) 问题时,这些方法往往会遇到低质量的解决方案,而不是解决识别帕累托最优解决方案的准确估计和增加所有目标的分布的目标函数。SMA 方法遵循从实验室实验中粘菌的振荡行为获得的逻辑。与其他成熟的方法相比,SMA 算法显示出强大的性能,它是通过使用正负反馈系统结合最佳食物路径而设计的。所提出的 MOSMA 算法采用相同的基本 SMA 收敛机制,并结合精英非支配排序方法来估计帕累托最优解。作为一种后验方法,在 MOSMA 中保持多目标公式,并使用拥挤距离算子来确保增加所有目标的最优解的覆盖范围。所提出的 MOSMA 算法采用相同的基本 SMA 收敛机制,并结合精英非支配排序方法来估计帕累托最优解。作为一种后验方法,在 MOSMA 中保持多目标公式,并使用拥挤距离算子来确保增加所有目标的最优解的覆盖范围。所提出的 MOSMA 算法采用相同的基本 SMA 收敛机制,并结合精英非支配排序方法来估计帕累托最优解。作为一种后验方法,在 MOSMA 中保持多目标公式,并使用拥挤距离算子来确保增加所有目标的最优解的覆盖范围。
⛄ 部分代码
function [Score,PopObj] = HV(PopObj,PF)
% <metric> <max>
% Hypervolume
%
% Normalize the population according to the reference point set
[N,M] = size(PopObj);
fmin = min(min(PopObj,[],1),zeros(1,M));
fmax = max(PF,[],1);
PopObj = (PopObj-repmat(fmin,N,1))./repmat((fmax-fmin)*1.1,N,1);
PopObj(any(PopObj>1,2),:) = [];
% The reference point is set to (1,1,...)
RefPoint = ones(1,M);
if isempty(PopObj)
Score = 0;
elseif M < 4
% Calculate the exact HV value
pl = sortrows(PopObj);
S = {1,pl};
for k = 1 : M-1
S_ = {};
for i = 1 : size(S,1)
Stemp = Slice(cell2mat(S(i,2)),k,RefPoint);
for j = 1 : size(Stemp,1)
temp(1) = {cell2mat(Stemp(j,1))*cell2mat(S(i,1))};
temp(2) = Stemp(j,2);
S_ = Add(temp,S_);
end
end
S = S_;
end
Score = 0;
for i = 1 : size(S,1)
p = Head(cell2mat(S(i,2)));
Score = Score + cell2mat(S(i,1))*abs(p(M)-RefPoint(M));
end
else
% Estimate the HV value by Monte Carlo estimation
SampleNum = 1000000;
MaxValue = RefPoint;
MinValue = min(PopObj,[],1);
Samples = unifrnd(repmat(MinValue,SampleNum,1),repmat(MaxValue,SampleNum,1));
if gpuDeviceCount > 0
% GPU acceleration
Samples = gpuArray(single(Samples));
PopObj = gpuArray(single(PopObj));
end
for i = 1 : size(PopObj,1)
drawnow();
domi = true(size(Samples,1),1);
m = 1;
while m <= M && any(domi)
domi = domi & PopObj(i,m) <= Samples(:,m);
m = m + 1;
end
Samples(domi,:) = [];
end
Score = prod(MaxValue-MinValue)*(1-size(Samples,1)/SampleNum);
end
end
function S = Slice(pl,k,RefPoint)
p = Head(pl);
pl = Tail(pl);
ql = [];
S = {};
while ~isempty(pl)
ql = Insert(p,k+1,ql);
p_ = Head(pl);
cell_(1,1) = {abs(p(k)-p_(k))};
cell_(1,2) = {ql};
S = Add(cell_,S);
p = p_;
pl = Tail(pl);
end
ql = Insert(p,k+1,ql);
cell_(1,1) = {abs(p(k)-RefPoint(k))};
cell_(1,2) = {ql};
S = Add(cell_,S);
end
function ql = Insert(p,k,pl)
flag1 = 0;
flag2 = 0;
ql = [];
hp = Head(pl);
while ~isempty(pl) && hp(k) < p(k)
ql = [ql;hp];
pl = Tail(pl);
hp = Head(pl);
end
ql = [ql;p];
m = length(p);
while ~isempty(pl)
q = Head(pl);
for i = k : m
if p(i) < q(i)
flag1 = 1;
else
if p(i) > q(i)
flag2 = 1;
end
end
end
if ~(flag1 == 1 && flag2 == 0)
ql = [ql;Head(pl)];
end
pl = Tail(pl);
end
end
function p = Head(pl)
if isempty(pl)
p = [];
else
p = pl(1,:);
end
end
function ql = Tail(pl)
if size(pl,1) < 2
ql = [];
else
ql = pl(2:end,:);
end
end
function S_ = Add(cell_,S)
n = size(S,1);
m = 0;
for k = 1 : n
if isequal(cell_(1,2),S(k,2))
S(k,1) = {cell2mat(S(k,1))+cell2mat(cell_(1,1))};
m = 1;
break;
end
end
if m == 0
S(n+1,:) = cell_(1,:);
end
S_ = S;
end
⛄ 运行结果
⛄ 参考文献
M. Premkumar, P. Jangir, R. Sowmya, H. H. Alhelou, A. A. Heidari and H. Chen, "MOSMA: Multi-objective Slime Mould Algorithm Based on Elitist Non-dominated Sorting," in IEEE Access, doi: 10.1109/ACCESS.2020.3047936.