Skip to content

Commit

Permalink
Update ARMOEA and add CA-MOEA
Browse files Browse the repository at this point in the history
  • Loading branch information
anonymone committed May 17, 2019
1 parent 538a8fd commit c8694b7
Show file tree
Hide file tree
Showing 4 changed files with 201 additions and 1 deletion.
2 changes: 1 addition & 1 deletion PlatEMO/Algorithms/AR-MOEA/ARMOEA.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function ARMOEA(Global)
W = UniformPoint(Global.N,Global.M);
[Archive,RefPoint,Range] = UpdateRefPoint(Population(all(Population.cons<=0,2)).objs,W,[]);

%% Start the interations
%% Optimization
while Global.NotTermination(Population)
MatingPool = MatingSelection(Population,RefPoint,Range);
Offspring = GA(Population(MatingPool));
Expand Down
58 changes: 58 additions & 0 deletions PlatEMO/Algorithms/CA-MOEA/CAMOEA.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
function CAMOEA(Global)
% <algorithm> <C>
% Clustering based adaptive multi-objective evolutionary algorithm

%------------------------------- Reference --------------------------------
% Y. Hua, Y. Jin, K. Hao, A clustering-based adaptive eEvolutionary
% algorithm for multiobjective optimization with irregular Pareto fronts,
% IEEE Transactions on Cybernetics, 2018.
%------------------------------- Copyright --------------------------------
% Copyright (c) 2018-2019 BIMK Group. You are free to use the PlatEMO for
% research purposes. All publications which use this platform or any code
% in the platform should acknowledge the use of "PlatEMO" and reference "Ye
% Tian, Ran Cheng, Xingyi Zhang, and Yaochu Jin, PlatEMO: A MATLAB platform
% for evolutionary multi-objective optimization [educational forum], IEEE
% Computational Intelligence Magazine, 2017, 12(4): 73-87".
%--------------------------------------------------------------------------

% This function is written by Yicun Hua

%% Generate random population
Population = Global.Initialization();

%% Optimization
while Global.NotTermination(Population)
% Generate offspring randomly
MatingPool = randperm(Global.N);
Offspring = GA(Population(MatingPool));

% Elitism strategy
UniPop = [Population,Offspring];
PopObj = UniPop.objs;
[FrontNo,MaxFNo] = NDSort(PopObj,Global.N);

% The number of individuals to be selected in the last
% non-dominated front
K = Global.N-sum(FrontNo<MaxFNo);

if K~= 0
% Normalization
pareto_population = find(FrontNo<MaxFNo);
last_population = find(FrontNo == MaxFNo);
Zmin = min(PopObj(FrontNo == MaxFNo,:));
Zmax = max(PopObj(FrontNo == MaxFNo,:));
S = sum(FrontNo == MaxFNo);
MaxFnorm = (PopObj(last_population,:)-repmat(Zmin,S,1))./repmat(Zmax-Zmin,S,1);

% Clustering-based reference points generation
[Ref] = Reference_Generation( MaxFnorm,Global.M,K);

% Clustering-based environmental selection
[reference_population] = Reference_Point_Selection(MaxFnorm,last_population,Ref,K,Global.M);
else
pareto_population = find(FrontNo<=MaxFNo);
reference_population = [];
end
Population = UniPop([pareto_population,reference_population]);
end
end
62 changes: 62 additions & 0 deletions PlatEMO/Algorithms/CA-MOEA/Reference_Generation.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
function [Ref] = Reference_Generation(MaxFnorm, M, K)
% Clustering-based reference points generation

%------------------------------- Copyright --------------------------------
% Copyright (c) 2018-2019 BIMK Group. You are free to use the PlatEMO for
% research purposes. All publications which use this platform or any code
% in the platform should acknowledge the use of "PlatEMO" and reference "Ye
% Tian, Ran Cheng, Xingyi Zhang, and Yaochu Jin, PlatEMO: A MATLAB platform
% for evolutionary multi-objective optimization [educational forum], IEEE
% Computational Intelligence Magazine, 2017, 12(4): 73-87".
%--------------------------------------------------------------------------

% This function is written by Yicun Hua

% Calculate boundary individuals: extreme
[~,maxobj] = max(MaxFnorm,[],1);
[~,minobj] = min(MaxFnorm,[],1);
ex = unique([maxobj,minobj]);
extreme = unique(MaxFnorm(ex,:),'rows');

E = size(extreme,1);
Nc = K-E;

if Nc>0
% Clustering
T = clusterdata(MaxFnorm,'maxclust',Nc,'distance','euclidean','linkage','ward');

% Calculate cluster centers
for i = 1:Nc

p = find(T == i);
pn = length(p);

Ref(i,1:M) = sum(MaxFnorm(p,:),1)/pn;

Ref(i,M+1) = i;

end

Ref = unique(Ref,'rows');
rpr = size(Ref,1);

% If cluster centers are not enough,
% randomly select some individuals as reference points
if rpr < Nc
Ncrp = Nc-rpr;
Ref(rpr+1:Nc,:) = MaxFnorm(randperm(size(MaxFnorm,1),Ncrp),:);
end

Ref(:,M+1) = [];

% Use boundary individuals as reference points
for er = 1:E
Ref(Nc+er,1:M) = extreme(er,1:M);
end
else
% Use boundary individuals as reference points
for er = 1:K
Ref(er,:) = extreme(er,:);
end
end
end
80 changes: 80 additions & 0 deletions PlatEMO/Algorithms/CA-MOEA/Reference_Point_Selection.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
function [reference_population]=Reference_Point_Selection(MaxFnorm,last_population,Ref,K,M)
% Clustering-based environmental selection

%------------------------------- Copyright --------------------------------
% Copyright (c) 2018-2019 BIMK Group. You are free to use the PlatEMO for
% research purposes. All publications which use this platform or any code
% in the platform should acknowledge the use of "PlatEMO" and reference "Ye
% Tian, Ran Cheng, Xingyi Zhang, and Yaochu Jin, PlatEMO: A MATLAB platform
% for evolutionary multi-objective optimization [educational forum], IEEE
% Computational Intelligence Magazine, 2017, 12(4): 73-87".
%--------------------------------------------------------------------------

% This function is written by Yicun Hua

last_Num = size(MaxFnorm,1);
Ref_Num = size(Ref,1);
dis = pdist2(MaxFnorm,Ref);

for i = 1:last_Num
[~,dmin_p] = min(dis(i,:),[],2);

% Individual i assigned to Ref(dmin_p,:)
MaxFnorm(i,(M+1)) = dmin_p;

% Distance between individual i and Ref(dmin_p,:)
MaxFnorm(i,(M+2)) = dis(i,dmin_p);
end

% Individuals are labeled 3(to distinguish from 1 and 2)
MaxFnorm(:,(M+3)) = 3;
for i = 1:Ref_Num
if sum(MaxFnorm(:,(M+1)) == i) ~= 0
a = find(MaxFnorm(:,(M+1)) == i);
a = a';
[~,b] = sort(MaxFnorm(a,(M+2)));

% Individuals closest to reference points are labeled 1
MaxFnorm(a(b(1)),(M+3)) = 1;

% Individuals in crowd area are labeled 2
if sum(MaxFnorm(:,(M+1)) == i) > 3
a(b(1)) = [];
MaxFnorm(a,(M+3)) = 2;
end
end
end

t1 = sum(MaxFnorm(:,(M+3)) == 1);
t2 = sum(MaxFnorm(:,(M+3)) == 2);

if t1 <= K
% If individuals labeled 1 are not enough, we choose some 2, then 3
d = find(MaxFnorm(:,(M+3))==1);
d = d';
reference_population(1:t1) = d;
if t2 >= (K-t1)
% If individuals labeled 2 are enough
d = find(MaxFnorm(:,(M+3))==2);
d = d';
y = randperm(length(d));
reference_population((t1+1):K) = d(y(1:(K-t1)));
else
% If individuals labeled 2 are not enough, we choose some 3
d = find(MaxFnorm(:,(M+3)) == 2);
d = d';
reference_population((t1+1):(t1+t2)) = d;
d = find(MaxFnorm(:,(M+3)) == 3);
d = d';
y = randperm(length(d));
reference_population((t1+t2+1):K) = d(y(1:(K-t1-t2)));
end
else
% If individuals labeled 1 are enough
d = find(MaxFnorm(:,(M+3)) == 1);
d = d';
y = randperm(length(d));
reference_population(1:K) = d(y(1:K));
end
reference_population = last_population(reference_population);
end

0 comments on commit c8694b7

Please sign in to comment.