clc;
clear;
close all;
%% Problem Definition
CostFunction = @(x) ZDT(x); % Cost Function
nVar = 5; % Number of Decision Variables
VarSize = [1 nVar]; % Size of Decision Variables Matrix
VarMin = 0; % Lower Bound of Variables
VarMax = 1; % Upper Bound of Variables
%% MOPSO Parameters
MaxIt = 200; % Maximum Number of Iterations
nPop = 200; % Population Size
nRep = 100; % Repository Size
w = 0.5; % Inertia Weight
wdamp = 0.99; % Intertia Weight Damping Rate
c1 = 1; % Personal Learning Coefficient
c2 = 2; % Global Learning Coefficient
nGrid = 7; % Number of Grids per Dimension
alpha = 0.1; % Inflation Rate
beta = 2; % Leader Selection Pressure
gamma = 2; % Deletion Selection Pressure
mu = 0.1; % Mutation Rate
%% Initialization
empty_particle.Position = [];
empty_particle.Velocity = [];
empty_particle.Cost = [];
empty_particle.Best.Position = [];
empty_particle.Best.Cost = [];
empty_particle.IsDominated = [];
empty_particle.GridIndex = [];
empty_particle.GridSubIndex = [];
pop = repmat(empty_particle, nPop, 1);
for i = 1:nPop
pop(i).Position = unifrnd(VarMin, VarMax, VarSize);
pop(i).Velocity = zeros(VarSize);
pop(i).Cost = CostFunction(pop(i).Position);
% Update Personal Best
pop(i).Best.Position = pop(i).Position;
pop(i).Best.Cost = pop(i).Cost;
end
% Determine Domination
pop = DetermineDomination(pop);
rep = pop(~[pop.IsDominated]);
Grid = CreateGrid(rep, nGrid, alpha);
for i = 1:numel(rep)
rep(i) = FindGridIndex(rep(i), Grid);
end
%% MOPSO Main Loop
for it = 1:MaxIt
for i = 1:nPop
leader = SelectLeader(rep, beta);
pop(i).Velocity = w*pop(i).Velocity ...
+c1*rand(VarSize).*(pop(i).Best.Position-pop(i).Position) ...
+c2*rand(VarSize).*(leader.Position-pop(i).Position);
pop(i).Position = pop(i).Position + pop(i).Velocity;
pop(i).Position = max(pop(i).Position, VarMin);
pop(i).Position = min(pop(i).Position, VarMax);
pop(i).Cost = CostFunction(pop(i).Position);
% Apply Mutation
pm = (1-(it-1)/(MaxIt-1))^(1/mu);
if rand<pm
NewSol.Position = Mutate(pop(i).Position, pm, VarMin, VarMax);
NewSol.Cost = CostFunction(NewSol.Position);
if Dominates(NewSol, pop(i))
pop(i).Position = NewSol.Position;
pop(i).Cost = NewSol.Cost;
elseif Dominates(pop(i), NewSol)
% Do Nothing
else
if rand<0.5
pop(i).Position = NewSol.Position;
pop(i).Cost = NewSol.Cost;
end
end
end
if Dominates(pop(i), pop(i).Best)
pop(i).Best.Position = pop(i).Position;
pop(i).Best.Cost = pop(i).Cost;
elseif Dominates(pop(i).Best, pop(i))
% Do Nothing
else
if rand<0.5
pop(i).Best.Position = pop(i).Position;
pop(i).Best.Cost = pop(i).Cost;
end
end
end
% Add Non-Dominated Particles to REPOSITORY
rep = [rep
pop(~[pop.IsDominated])]; %#ok
% Determine Domination of New Resository Members
rep = DetermineDomination(rep);
% Keep only Non-Dminated Memebrs in the Repository
rep = rep(~[rep.IsDominated]);
% Update Grid
Grid = CreateGrid(rep, nGrid, alpha);
% Update Grid Indices
for i = 1:numel(rep)
rep(i) = FindGridIndex(rep(i), Grid);
end
% Check if Repository is Full
if numel(rep)>nRep
Extra = numel(rep)-nRep;
for e = 1:Extra
rep = DeleteOneRepMemebr(rep, gamma);
end
end
% Plot Costs
figure(1);
PlotCosts(pop, rep);
pause(0.01);
% Show Iteration Information
disp(['Iteration ' num2str(it) ': Number of Rep Members = ' num2str(numel(rep))]);
% Damping Inertia Weight
w = w*wdamp;
end
%% Resluts
没有合适的资源?快使用搜索试试~ 我知道了~
Multi-Objective PSO in MATLAB多目标粒子群优化算法(MOPSO)
共14个文件
m:14个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 4 下载量 111 浏览量
2022-05-07
18:21:49
上传
评论 4
收藏 5KB RAR 举报
温馨提示
该资源为多目标粒子群优化算法(MOPSO)。它是粒子群优化算法的多目标版本,结合了帕累托包络和网格生成技术,类似于基于帕累托包络的选择算法来处理多目标优化问题。 实现方式为MATLAB。本文提出了一种名为运动编码粒子群优化(MPSO)的新算法,用于UAV寻找移动目标。根据贝叶斯理论,搜索问题可以转化为目标函数的优化问题,该函数表示搜索到目标的概率。这里,所提出的MPSO是通过将搜索轨迹编码成一系列在PSO算法中的粒子生成过程中的UAV运动路径来解决这一问题的。仿真结果表明,与基本PSO相比,所提出的MPSO将检测性能提高了24%,时间性能提高了4.71倍。
资源推荐
资源详情
资源评论
收起资源包目录
Multi-Objective PSO in MATLAB.rar (14个子文件)
Multi-Objective PSO in MATLAB
RouletteWheelSelection.m 123B
Mutate.m 325B
MOP4.m 190B
MOP2.m 158B
CreateGrid.m 501B
main.m 7B
Dominates.m 169B
mopso.m 4KB
ZDT.m 174B
PlotCosts.m 316B
FindGridIndex.m 586B
DeleteOneRepMemebr.m 725B
DetermineDomination.m 446B
SelectLeader.m 709B
共 14 条
- 1
资源评论
- weixin_449091582022-10-06资源简直太好了,完美解决了当下遇到的难题,这样的资源很难不支持~
- 毕加索的小白2023-04-28这个资源内容超赞,对我来说很有价值,很实用,感谢大佬分享~
- weixin_440032212022-09-29资源很不错,内容和描述一致,值得借鉴,赶紧学起来!
- huwei963012022-09-08资源内容总结的很到位,内容详实,很受用,学到了~
且行且安~
- 粉丝: 2w+
- 资源: 46
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功