1 算法介绍
2 部分代码
clc;
clear;
close all;
%% 问题定义,这里可以删除
TestProblem=1; % Set to 1, 2, or 3
switch TestProblem
case 1
CostFunction=@(x) MyCost1(x);
nVar=50;
VarMin=0;
VarMax=1;
case 2
CostFunction=@(x) MyCost2(x);
nVar=3;
VarMin=-5;
VarMax=5;
case 3
CostFunction=@(x) MyCost3(x);
nVar=2;
VarMin=0;
VarMax=1;
end
VarSize=[1 nVar];
VelMax=(VarMax-VarMin)/10;
%% MOPSO 设置
nPop=500; % Population Size
nRep=100; % Repository Size
MaxIt=500; % Maximum Number of Iterations
phi1=2.05;%学习因子
phi2=2.05;
phi=phi1+phi2;
chi=2/(phi-2+s