-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
139 changed files
with
9,683 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
PlatEMO/Algorithms/Multi-objective optimization/MCCMO/CalFitness1.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
function Fitness = CalFitness1(PopObj,PopCon,processcon,epsilon) | ||
% Calculate the fitness of each solution | ||
|
||
%------------------------------- Copyright -------------------------------- | ||
% Copyright (c) 2023 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". | ||
%-------------------------------------------------------------------------- | ||
|
||
N = size(PopObj,1); | ||
CV = PopCon(:,processcon); | ||
CV = sum(max(0,CV),2); | ||
CV(find(CV<=epsilon)) = 0; | ||
%% Detect the dominance relation between each two solutions | ||
Dominate = false(N); | ||
for i = 1 : N-1 | ||
for j = i+1 : N | ||
if CV(i) < CV(j) | ||
Dominate(i,j) = true; | ||
elseif CV(i) > CV(j) | ||
Dominate(j,i) = true; | ||
else | ||
k = any(PopObj(i,:)<PopObj(j,:)) - any(PopObj(i,:)>PopObj(j,:)); | ||
if k == 1 | ||
Dominate(i,j) = true; | ||
elseif k == -1 | ||
Dominate(j,i) = true; | ||
end | ||
end | ||
end | ||
end | ||
|
||
%% Calculate S(i) | ||
S = sum(Dominate,2); | ||
|
||
%% Calculate R(i) | ||
R = zeros(1,N); | ||
for i = 1 : N | ||
R(i) = sum(S(Dominate(:,i))); | ||
end | ||
|
||
%% Calculate D(i) | ||
Distance = pdist2(PopObj,PopObj); | ||
Distance(logical(eye(length(Distance)))) = inf; | ||
Distance = sort(Distance,2); | ||
D = 1./(Distance(:,floor(sqrt(N)))+2); | ||
|
||
%% Calculate the fitnesses | ||
Fitness = R + D'; | ||
end |
56 changes: 56 additions & 0 deletions
56
PlatEMO/Algorithms/Multi-objective optimization/MGSAEA/CalFitness.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
function Fitness = CalFitness(PopObj,PopCon) | ||
% Calculate the fitness of each solution | ||
|
||
%------------------------------- Copyright -------------------------------- | ||
% Copyright (c) 2023 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". | ||
%-------------------------------------------------------------------------- | ||
|
||
N = size(PopObj,1); | ||
if nargin == 1 | ||
CV = zeros(N,1); | ||
else | ||
CV = sum(max(0,PopCon),2); | ||
end | ||
|
||
%% Detect the dominance relation between each two solutions | ||
Dominate = false(N); | ||
for i = 1 : N-1 | ||
for j = i+1 : N | ||
if CV(i) < CV(j) | ||
Dominate(i,j) = true; | ||
elseif CV(i) > CV(j) | ||
Dominate(j,i) = true; | ||
else | ||
k = any(PopObj(i,:)<PopObj(j,:)) - any(PopObj(i,:)>PopObj(j,:)); | ||
if k == 1 | ||
Dominate(i,j) = true; | ||
elseif k == -1 | ||
Dominate(j,i) = true; | ||
end | ||
end | ||
end | ||
end | ||
|
||
%% Calculate S(i) | ||
S = sum(Dominate,2); | ||
|
||
%% Calculate R(i) | ||
R = zeros(1,N); | ||
for i = 1 : N | ||
R(i) = sum(S(Dominate(:,i))); | ||
end | ||
|
||
%% Calculate D(i) | ||
Distance = pdist2(PopObj,PopObj); | ||
Distance(logical(eye(length(Distance)))) = inf; | ||
Distance = sort(Distance,2); | ||
D = 1./(Distance(:,floor(sqrt(N)))+2); | ||
|
||
%% Calculate the fitnesses | ||
Fitness = R + D'; | ||
end |
81 changes: 81 additions & 0 deletions
81
PlatEMO/Algorithms/Multi-objective optimization/MGSAEA/EnvironmentalSelection.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
function [PopDec,PopObj,Fitness] = EnvironmentalSelection(PopDec,PopObj,NI,M,status) | ||
% Environmental selection | ||
|
||
%------------------------------- Copyright -------------------------------- | ||
% Copyright (c) 2023 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". | ||
%-------------------------------------------------------------------------- | ||
|
||
%% Delete the duplicated points | ||
[~, Unduplicated] = unique(PopObj(:,1:M),'rows'); | ||
PopDec = PopDec(Unduplicated,:); | ||
PopObj = PopObj(Unduplicated,:); | ||
|
||
%% Calculate the fitness of each solution | ||
if nargin == 4 | ||
Fitness = CalFitness(PopObj); | ||
else | ||
if status == 1 | ||
RealObj = PopObj(:,1:M); | ||
CV = PopObj(:,end); | ||
Fitness = CalFitness(RealObj,max(0,CV)); | ||
elseif status == 2 | ||
RealObj = PopObj(:,1:M); | ||
PopCon = PopObj(:,M+1:end); | ||
CV = sum(max(0,PopCon),2); | ||
Fitness = CalFitness([RealObj,CV]); | ||
elseif status == 3 | ||
Fitness = CalFitness(PopObj); | ||
end | ||
end | ||
|
||
%% Environmental selection | ||
if nargin == 4 | ||
Next = Fitness < 1; | ||
if sum(Next) < NI | ||
[~,Rank] = sort(Fitness); | ||
Next(Rank(1:NI)) = true; | ||
elseif sum(Next) > NI | ||
Del = Truncation(PopObj(Next,:),sum(Next)-NI); | ||
Temp = find(Next); | ||
Next(Temp(Del)) = false; | ||
end | ||
else | ||
Next = Fitness < 1; | ||
if sum(Next) < NI | ||
[~,Rank] = sort(Fitness); | ||
Next(Rank(1:NI)) = true; | ||
elseif sum(Next) > NI | ||
if status ~=3 | ||
RealObj = PopObj(:,1:M); | ||
else | ||
RealObj = PopObj; | ||
end | ||
Del = Truncation(RealObj(Next,:),sum(Next)-NI); | ||
Temp = find(Next); | ||
Next(Temp(Del)) = false; | ||
end | ||
end | ||
PopDec = PopDec(Next,:); | ||
PopObj = PopObj(Next,:); | ||
Fitness = Fitness(Next); | ||
end | ||
|
||
function Del = Truncation(PopObj,K) | ||
% Select part of the solutions by truncation | ||
|
||
%% Truncation | ||
Distance = pdist2(PopObj,PopObj); | ||
Distance(logical(eye(length(Distance)))) = inf; | ||
Del = false(1,size(PopObj,1)); | ||
while sum(Del) < K | ||
Remain = find(~Del); | ||
Temp = sort(Distance(Remain,Remain),2); | ||
[~,Rank] = sortrows(Temp); | ||
Del(Remain(Rank(1))) = true; | ||
end | ||
end |
Oops, something went wrong.