Skip to content

Commit

Permalink
Update files
Browse files Browse the repository at this point in the history
  • Loading branch information
DestinyMy authored Oct 12, 2020
1 parent 87d96a8 commit 5d20f54
Show file tree
Hide file tree
Showing 3 changed files with 307 additions and 307 deletions.
124 changes: 62 additions & 62 deletions PlatEMO/Algorithms/S-CDAS/EnvironmentalSelection.m
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
function [Population,FrontNo,CrowdDis] = EnvironmentalSelection(Population,N)
% The environmental selection of S-CDAS

%------------------------------- 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".
%--------------------------------------------------------------------------

%% Non-dominated sorting
% Conventional non-dominated sorting
[FrontNo,MaxFNo] = NDSort(Population.objs,N);
% Sort based on self-controlling dominance area of solutions (S-CDAS)
for i = 1 : MaxFNo
FrontNo(FrontNo==i) = FrontNo(FrontNo==i) + SCDASSort(Population(FrontNo==i).objs);
end
[~,~,FrontNo] = unique(FrontNo);
MaxFNo = find(cumsum(hist(FrontNo,1:max(FrontNo)))>=N,1);
Next = FrontNo < MaxFNo;

%% Calculate the crowding distance of each solution
CrowdDis = CrowdingDistance(Population.objs,FrontNo);

%% Select the solutions in the last front based on their crowding distances
Last = find(FrontNo==MaxFNo);
[~,Rank] = sort(CrowdDis(Last),'descend');
Next(Last(Rank(1:N-sum(Next)))) = true;

%% Population for next generation
Population = Population(Next);
FrontNo = FrontNo(Next);
CrowdDis = CrowdDis(Next);
end

function FrontNo = SCDASSort(PopObj)
% Sort the solutions in a same front by S-CDAS

[N,M] = size(PopObj);

%% Translate the solutions
PopObj = PopObj - min(PopObj,[],1);

%% Create the landmark vectors
% It should be added but not subtracted by a tiny constant value for
% minimization problem, to avoid the extreme solutions being dominated
L = diag(max(PopObj,[],1)+1e-2);

%% Check whether each solution dominates the others
rx = sqrt(sum(PopObj.^2,2));
wx = acos(1-pdist2(PopObj,eye(M),'cosine'));
lx = pdist2(PopObj,L);
Rank = ones(1,N);
for i = 1 : N
phix = repmat(asin(rx(i).*sin(wx(i,:))./lx(i,:)),N,1);
PopObj1 = repmat(rx,1,M).*sin(wx+phix)./sin(phix);
dominated = all(repmat(PopObj1(i,:),N,1)<PopObj1,2);
Rank(dominated) = Rank(dominated) + 1;
end
FrontNo = Rank./(max(Rank)+1);
function [Population,FrontNo,CrowdDis] = EnvironmentalSelection(Population,N)
% The environmental selection of S-CDAS

%------------------------------- 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".
%--------------------------------------------------------------------------

%% Non-dominated sorting
% Conventional non-dominated sorting
[FrontNo,MaxFNo] = NDSort(Population.objs,N);
% Sort based on self-controlling dominance area of solutions (S-CDAS)
for i = 1 : MaxFNo
FrontNo(FrontNo==i) = FrontNo(FrontNo==i) + SCDASSort(Population(FrontNo==i).objs);
end
[~,~,FrontNo] = unique(FrontNo);
MaxFNo = find(cumsum(hist(FrontNo,1:max(FrontNo)))>=N,1);
Next = FrontNo < MaxFNo;

%% Calculate the crowding distance of each solution
CrowdDis = CrowdingDistance(Population.objs,FrontNo);

%% Select the solutions in the last front based on their crowding distances
Last = find(FrontNo==MaxFNo);
[~,Rank] = sort(CrowdDis(Last),'descend');
Next(Last(Rank(1:N-sum(Next)))) = true;

%% Population for next generation
Population = Population(Next);
FrontNo = FrontNo(Next);
CrowdDis = CrowdDis(Next);
end

function FrontNo = SCDASSort(PopObj)
% Sort the solutions in a same front by S-CDAS

[N,M] = size(PopObj);

%% Translate the solutions
PopObj = PopObj - min(PopObj,[],1);

%% Create the landmark vectors
% It should be added but not subtracted by a tiny constant value for
% minimization problem, to avoid the extreme solutions being dominated
L = diag(max(PopObj,[],1)+1e-2);

%% Check whether each solution dominates the others
rx = sqrt(sum(PopObj.^2,2));
wx = acos(1-pdist2(PopObj,eye(M),'cosine'));
lx = pdist2(PopObj,L);
Rank = ones(1,N);
for i = 1 : N
phix = repmat(asin(rx(i).*sin(wx(i,:))./lx(i,:)),N,1);
PopObj1 = repmat(rx,1,M).*sin(wx+phix)./sin(phix);
dominated = all(repmat(PopObj1(i,:),N,1)<PopObj1,2);
Rank(dominated) = Rank(dominated) + 1;
end
FrontNo = Rank./(max(Rank)+1);
end
206 changes: 103 additions & 103 deletions PlatEMO/Algorithms/WOF/WOF_DEOperator.m
Original file line number Diff line number Diff line change
@@ -1,104 +1,104 @@
function OffspringDec = WOF_DEOperator(Global,Parent,dummy)
% <operator> <real>
% Differental evolution and polynomial mutation
% CR --- 1 --- Parameter CR in differental evolution
% F --- 0.5 --- Parameter F in differental evolution
% proM --- 1 --- The expectation of number of bits doing mutation
% disM --- 20 --- The distribution index of polynomial mutation

% -----------------------------------------------------------------------
% Copyright (C) 2020 Heiner Zille
%
% This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0
% International License. (CC BY-NC-SA 4.0). To view a copy of this license,
% visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or see the
% pdf-file "License-CC-BY-NC-SA-4.0.pdf" that came with this code.
%
% You are free to:
% * Share ? copy and redistribute the material in any medium or format
% * Adapt ? remix, transform, and build upon the material
% Under the following terms:
% * Attribution ? You must give appropriate credit, provide a link to the
% license, and indicate if changes were made. You may do so in any reasonable
% manner, but not in any way that suggests the licensor endorses you or your use.
% * NonCommercial ? You may not use the material for commercial purposes.
% * ShareAlike ? If you remix, transform, or build upon the material, you must
% distribute your contributions under the same license as the original.
% * No additional restrictions ? You may not apply legal terms or technological
% measures that legally restrict others from doing anything the license permits.
%
% Author of this Code:
% Heiner Zille <heiner.zille@ovgu.de> or <heiner.zille@gmail.com>
%
% This code is based on the following publications:
%
% 1) Heiner Zille
% "Large-scale Multi-objective Optimisation: New Approaches and a Classification of the State-of-the-Art"
% PhD Thesis, Otto von Guericke University Magdeburg, 2019
% http://dx.doi.org/10.25673/32063
%
% 2) Heiner Zille and Sanaz Mostaghim
% "Comparison Study of Large-scale Optimisation Techniques on the LSMOP Benchmark Functions"
% IEEE Symposium Series on Computational Intelligence (SSCI), IEEE, Honolulu, Hawaii, November 2017
% https://ieeexplore.ieee.org/document/8280974
%
% 3) Heiner Zille, Hisao Ishibuchi, Sanaz Mostaghim and Yusuke Nojima
% "A Framework for Large-scale Multi-objective Optimization based on Problem Transformation"
% IEEE Transactions on Evolutionary Computation, Vol. 22, Issue 2, pp. 260-275, April 2018.
% http://ieeexplore.ieee.org/document/7929324
%
% 4) Heiner Zille, Hisao Ishibuchi, Sanaz Mostaghim and Yusuke Nojima
% "Weighted Optimization Framework for Large-scale Mullti-objective Optimization"
% Genetic and Evolutionary Computation Conference (GECCO), ACM, Denver, USA, July 2016
% http://dl.acm.org/citation.cfm?id=2908979
%
% This file is intended to work with the PlatEMO framework version 2.5.
% Date of publication of this code: 06.04.2020
% Last Update of this code: 06.04.2020
% A newer version of this algorithm may be available. Please contact the author
% or see http://www.ci.ovgu.de/Research/Codes.html.
% -----------------------------------------------------------------------
% This file is derived from its original version containied in the PlatEMO
% framework. The original copyright disclaimer can be found below.
% -----------------------------------------------------------------------

%--------------------------------------------------------------------------
% Copyright (c) 2016-2017 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".
%--------------------------------------------------------------------------

if dummy == true
[CR,F,proM,disM] = Global.Global.ParameterSet(1,0.5,1,20);
else
[CR,F,proM,disM] = Global.ParameterSet(1,0.5,1,20);
end
Parent = Parent([1:end,1:ceil(end/3)*3-end]);
ParentDec = Parent.decs;
[N,D] = size(ParentDec);

%% Differental evolution
Parent1Dec = ParentDec(1:N/3,:);
Parent2Dec = ParentDec(N/3+1:N/3*2,:);
Parent3Dec = ParentDec(N/3*2+1:end,:);
OffspringDec = Parent1Dec;
Site = rand(N/3,D) < CR;
OffspringDec(Site) = OffspringDec(Site) + F*(Parent2Dec(Site)-Parent3Dec(Site));

%% Polynomial mutation
Lower = repmat(Global.lower,N/3,1);
Upper = repmat(Global.upper,N/3,1);
Site = rand(N/3,D) < proM/D;
mu = rand(N/3,D);
temp = Site & mu<=0.5;
OffspringDec(temp) = OffspringDec(temp)+(Upper(temp)-Lower(temp)).*((2.*mu(temp)+(1-2.*mu(temp)).*...
(1-(OffspringDec(temp)-Lower(temp))./(Upper(temp)-Lower(temp))).^(disM+1)).^(1/(disM+1))-1);
temp = Site & mu>0.5;
OffspringDec(temp) = OffspringDec(temp)+(Upper(temp)-Lower(temp)).*(1-(2.*(1-mu(temp))+2.*(mu(temp)-0.5).*...
(1-(Upper(temp)-OffspringDec(temp))./(Upper(temp)-Lower(temp))).^(disM+1)).^(1/(disM+1)));


function OffspringDec = WOF_DEOperator(Global,Parent,dummy)
% <operator> <real>
% Differental evolution and polynomial mutation
% CR --- 1 --- Parameter CR in differental evolution
% F --- 0.5 --- Parameter F in differental evolution
% proM --- 1 --- The expectation of number of bits doing mutation
% disM --- 20 --- The distribution index of polynomial mutation

% -----------------------------------------------------------------------
% Copyright (C) 2020 Heiner Zille
%
% This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0
% International License. (CC BY-NC-SA 4.0). To view a copy of this license,
% visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or see the
% pdf-file "License-CC-BY-NC-SA-4.0.pdf" that came with this code.
%
% You are free to:
% * Share ? copy and redistribute the material in any medium or format
% * Adapt ? remix, transform, and build upon the material
% Under the following terms:
% * Attribution ? You must give appropriate credit, provide a link to the
% license, and indicate if changes were made. You may do so in any reasonable
% manner, but not in any way that suggests the licensor endorses you or your use.
% * NonCommercial ? You may not use the material for commercial purposes.
% * ShareAlike ? If you remix, transform, or build upon the material, you must
% distribute your contributions under the same license as the original.
% * No additional restrictions ? You may not apply legal terms or technological
% measures that legally restrict others from doing anything the license permits.
%
% Author of this Code:
% Heiner Zille <heiner.zille@ovgu.de> or <heiner.zille@gmail.com>
%
% This code is based on the following publications:
%
% 1) Heiner Zille
% "Large-scale Multi-objective Optimisation: New Approaches and a Classification of the State-of-the-Art"
% PhD Thesis, Otto von Guericke University Magdeburg, 2019
% http://dx.doi.org/10.25673/32063
%
% 2) Heiner Zille and Sanaz Mostaghim
% "Comparison Study of Large-scale Optimisation Techniques on the LSMOP Benchmark Functions"
% IEEE Symposium Series on Computational Intelligence (SSCI), IEEE, Honolulu, Hawaii, November 2017
% https://ieeexplore.ieee.org/document/8280974
%
% 3) Heiner Zille, Hisao Ishibuchi, Sanaz Mostaghim and Yusuke Nojima
% "A Framework for Large-scale Multi-objective Optimization based on Problem Transformation"
% IEEE Transactions on Evolutionary Computation, Vol. 22, Issue 2, pp. 260-275, April 2018.
% http://ieeexplore.ieee.org/document/7929324
%
% 4) Heiner Zille, Hisao Ishibuchi, Sanaz Mostaghim and Yusuke Nojima
% "Weighted Optimization Framework for Large-scale Mullti-objective Optimization"
% Genetic and Evolutionary Computation Conference (GECCO), ACM, Denver, USA, July 2016
% http://dl.acm.org/citation.cfm?id=2908979
%
% This file is intended to work with the PlatEMO framework version 2.5.
% Date of publication of this code: 06.04.2020
% Last Update of this code: 06.04.2020
% A newer version of this algorithm may be available. Please contact the author
% or see http://www.ci.ovgu.de/Research/Codes.html.
% -----------------------------------------------------------------------
% This file is derived from its original version containied in the PlatEMO
% framework. The original copyright disclaimer can be found below.
% -----------------------------------------------------------------------

%--------------------------------------------------------------------------
% Copyright (c) 2016-2017 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".
%--------------------------------------------------------------------------

if dummy == true
[CR,F,proM,disM] = Global.Global.ParameterSet(1,0.5,1,20);
else
[CR,F,proM,disM] = Global.ParameterSet(1,0.5,1,20);
end
Parent = Parent([1:end,1:ceil(end/3)*3-end]);
ParentDec = Parent.decs;
[N,D] = size(ParentDec);

%% Differental evolution
Parent1Dec = ParentDec(1:N/3,:);
Parent2Dec = ParentDec(N/3+1:N/3*2,:);
Parent3Dec = ParentDec(N/3*2+1:end,:);
OffspringDec = Parent1Dec;
Site = rand(N/3,D) < CR;
OffspringDec(Site) = OffspringDec(Site) + F*(Parent2Dec(Site)-Parent3Dec(Site));

%% Polynomial mutation
Lower = repmat(Global.lower,N/3,1);
Upper = repmat(Global.upper,N/3,1);
Site = rand(N/3,D) < proM/D;
mu = rand(N/3,D);
temp = Site & mu<=0.5;
OffspringDec(temp) = OffspringDec(temp)+(Upper(temp)-Lower(temp)).*((2.*mu(temp)+(1-2.*mu(temp)).*...
(1-(OffspringDec(temp)-Lower(temp))./(Upper(temp)-Lower(temp))).^(disM+1)).^(1/(disM+1))-1);
temp = Site & mu>0.5;
OffspringDec(temp) = OffspringDec(temp)+(Upper(temp)-Lower(temp)).*(1-(2.*(1-mu(temp))+2.*(mu(temp)-0.5).*...
(1-(Upper(temp)-OffspringDec(temp))./(Upper(temp)-Lower(temp))).^(disM+1)).^(1/(disM+1)));


end
Loading

0 comments on commit 5d20f54

Please sign in to comment.