├── LICENSE ├── README.md └── 多目标灰狼优化算法 ├── CreateEmptyParticle.m ├── CreateHypercubes.m ├── DeleteFromRep.m ├── DetermineDomination.m ├── Dominates.m ├── GetCosts.m ├── GetGridIndex.m ├── GetNonDominatedParticles.m ├── GetOccupiedCells.m ├── MOGWO.m ├── RouletteWheelSelection.m ├── SelectLeader.m ├── cec09.m ├── license.txt ├── results.mat └── xboundary.m /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Multi-objective-gray-wolf-optimization-algorithm 2 | 多目标灰狼优化算法 3 | -------------------------------------------------------------------------------- /多目标灰狼优化算法/CreateEmptyParticle.m: -------------------------------------------------------------------------------- 1 | %___________________________________________________________________% 2 | % Multi-Objective Grey Wolf Optimizer (MOGWO) % 3 | % Source codes demo version 1.0 % 4 | % % 5 | % Developed in MATLAB R2011b(7.13) % 6 | % % 7 | % Author and programmer: Seyedali Mirjalili % 8 | % % 9 | % e-Mail: ali.mirjalili@gmail.com % 10 | % seyedali.mirjalili@griffithuni.edu.au % 11 | % % 12 | % Homepage: http://www.alimirjalili.com % 13 | % % 14 | % Main paper: % 15 | % % 16 | % S. Mirjalili, S. Saremi, S. M. Mirjalili, L. Coelho, % 17 | % Multi-objective grey wolf optimizer: A novel algorithm for % 18 | % multi-criterion optimization, Expert Systems with Applications,% 19 | % in press, DOI: http://dx.doi.org/10.1016/j.eswa.2015.10.039 % % 20 | % % 21 | %___________________________________________________________________% 22 | 23 | % I acknowledge that this version of MOGWO has been written using 24 | % a large portion of the following code: 25 | 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | % MATLAB Code for % 28 | % % 29 | % Multi-Objective Particle Swarm Optimization (MOPSO) % 30 | % Version 1.0 - Feb. 2011 % 31 | % % 32 | % According to: % 33 | % Carlos A. Coello Coello et al., % 34 | % "Handling Multiple Objectives with Particle Swarm Optimization," % 35 | % IEEE Transactions on Evolutionary Computation, Vol. 8, No. 3, % 36 | % pp. 256-279, June 2004. % 37 | % % 38 | % Developed Using MATLAB R2009b (Version 7.9) % 39 | % % 40 | % Programmed By: S. Mostapha Kalami Heris % 41 | % % 42 | % e-Mail: sm.kalami@gmail.com % 43 | % kalami@ee.kntu.ac.ir % 44 | % % 45 | % Homepage: http://www.kalami.ir % 46 | % % 47 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 48 | 49 | function particle=CreateEmptyParticle(n) 50 | 51 | if nargin<1 52 | n=1; 53 | end 54 | 55 | empty_particle.Position=[]; 56 | empty_particle.Velocity=[]; 57 | empty_particle.Cost=[]; 58 | empty_particle.Dominated=false; 59 | empty_particle.Best.Position=[]; 60 | empty_particle.Best.Cost=[]; 61 | empty_particle.GridIndex=[]; 62 | empty_particle.GridSubIndex=[]; 63 | 64 | particle=repmat(empty_particle,n,1); 65 | 66 | end -------------------------------------------------------------------------------- /多目标灰狼优化算法/CreateHypercubes.m: -------------------------------------------------------------------------------- 1 | %___________________________________________________________________% 2 | % Multi-Objective Grey Wolf Optimizer (MOGWO) % 3 | % Source codes demo version 1.0 % 4 | % % 5 | % Developed in MATLAB R2011b(7.13) % 6 | % % 7 | % Author and programmer: Seyedali Mirjalili % 8 | % % 9 | % e-Mail: ali.mirjalili@gmail.com % 10 | % seyedali.mirjalili@griffithuni.edu.au % 11 | % % 12 | % Homepage: http://www.alimirjalili.com % 13 | % % 14 | % Main paper: % 15 | % % 16 | % S. Mirjalili, S. Saremi, S. M. Mirjalili, L. Coelho, % 17 | % Multi-objective grey wolf optimizer: A novel algorithm for % 18 | % multi-criterion optimization, Expert Systems with Applications,% 19 | % in press, DOI: http://dx.doi.org/10.1016/j.eswa.2015.10.039 % % 20 | % % 21 | %___________________________________________________________________% 22 | 23 | % I acknowledge that this version of MOGWO has been written using 24 | % a large portion of the following code: 25 | 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | % MATLAB Code for % 28 | % % 29 | % Multi-Objective Particle Swarm Optimization (MOPSO) % 30 | % Version 1.0 - Feb. 2011 % 31 | % % 32 | % According to: % 33 | % Carlos A. Coello Coello et al., % 34 | % "Handling Multiple Objectives with Particle Swarm Optimization," % 35 | % IEEE Transactions on Evolutionary Computation, Vol. 8, No. 3, % 36 | % pp. 256-279, June 2004. % 37 | % % 38 | % Developed Using MATLAB R2009b (Version 7.9) % 39 | % % 40 | % Programmed By: S. Mostapha Kalami Heris % 41 | % % 42 | % e-Mail: sm.kalami@gmail.com % 43 | % kalami@ee.kntu.ac.ir % 44 | % % 45 | % Homepage: http://www.kalami.ir % 46 | % % 47 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 48 | 49 | function G=CreateHypercubes(costs,ngrid,alpha) 50 | 51 | nobj=size(costs,1); 52 | 53 | empty_grid.Lower=[]; 54 | empty_grid.Upper=[]; 55 | G=repmat(empty_grid,nobj,1); 56 | 57 | for j=1:nobj 58 | 59 | min_cj=min(costs(j,:)); 60 | max_cj=max(costs(j,:)); 61 | 62 | dcj=alpha*(max_cj-min_cj); 63 | 64 | min_cj=min_cj-dcj; 65 | max_cj=max_cj+dcj; 66 | 67 | gx=linspace(min_cj,max_cj,ngrid-1); 68 | 69 | G(j).Lower=[-inf gx]; 70 | G(j).Upper=[gx inf]; 71 | 72 | end 73 | 74 | end -------------------------------------------------------------------------------- /多目标灰狼优化算法/DeleteFromRep.m: -------------------------------------------------------------------------------- 1 | %___________________________________________________________________% 2 | % Multi-Objective Grey Wolf Optimizer (MOGWO) % 3 | % Source codes demo version 1.0 % 4 | % % 5 | % Developed in MATLAB R2011b(7.13) % 6 | % % 7 | % Author and programmer: Seyedali Mirjalili % 8 | % % 9 | % e-Mail: ali.mirjalili@gmail.com % 10 | % seyedali.mirjalili@griffithuni.edu.au % 11 | % % 12 | % Homepage: http://www.alimirjalili.com % 13 | % % 14 | % Main paper: % 15 | % % 16 | % S. Mirjalili, S. Saremi, S. M. Mirjalili, L. Coelho, % 17 | % Multi-objective grey wolf optimizer: A novel algorithm for % 18 | % multi-criterion optimization, Expert Systems with Applications,% 19 | % in press, DOI: http://dx.doi.org/10.1016/j.eswa.2015.10.039 % % 20 | % % 21 | %___________________________________________________________________% 22 | 23 | % I acknowledge that this version of MOGWO has been written using 24 | % a large portion of the following code: 25 | 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | % MATLAB Code for % 28 | % % 29 | % Multi-Objective Particle Swarm Optimization (MOPSO) % 30 | % Version 1.0 - Feb. 2011 % 31 | % % 32 | % According to: % 33 | % Carlos A. Coello Coello et al., % 34 | % "Handling Multiple Objectives with Particle Swarm Optimization," % 35 | % IEEE Transactions on Evolutionary Computation, Vol. 8, No. 3, % 36 | % pp. 256-279, June 2004. % 37 | % % 38 | % Developed Using MATLAB R2009b (Version 7.9) % 39 | % % 40 | % Programmed By: S. Mostapha Kalami Heris % 41 | % % 42 | % e-Mail: sm.kalami@gmail.com % 43 | % kalami@ee.kntu.ac.ir % 44 | % % 45 | % Homepage: http://www.kalami.ir % 46 | % % 47 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 48 | 49 | function rep=DeleteFromRep(rep,EXTRA,gamma) 50 | 51 | if nargin<3 52 | gamma=1; 53 | end 54 | 55 | for k=1:EXTRA 56 | [occ_cell_index occ_cell_member_count]=GetOccupiedCells(rep); 57 | 58 | p=occ_cell_member_count.^gamma; 59 | p=p/sum(p); 60 | 61 | selected_cell_index=occ_cell_index(RouletteWheelSelection(p)); 62 | 63 | GridIndices=[rep.GridIndex]; 64 | 65 | selected_cell_members=find(GridIndices==selected_cell_index); 66 | 67 | n=numel(selected_cell_members); 68 | 69 | selected_memebr_index=randi([1 n]); 70 | 71 | j=selected_cell_members(selected_memebr_index); 72 | 73 | rep=[rep(1:j-1); rep(j+1:end)]; 74 | end 75 | 76 | end -------------------------------------------------------------------------------- /多目标灰狼优化算法/DetermineDomination.m: -------------------------------------------------------------------------------- 1 | %___________________________________________________________________% 2 | % Multi-Objective Grey Wolf Optimizer (MOGWO) % 3 | % Source codes demo version 1.0 % 4 | % % 5 | % Developed in MATLAB R2011b(7.13) % 6 | % % 7 | % Author and programmer: Seyedali Mirjalili % 8 | % % 9 | % e-Mail: ali.mirjalili@gmail.com % 10 | % seyedali.mirjalili@griffithuni.edu.au % 11 | % % 12 | % Homepage: http://www.alimirjalili.com % 13 | % % 14 | % Main paper: % 15 | % % 16 | % S. Mirjalili, S. Saremi, S. M. Mirjalili, L. Coelho, % 17 | % Multi-objective grey wolf optimizer: A novel algorithm for % 18 | % multi-criterion optimization, Expert Systems with Applications,% 19 | % in press, DOI: http://dx.doi.org/10.1016/j.eswa.2015.10.039 % % 20 | % % 21 | %___________________________________________________________________% 22 | 23 | % I acknowledge that this version of MOGWO has been written using 24 | % a large portion of the following code: 25 | 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | % MATLAB Code for % 28 | % % 29 | % Multi-Objective Particle Swarm Optimization (MOPSO) % 30 | % Version 1.0 - Feb. 2011 % 31 | % % 32 | % According to: % 33 | % Carlos A. Coello Coello et al., % 34 | % "Handling Multiple Objectives with Particle Swarm Optimization," % 35 | % IEEE Transactions on Evolutionary Computation, Vol. 8, No. 3, % 36 | % pp. 256-279, June 2004. % 37 | % % 38 | % Developed Using MATLAB R2009b (Version 7.9) % 39 | % % 40 | % Programmed By: S. Mostapha Kalami Heris % 41 | % % 42 | % e-Mail: sm.kalami@gmail.com % 43 | % kalami@ee.kntu.ac.ir % 44 | % % 45 | % Homepage: http://www.kalami.ir % 46 | % % 47 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 48 | 49 | function pop=DetermineDomination(pop) 50 | 51 | npop=numel(pop); 52 | 53 | for i=1:npop 54 | pop(i).Dominated=false; 55 | for j=1:i-1 56 | if ~pop(j).Dominated 57 | if Dominates(pop(i),pop(j)) 58 | pop(j).Dominated=true; 59 | elseif Dominates(pop(j),pop(i)) 60 | pop(i).Dominated=true; 61 | break; 62 | end 63 | end 64 | end 65 | end 66 | 67 | end -------------------------------------------------------------------------------- /多目标灰狼优化算法/Dominates.m: -------------------------------------------------------------------------------- 1 | %___________________________________________________________________% 2 | % Multi-Objective Grey Wolf Optimizer (MOGWO) % 3 | % Source codes demo version 1.0 % 4 | % % 5 | % Developed in MATLAB R2011b(7.13) % 6 | % % 7 | % Author and programmer: Seyedali Mirjalili % 8 | % % 9 | % e-Mail: ali.mirjalili@gmail.com % 10 | % seyedali.mirjalili@griffithuni.edu.au % 11 | % % 12 | % Homepage: http://www.alimirjalili.com % 13 | % % 14 | % Main paper: % 15 | % % 16 | % S. Mirjalili, S. Saremi, S. M. Mirjalili, L. Coelho, % 17 | % Multi-objective grey wolf optimizer: A novel algorithm for % 18 | % multi-criterion optimization, Expert Systems with Applications,% 19 | % in press, DOI: http://dx.doi.org/10.1016/j.eswa.2015.10.039 % % 20 | % % 21 | %___________________________________________________________________% 22 | 23 | % I acknowledge that this version of MOGWO has been written using 24 | % a large portion of the following code: 25 | 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | % MATLAB Code for % 28 | % % 29 | % Multi-Objective Particle Swarm Optimization (MOPSO) % 30 | % Version 1.0 - Feb. 2011 % 31 | % % 32 | % According to: % 33 | % Carlos A. Coello Coello et al., % 34 | % "Handling Multiple Objectives with Particle Swarm Optimization," % 35 | % IEEE Transactions on Evolutionary Computation, Vol. 8, No. 3, % 36 | % pp. 256-279, June 2004. % 37 | % % 38 | % Developed Using MATLAB R2009b (Version 7.9) % 39 | % % 40 | % Programmed By: S. Mostapha Kalami Heris % 41 | % % 42 | % e-Mail: sm.kalami@gmail.com % 43 | % kalami@ee.kntu.ac.ir % 44 | % % 45 | % Homepage: http://www.kalami.ir % 46 | % % 47 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 48 | 49 | function dom=Dominates(x,y) 50 | 51 | if isstruct(x) 52 | x=x.Cost; 53 | end 54 | 55 | if isstruct(y) 56 | y=y.Cost; 57 | end 58 | 59 | dom=all(x<=y) && any(x1 121 | counter=0; 122 | for newi=1:size(Archive,1) 123 | if sum(Delta.Position~=Archive(newi).Position)~=0 124 | counter=counter+1; 125 | rep2(counter,1)=Archive(newi); 126 | end 127 | end 128 | Beta=SelectLeader(rep2,beta); 129 | end 130 | 131 | % This scenario is the same if the second least crowded hypercube 132 | % has one solution, so the delta leader should be chosen from the 133 | % third least crowded hypercube. 134 | if size(Archive,1)>2 135 | counter=0; 136 | for newi=1:size(rep2,1) 137 | if sum(Beta.Position~=rep2(newi).Position)~=0 138 | counter=counter+1; 139 | rep3(counter,1)=rep2(newi); 140 | end 141 | end 142 | Alpha=SelectLeader(rep3,beta); 143 | end 144 | 145 | % Eq.(3.4) in the paper 146 | c=2.*rand(1, nVar); 147 | % Eq.(3.1) in the paper 148 | D=abs(c.*Delta.Position-GreyWolves(i).Position); 149 | % Eq.(3.3) in the paper 150 | A=2.*a.*rand(1, nVar)-a; 151 | % Eq.(3.8) in the paper 152 | X1=Delta.Position-A.*abs(D); 153 | 154 | 155 | % Eq.(3.4) in the paper 156 | c=2.*rand(1, nVar); 157 | % Eq.(3.1) in the paper 158 | D=abs(c.*Beta.Position-GreyWolves(i).Position); 159 | % Eq.(3.3) in the paper 160 | A=2.*a.*rand()-a; 161 | % Eq.(3.9) in the paper 162 | X2=Beta.Position-A.*abs(D); 163 | 164 | 165 | % Eq.(3.4) in the paper 166 | c=2.*rand(1, nVar); 167 | % Eq.(3.1) in the paper 168 | D=abs(c.*Alpha.Position-GreyWolves(i).Position); 169 | % Eq.(3.3) in the paper 170 | A=2.*a.*rand()-a; 171 | % Eq.(3.10) in the paper 172 | X3=Alpha.Position-A.*abs(D); 173 | 174 | % Eq.(3.11) in the paper 175 | GreyWolves(i).Position=(X1+X2+X3)./3; 176 | 177 | % Boundary checking 178 | GreyWolves(i).Position=min(max(GreyWolves(i).Position,lb),ub); 179 | 180 | GreyWolves(i).Cost=fobj(GreyWolves(i).Position')'; 181 | end 182 | 183 | GreyWolves=DetermineDomination(GreyWolves); 184 | non_dominated_wolves=GetNonDominatedParticles(GreyWolves); 185 | 186 | Archive=[Archive 187 | non_dominated_wolves]; 188 | 189 | Archive=DetermineDomination(Archive); 190 | Archive=GetNonDominatedParticles(Archive); 191 | 192 | for i=1:numel(Archive) 193 | [Archive(i).GridIndex Archive(i).GridSubIndex]=GetGridIndex(Archive(i),G); 194 | end 195 | 196 | if numel(Archive)>Archive_size 197 | EXTRA=numel(Archive)-Archive_size; 198 | Archive=DeleteFromRep(Archive,EXTRA,gamma); 199 | 200 | Archive_costs=GetCosts(Archive); 201 | G=CreateHypercubes(Archive_costs,nGrid,alpha); 202 | 203 | end 204 | 205 | disp(['In iteration ' num2str(it) ': Number of solutions in the archive = ' num2str(numel(Archive))]); 206 | save results 207 | 208 | % Results 209 | 210 | costs=GetCosts(GreyWolves); 211 | Archive_costs=GetCosts(Archive); 212 | 213 | if drawing_flag==1 214 | hold off 215 | plot(costs(1,:),costs(2,:),'k.'); 216 | hold on 217 | plot(Archive_costs(1,:),Archive_costs(2,:),'rd'); 218 | legend('Grey wolves','Non-dominated solutions'); 219 | drawnow 220 | end 221 | 222 | end 223 | 224 | 225 | -------------------------------------------------------------------------------- /多目标灰狼优化算法/RouletteWheelSelection.m: -------------------------------------------------------------------------------- 1 | %___________________________________________________________________% 2 | % Multi-Objective Grey Wolf Optimizer (MOGWO) % 3 | % Source codes demo version 1.0 % 4 | % % 5 | % Developed in MATLAB R2011b(7.13) % 6 | % % 7 | % Author and programmer: Seyedali Mirjalili % 8 | % % 9 | % e-Mail: ali.mirjalili@gmail.com % 10 | % seyedali.mirjalili@griffithuni.edu.au % 11 | % % 12 | % Homepage: http://www.alimirjalili.com % 13 | % % 14 | % Main paper: % 15 | % % 16 | % S. Mirjalili, S. Saremi, S. M. Mirjalili, L. Coelho, % 17 | % Multi-objective grey wolf optimizer: A novel algorithm for % 18 | % multi-criterion optimization, Expert Systems with Applications,% 19 | % in press, DOI: http://dx.doi.org/10.1016/j.eswa.2015.10.039 % % 20 | % % 21 | %___________________________________________________________________% 22 | 23 | % I acknowledge that this version of MOGWO has been written using 24 | % a large portion of the following code: 25 | 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | % MATLAB Code for % 28 | % % 29 | % Multi-Objective Particle Swarm Optimization (MOPSO) % 30 | % Version 1.0 - Feb. 2011 % 31 | % % 32 | % According to: % 33 | % Carlos A. Coello Coello et al., % 34 | % "Handling Multiple Objectives with Particle Swarm Optimization," % 35 | % IEEE Transactions on Evolutionary Computation, Vol. 8, No. 3, % 36 | % pp. 256-279, June 2004. % 37 | % % 38 | % Developed Using MATLAB R2009b (Version 7.9) % 39 | % % 40 | % Programmed By: S. Mostapha Kalami Heris % 41 | % % 42 | % e-Mail: sm.kalami@gmail.com % 43 | % kalami@ee.kntu.ac.ir % 44 | % % 45 | % Homepage: http://www.kalami.ir % 46 | % % 47 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 48 | 49 | function i=RouletteWheelSelection(p) 50 | 51 | r=rand; 52 | c=cumsum(p); 53 | i=find(r<=c,1,'first'); 54 | 55 | end -------------------------------------------------------------------------------- /多目标灰狼优化算法/SelectLeader.m: -------------------------------------------------------------------------------- 1 | %___________________________________________________________________% 2 | % Multi-Objective Grey Wolf Optimizer (MOGWO) % 3 | % Source codes demo version 1.0 % 4 | % % 5 | % Developed in MATLAB R2011b(7.13) % 6 | % % 7 | % Author and programmer: Seyedali Mirjalili % 8 | % % 9 | % e-Mail: ali.mirjalili@gmail.com % 10 | % seyedali.mirjalili@griffithuni.edu.au % 11 | % % 12 | % Homepage: http://www.alimirjalili.com % 13 | % % 14 | % Main paper: % 15 | % % 16 | % S. Mirjalili, S. Saremi, S. M. Mirjalili, L. Coelho, % 17 | % Multi-objective grey wolf optimizer: A novel algorithm for % 18 | % multi-criterion optimization, Expert Systems with Applications,% 19 | % in press, DOI: http://dx.doi.org/10.1016/j.eswa.2015.10.039 % % 20 | % % 21 | %___________________________________________________________________% 22 | 23 | % I acknowledge that this version of MOGWO has been written using 24 | % a large portion of the following code: 25 | 26 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 27 | % MATLAB Code for % 28 | % % 29 | % Multi-Objective Particle Swarm Optimization (MOPSO) % 30 | % Version 1.0 - Feb. 2011 % 31 | % % 32 | % According to: % 33 | % Carlos A. Coello Coello et al., % 34 | % "Handling Multiple Objectives with Particle Swarm Optimization," % 35 | % IEEE Transactions on Evolutionary Computation, Vol. 8, No. 3, % 36 | % pp. 256-279, June 2004. % 37 | % % 38 | % Developed Using MATLAB R2009b (Version 7.9) % 39 | % % 40 | % Programmed By: S. Mostapha Kalami Heris % 41 | % % 42 | % e-Mail: sm.kalami@gmail.com % 43 | % kalami@ee.kntu.ac.ir % 44 | % % 45 | % Homepage: http://www.kalami.ir % 46 | % % 47 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 48 | 49 | function rep_h=SelectLeader(rep,beta) 50 | if nargin<2 51 | beta=1; 52 | end 53 | 54 | [occ_cell_index occ_cell_member_count]=GetOccupiedCells(rep); 55 | 56 | p=occ_cell_member_count.^(-beta); 57 | p=p/sum(p); 58 | 59 | selected_cell_index=occ_cell_index(RouletteWheelSelection(p)); 60 | 61 | GridIndices=[rep.GridIndex]; 62 | 63 | selected_cell_members=find(GridIndices==selected_cell_index); 64 | 65 | n=numel(selected_cell_members); 66 | 67 | selected_memebr_index=randi([1 n]); 68 | 69 | h=selected_cell_members(selected_memebr_index); 70 | 71 | rep_h=rep(h); 72 | end -------------------------------------------------------------------------------- /多目标灰狼优化算法/cec09.m: -------------------------------------------------------------------------------- 1 | % cec09.m 2 | % 3 | % The Matlab version of the test instances for CEC 2009 Multiobjective 4 | % Optimization Competition. 5 | % 6 | % Usage: fobj = cec09(problem_name), the handle of the function will be 7 | % with fobj 8 | % 9 | % Please refer to the report for correct one if the source codes are not 10 | % consist with the report. 11 | % History: 12 | % v1 Sept.08 2008 13 | % v2 Nov.18 2008 14 | % v3 Nov.26 2008 15 | 16 | function fobj = cec09(name) 17 | 18 | switch name 19 | case 'UF1' 20 | fobj = @UF1; 21 | case 'UF2' 22 | fobj = @UF2; 23 | case 'UF3' 24 | fobj = @UF3; 25 | case 'UF4' 26 | fobj = @UF4; 27 | case 'UF5' 28 | fobj = @UF5; 29 | case 'UF6' 30 | fobj = @UF6; 31 | case 'UF7' 32 | fobj = @UF7; 33 | case 'UF8' 34 | fobj = @UF8; 35 | case 'UF9' 36 | fobj = @UF9; 37 | case 'UF10' 38 | fobj = @UF10; 39 | case 'CF1' 40 | fobj = @CF1; 41 | case 'CF2' 42 | fobj = @CF2; 43 | case 'CF3' 44 | fobj = @CF3; 45 | case 'CF4' 46 | fobj = @CF4; 47 | case 'CF5' 48 | fobj = @CF5; 49 | case 'CF6' 50 | fobj = @CF6; 51 | case 'CF7' 52 | fobj = @CF7; 53 | case 'CF8' 54 | fobj = @CF8; 55 | case 'CF9' 56 | fobj = @CF9; 57 | case 'CF10' 58 | fobj = @CF10; 59 | otherwise 60 | fobj = @UF1; 61 | end 62 | end 63 | 64 | %% UF1 65 | % x and y are columnwise, the imput x must be inside the search space and 66 | % it could be a matrix 67 | function y = UF1(x) 68 | [dim, num] = size(x); 69 | tmp = zeros(dim,num); 70 | tmp(2:dim,:)= (x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]))).^2; 71 | tmp1 = sum(tmp(3:2:dim,:)); % odd index 72 | tmp2 = sum(tmp(2:2:dim,:)); % even index 73 | y(1,:) = x(1,:) + 2.0*tmp1/size(3:2:dim,2); 74 | y(2,:) = 1.0 - sqrt(x(1,:)) + 2.0*tmp2/size(2:2:dim,2); 75 | clear tmp; 76 | end 77 | 78 | %% UF2 79 | % x and y are columnwise, the imput x must be inside the search space and 80 | % it could be a matrix 81 | function y = UF2(x) 82 | [dim, num] = size(x); 83 | X1 = repmat(x(1,:),[dim-1,1]); 84 | A = 6*pi*X1 + pi/dim*repmat((2:dim)',[1,num]); 85 | tmp = zeros(dim,num); 86 | tmp(2:dim,:)= (x(2:dim,:) - 0.3*X1.*(X1.*cos(4.0*A)+2.0).*cos(A)).^2; 87 | tmp1 = sum(tmp(3:2:dim,:)); % odd index 88 | tmp(2:dim,:)= (x(2:dim,:) - 0.3*X1.*(X1.*cos(4.0*A)+2.0).*sin(A)).^2; 89 | tmp2 = sum(tmp(2:2:dim,:)); % even index 90 | y(1,:) = x(1,:) + 2.0*tmp1/size(3:2:dim,2); 91 | y(2,:) = 1.0 - sqrt(x(1,:)) + 2.0*tmp2/size(2:2:dim,2); 92 | clear X1 A tmp; 93 | end 94 | 95 | %% UF3 96 | % x and y are columnwise, the imput x must be inside the search space and 97 | % it could be a matrix 98 | function y = UF3(x) 99 | [dim, num] = size(x); 100 | Y = zeros(dim,num); 101 | Y(2:dim,:) = x(2:dim,:) - repmat(x(1,:),[dim-1,1]).^(0.5+1.5*(repmat((2:dim)',[1,num])-2.0)/(dim-2.0)); 102 | tmp1 = zeros(dim,num); 103 | tmp1(2:dim,:)= Y(2:dim,:).^2; 104 | tmp2 = zeros(dim,num); 105 | tmp2(2:dim,:)= cos(20.0*pi*Y(2:dim,:)./sqrt(repmat((2:dim)',[1,num]))); 106 | tmp11 = 4.0*sum(tmp1(3:2:dim,:)) - 2.0*prod(tmp2(3:2:dim,:)) + 2.0; % odd index 107 | tmp21 = 4.0*sum(tmp1(2:2:dim,:)) - 2.0*prod(tmp2(2:2:dim,:)) + 2.0; % even index 108 | y(1,:) = x(1,:) + 2.0*tmp11/size(3:2:dim,2); 109 | y(2,:) = 1.0 - sqrt(x(1,:)) + 2.0*tmp21/size(2:2:dim,2); 110 | clear Y tmp1 tmp2; 111 | end 112 | 113 | %% UF4 114 | % x and y are columnwise, the imput x must be inside the search space and 115 | % it could be a matrix 116 | function y = UF4(x) 117 | [dim, num] = size(x); 118 | Y = zeros(dim,num); 119 | Y(2:dim,:) = x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num])); 120 | H = zeros(dim,num); 121 | H(2:dim,:) = abs(Y(2:dim,:))./(1.0+exp(2.0*abs(Y(2:dim,:)))); 122 | tmp1 = sum(H(3:2:dim,:)); % odd index 123 | tmp2 = sum(H(2:2:dim,:)); % even index 124 | y(1,:) = x(1,:) + 2.0*tmp1/size(3:2:dim,2); 125 | y(2,:) = 1.0 - x(1,:).^2 + 2.0*tmp2/size(2:2:dim,2); 126 | clear Y H; 127 | end 128 | 129 | %% UF5 130 | % x and y are columnwise, the imput x must be inside the search space and 131 | % it could be a matrix 132 | function y = UF5(x) 133 | N = 10.0; 134 | E = 0.1; 135 | [dim, num] = size(x); 136 | Y = zeros(dim,num); 137 | Y(2:dim,:) = x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num])); 138 | H = zeros(dim,num); 139 | H(2:dim,:) = 2.0*Y(2:dim,:).^2 - cos(4.0*pi*Y(2:dim,:)) + 1.0; 140 | tmp1 = sum(H(3:2:dim,:)); % odd index 141 | tmp2 = sum(H(2:2:dim,:)); % even index 142 | tmp = (0.5/N+E)*abs(sin(2.0*N*pi*x(1,:))); 143 | y(1,:) = x(1,:) + tmp + 2.0*tmp1/size(3:2:dim,2); 144 | y(2,:) = 1.0 - x(1,:)+ tmp + 2.0*tmp2/size(2:2:dim,2); 145 | clear Y H; 146 | end 147 | 148 | %% UF6 149 | % x and y are columnwise, the imput x must be inside the search space and 150 | % it could be a matrix 151 | function y = UF6(x) 152 | N = 2.0; 153 | E = 0.1; 154 | [dim, num] = size(x); 155 | Y = zeros(dim,num); 156 | Y(2:dim,:) = x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num])); 157 | tmp1 = zeros(dim,num); 158 | tmp1(2:dim,:)= Y(2:dim,:).^2; 159 | tmp2 = zeros(dim,num); 160 | tmp2(2:dim,:)= cos(20.0*pi*Y(2:dim,:)./sqrt(repmat((2:dim)',[1,num]))); 161 | tmp11 = 4.0*sum(tmp1(3:2:dim,:)) - 2.0*prod(tmp2(3:2:dim,:)) + 2.0; % odd index 162 | tmp21 = 4.0*sum(tmp1(2:2:dim,:)) - 2.0*prod(tmp2(2:2:dim,:)) + 2.0; % even index 163 | tmp = max(0,(1.0/N+2.0*E)*sin(2.0*N*pi*x(1,:))); 164 | y(1,:) = x(1,:) + tmp + 2.0*tmp11/size(3:2:dim,2); 165 | y(2,:) = 1.0 - x(1,:) + tmp + 2.0*tmp21/size(2:2:dim,2); 166 | clear Y tmp1 tmp2; 167 | end 168 | 169 | %% UF7 170 | % x and y are columnwise, the imput x must be inside the search space and 171 | % it could be a matrix 172 | function y = UF7(x) 173 | [dim, num] = size(x); 174 | Y = zeros(dim,num); 175 | Y(2:dim,:) = (x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]))).^2; 176 | tmp1 = sum(Y(3:2:dim,:)); % odd index 177 | tmp2 = sum(Y(2:2:dim,:)); % even index 178 | tmp = (x(1,:)).^0.2; 179 | y(1,:) = tmp + 2.0*tmp1/size(3:2:dim,2); 180 | y(2,:) = 1.0 - tmp + 2.0*tmp2/size(2:2:dim,2); 181 | clear Y; 182 | end 183 | 184 | %% UF8 185 | % x and y are columnwise, the imput x must be inside the search space and 186 | % it could be a matrix 187 | function y = UF8(x) 188 | [dim, num] = size(x); 189 | Y = zeros(dim,num); 190 | Y(3:dim,:) = (x(3:dim,:) - 2.0*repmat(x(2,:),[dim-2,1]).*sin(2.0*pi*repmat(x(1,:),[dim-2,1]) + pi/dim*repmat((3:dim)',[1,num]))).^2; 191 | tmp1 = sum(Y(4:3:dim,:)); % j-1 = 3*k 192 | tmp2 = sum(Y(5:3:dim,:)); % j-2 = 3*k 193 | tmp3 = sum(Y(3:3:dim,:)); % j-0 = 3*k 194 | y(1,:) = cos(0.5*pi*x(1,:)).*cos(0.5*pi*x(2,:)) + 2.0*tmp1/size(4:3:dim,2); 195 | y(2,:) = cos(0.5*pi*x(1,:)).*sin(0.5*pi*x(2,:)) + 2.0*tmp2/size(5:3:dim,2); 196 | y(3,:) = sin(0.5*pi*x(1,:)) + 2.0*tmp3/size(3:3:dim,2); 197 | clear Y; 198 | end 199 | 200 | %% UF9 201 | % x and y are columnwise, the imput x must be inside the search space and 202 | % it could be a matrix 203 | function y = UF9(x) 204 | E = 0.1; 205 | [dim, num] = size(x); 206 | Y = zeros(dim,num); 207 | Y(3:dim,:) = (x(3:dim,:) - 2.0*repmat(x(2,:),[dim-2,1]).*sin(2.0*pi*repmat(x(1,:),[dim-2,1]) + pi/dim*repmat((3:dim)',[1,num]))).^2; 208 | tmp1 = sum(Y(4:3:dim,:)); % j-1 = 3*k 209 | tmp2 = sum(Y(5:3:dim,:)); % j-2 = 3*k 210 | tmp3 = sum(Y(3:3:dim,:)); % j-0 = 3*k 211 | tmp = max(0,(1.0+E)*(1-4.0*(2.0*x(1,:)-1).^2)); 212 | y(1,:) = 0.5*(tmp+2*x(1,:)).*x(2,:) + 2.0*tmp1/size(4:3:dim,2); 213 | y(2,:) = 0.5*(tmp-2*x(1,:)+2.0).*x(2,:) + 2.0*tmp2/size(5:3:dim,2); 214 | y(3,:) = 1-x(2,:) + 2.0*tmp3/size(3:3:dim,2); 215 | clear Y; 216 | end 217 | 218 | %% UF10 219 | % x and y are columnwise, the imput x must be inside the search space and 220 | % it could be a matrix 221 | function y = UF10(x) 222 | [dim, num] = size(x); 223 | Y = zeros(dim,num); 224 | Y(3:dim,:) = x(3:dim,:) - 2.0*repmat(x(2,:),[dim-2,1]).*sin(2.0*pi*repmat(x(1,:),[dim-2,1]) + pi/dim*repmat((3:dim)',[1,num])); 225 | H = zeros(dim,num); 226 | H(3:dim,:) = 4.0*Y(3:dim,:).^2 - cos(8.0*pi*Y(3:dim,:)) + 1.0; 227 | tmp1 = sum(H(4:3:dim,:)); % j-1 = 3*k 228 | tmp2 = sum(H(5:3:dim,:)); % j-2 = 3*k 229 | tmp3 = sum(H(3:3:dim,:)); % j-0 = 3*k 230 | y(1,:) = cos(0.5*pi*x(1,:)).*cos(0.5*pi*x(2,:)) + 2.0*tmp1/size(4:3:dim,2); 231 | y(2,:) = cos(0.5*pi*x(1,:)).*sin(0.5*pi*x(2,:)) + 2.0*tmp2/size(5:3:dim,2); 232 | y(3,:) = sin(0.5*pi*x(1,:)) + 2.0*tmp3/size(3:3:dim,2); 233 | clear Y H; 234 | end 235 | 236 | %% CF1 237 | % x and y are columnwise, the imput x must be inside the search space and 238 | % it could be a matrix 239 | function [y,c] = CF1(x) 240 | a = 1.0; 241 | N = 10.0; 242 | [dim, num] = size(x); 243 | Y = zeros(dim,num); 244 | Y(2:dim,:) = (x(2:dim,:) - repmat(x(1,:),[dim-1,1]).^(0.5+1.5*(repmat((2:dim)',[1,num])-2.0)/(dim-2.0))).^2; 245 | tmp1 = sum(Y(3:2:dim,:));% odd index 246 | tmp2 = sum(Y(2:2:dim,:));% even index 247 | y(1,:) = x(1,:) + 2.0*tmp1/size(3:2:dim,2); 248 | y(2,:) = 1.0 - x(1,:) + 2.0*tmp2/size(2:2:dim,2); 249 | c(1,:) = y(1,:) + y(2,:) - a*abs(sin(N*pi*(y(1,:)-y(2,:)+1.0))) - 1.0; 250 | clear Y; 251 | end 252 | 253 | %% CF2 254 | % x and y are columnwise, the imput x must be inside the search space and 255 | % it could be a matrix 256 | function [y,c] = CF2(x) 257 | a = 1.0; 258 | N = 2.0; 259 | [dim, num] = size(x); 260 | tmp = zeros(dim,num); 261 | tmp(2:dim,:)= (x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]))).^2; 262 | tmp1 = sum(tmp(3:2:dim,:)); % odd index 263 | tmp(2:dim,:)= (x(2:dim,:) - cos(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]))).^2; 264 | tmp2 = sum(tmp(2:2:dim,:)); % even index 265 | y(1,:) = x(1,:) + 2.0*tmp1/size(3:2:dim,2); 266 | y(2,:) = 1.0 - sqrt(x(1,:)) + 2.0*tmp2/size(2:2:dim,2); 267 | t = y(2,:) + sqrt(y(1,:)) - a*sin(N*pi*(sqrt(y(1,:))-y(2,:)+1.0)) - 1.0; 268 | c(1,:) = sign(t).*abs(t)./(1.0+exp(4.0*abs(t))); 269 | clear tmp; 270 | end 271 | 272 | %% CF3 273 | % x and y are columnwise, the imput x must be inside the search space and 274 | % it could be a matrix 275 | function [y,c] = CF3(x) 276 | a = 1.0; 277 | N = 2.0; 278 | [dim, num] = size(x); 279 | Y = zeros(dim,num); 280 | Y(2:dim,:) = x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num])); 281 | tmp1 = zeros(dim,num); 282 | tmp1(2:dim,:)= Y(2:dim,:).^2; 283 | tmp2 = zeros(dim,num); 284 | tmp2(2:dim,:)= cos(20.0*pi*Y(2:dim,:)./sqrt(repmat((2:dim)',[1,num]))); 285 | tmp11 = 4.0*sum(tmp1(3:2:dim,:)) - 2.0*prod(tmp2(3:2:dim,:)) + 2.0; % odd index 286 | tmp21 = 4.0*sum(tmp1(2:2:dim,:)) - 2.0*prod(tmp2(2:2:dim,:)) + 2.0; % even index 287 | y(1,:) = x(1,:) + 2.0*tmp11/size(3:2:dim,2); 288 | y(2,:) = 1.0 - x(1,:).^2 + 2.0*tmp21/size(2:2:dim,2); 289 | c(1,:) = y(2,:) + y(1,:).^2 - a*sin(N*pi*(y(1,:).^2-y(2,:)+1.0)) - 1.0; 290 | clear Y tmp1 tmp2; 291 | end 292 | 293 | %% CF4 294 | % x and y are columnwise, the imput x must be inside the search space and 295 | % it could be a matrix 296 | function [y,c] = CF4(x) 297 | [dim, num] = size(x); 298 | tmp = zeros(dim,num); 299 | tmp(2:dim,:)= x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num])); 300 | tmp1 = sum(tmp(3:2:dim,:).^2); % odd index 301 | tmp2 = sum(tmp(4:2:dim,:).^2); % even index 302 | index1 = tmp(2,:) < (1.5-0.75*sqrt(2.0)); 303 | index2 = tmp(2,:)>= (1.5-0.75*sqrt(2.0)); 304 | tmp(2,index1) = abs(tmp(2,index1)); 305 | tmp(2,index2) = 0.125 + (tmp(2,index2)-1.0).^2; 306 | y(1,:) = x(1,:) + tmp1; 307 | y(2,:) = 1.0 - x(1,:) + tmp(2,:) + tmp2; 308 | t = x(2,:) - sin(6.0*pi*x(1,:)+2.0*pi/dim) - 0.5*x(1,:) + 0.25; 309 | c(1,:) = sign(t).*abs(t)./(1.0+exp(4.0*abs(t))); 310 | clear tmp index1 index2; 311 | end 312 | 313 | %% CF5 314 | % x and y are columnwise, the imput x must be inside the search space and 315 | % it could be a matrix 316 | function [y,c] = CF5(x) 317 | [dim, num] = size(x); 318 | tmp = zeros(dim,num); 319 | tmp(2:dim,:)= x(2:dim,:) - 0.8*repmat(x(1,:),[dim-1,1]).*cos(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num])); 320 | tmp1 = sum(2.0*tmp(3:2:dim,:).^2-cos(4.0*pi*tmp(3:2:dim,:))+1.0); % odd index 321 | tmp(2:dim,:)= x(2:dim,:) - 0.8*repmat(x(1,:),[dim-1,1]).*sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num])); 322 | tmp2 = sum(2.0*tmp(4:2:dim,:).^2-cos(4.0*pi*tmp(4:2:dim,:))+1.0); % even index 323 | index1 = tmp(2,:) < (1.5-0.75*sqrt(2.0)); 324 | index2 = tmp(2,:)>= (1.5-0.75*sqrt(2.0)); 325 | tmp(2,index1) = abs(tmp(2,index1)); 326 | tmp(2,index2) = 0.125 + (tmp(2,index2)-1.0).^2; 327 | y(1,:) = x(1,:) + tmp1; 328 | y(2,:) = 1.0 - x(1,:) + tmp(2,:) + tmp2; 329 | c(1,:) = x(2,:) - 0.8*x(1,:).*sin(6.0*pi*x(1,:)+2.0*pi/dim) - 0.5*x(1,:) + 0.25; 330 | clear tmp; 331 | end 332 | 333 | %% CF6 334 | % x and y are columnwise, the imput x must be inside the search space and 335 | % it could be a matrix 336 | function [y,c] = CF6(x) 337 | [dim, num] = size(x); 338 | tmp = zeros(dim,num); 339 | tmp(2:dim,:)= x(2:dim,:) - 0.8*repmat(x(1,:),[dim-1,1]).*cos(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num])); 340 | tmp1 = sum(tmp(3:2:dim,:).^2); % odd index 341 | tmp(2:dim,:)= x(2:dim,:) - 0.8*repmat(x(1,:),[dim-1,1]).*sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num])); 342 | tmp2 = sum(tmp(2:2:dim,:).^2); % even index 343 | y(1,:) = x(1,:) + tmp1; 344 | y(2,:) = (1.0 - x(1,:)).^2 + tmp2; 345 | tmp = 0.5*(1-x(1,:))-(1-x(1,:)).^2; 346 | c(1,:) = x(2,:) - 0.8*x(1,:).*sin(6.0*pi*x(1,:)+2*pi/dim) - sign(tmp).*sqrt(abs(tmp)); 347 | tmp = 0.25*sqrt(1-x(1,:))-0.5*(1-x(1,:)); 348 | c(2,:) = x(4,:) - 0.8*x(1,:).*sin(6.0*pi*x(1,:)+4*pi/dim) - sign(tmp).*sqrt(abs(tmp)); 349 | clear tmp; 350 | end 351 | 352 | %% CF7 353 | % x and y are columnwise, the imput x must be inside the search space and 354 | % it could be a matrix 355 | function [y,c] = CF7(x) 356 | [dim, num] = size(x); 357 | tmp = zeros(dim,num); 358 | tmp(2:dim,:)= x(2:dim,:) - cos(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num])); 359 | tmp1 = sum(2.0*tmp(3:2:dim,:).^2-cos(4.0*pi*tmp(3:2:dim,:))+1.0); % odd index 360 | tmp(2:dim,:)= x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num])); 361 | tmp2 = sum(2.0*tmp(6:2:dim,:).^2-cos(4.0*pi*tmp(6:2:dim,:))+1.0); % even index 362 | tmp(2,:) = tmp(2,:).^2; 363 | tmp(4,:) = tmp(4,:).^2; 364 | y(1,:) = x(1,:) + tmp1; 365 | y(2,:) = (1.0 - x(1,:)).^2 + tmp(2,:) + tmp(4,:) + tmp2; 366 | tmp = 0.5*(1-x(1,:))-(1-x(1,:)).^2; 367 | c(1,:) = x(2,:) - sin(6.0*pi*x(1,:)+2*pi/dim) - sign(tmp).*sqrt(abs(tmp)); 368 | tmp = 0.25*sqrt(1-x(1,:))-0.5*(1-x(1,:)); 369 | c(2,:) = x(4,:) - sin(6.0*pi*x(1,:)+4*pi/dim) - sign(tmp).*sqrt(abs(tmp)); 370 | clear tmp; 371 | end 372 | 373 | %% CF8 374 | % x and y are columnwise, the imput x must be inside the search space and 375 | % it could be a matrix 376 | function [y,c] = CF8(x) 377 | N = 2.0; 378 | a = 4.0; 379 | [dim, num] = size(x); 380 | Y = zeros(dim,num); 381 | Y(3:dim,:) = (x(3:dim,:) - 2.0*repmat(x(2,:),[dim-2,1]).*sin(2.0*pi*repmat(x(1,:),[dim-2,1]) + pi/dim*repmat((3:dim)',[1,num]))).^2; 382 | tmp1 = sum(Y(4:3:dim,:)); % j-1 = 3*k 383 | tmp2 = sum(Y(5:3:dim,:)); % j-2 = 3*k 384 | tmp3 = sum(Y(3:3:dim,:)); % j-0 = 3*k 385 | y(1,:) = cos(0.5*pi*x(1,:)).*cos(0.5*pi*x(2,:)) + 2.0*tmp1/size(4:3:dim,2); 386 | y(2,:) = cos(0.5*pi*x(1,:)).*sin(0.5*pi*x(2,:)) + 2.0*tmp2/size(5:3:dim,2); 387 | y(3,:) = sin(0.5*pi*x(1,:)) + 2.0*tmp3/size(3:3:dim,2); 388 | c(1,:) = (y(1,:).^2+y(2,:).^2)./(1.0-y(3,:).^2) - a*abs(sin(N*pi*((y(1,:).^2-y(2,:).^2)./(1.0-y(3,:).^2)+1.0))) - 1.0; 389 | clear Y; 390 | end 391 | 392 | %% CF9 393 | % x and y are columnwise, the imput x must be inside the search space and 394 | % it could be a matrix 395 | function [y,c] = CF9(x) 396 | N = 2.0; 397 | a = 3.0; 398 | [dim, num] = size(x); 399 | Y = zeros(dim,num); 400 | Y(3:dim,:) = (x(3:dim,:) - 2.0*repmat(x(2,:),[dim-2,1]).*sin(2.0*pi*repmat(x(1,:),[dim-2,1]) + pi/dim*repmat((3:dim)',[1,num]))).^2; 401 | tmp1 = sum(Y(4:3:dim,:)); % j-1 = 3*k 402 | tmp2 = sum(Y(5:3:dim,:)); % j-2 = 3*k 403 | tmp3 = sum(Y(3:3:dim,:)); % j-0 = 3*k 404 | y(1,:) = cos(0.5*pi*x(1,:)).*cos(0.5*pi*x(2,:)) + 2.0*tmp1/size(4:3:dim,2); 405 | y(2,:) = cos(0.5*pi*x(1,:)).*sin(0.5*pi*x(2,:)) + 2.0*tmp2/size(5:3:dim,2); 406 | y(3,:) = sin(0.5*pi*x(1,:)) + 2.0*tmp3/size(3:3:dim,2); 407 | c(1,:) = (y(1,:).^2+y(2,:).^2)./(1.0-y(3,:).^2) - a*sin(N*pi*((y(1,:).^2-y(2,:).^2)./(1.0-y(3,:).^2)+1.0)) - 1.0; 408 | clear Y; 409 | end 410 | 411 | %% CF10 412 | % x and y are columnwise, the imput x must be inside the search space and 413 | % it could be a matrix 414 | function [y,c] = CF10(x) 415 | a = 1.0; 416 | N = 2.0; 417 | [dim, num] = size(x); 418 | Y = zeros(dim,num); 419 | Y(3:dim,:) = x(3:dim,:) - 2.0*repmat(x(2,:),[dim-2,1]).*sin(2.0*pi*repmat(x(1,:),[dim-2,1]) + pi/dim*repmat((3:dim)',[1,num])); 420 | H = zeros(dim,num); 421 | H(3:dim,:) = 4.0*Y(3:dim,:).^2 - cos(8.0*pi*Y(3:dim,:)) + 1.0; 422 | tmp1 = sum(H(4:3:dim,:)); % j-1 = 3*k 423 | tmp2 = sum(H(5:3:dim,:)); % j-2 = 3*k 424 | tmp3 = sum(H(3:3:dim,:)); % j-0 = 3*k 425 | y(1,:) = cos(0.5*pi*x(1,:)).*cos(0.5*pi*x(2,:)) + 2.0*tmp1/size(4:3:dim,2); 426 | y(2,:) = cos(0.5*pi*x(1,:)).*sin(0.5*pi*x(2,:)) + 2.0*tmp2/size(5:3:dim,2); 427 | y(3,:) = sin(0.5*pi*x(1,:)) + 2.0*tmp3/size(3:3:dim,2); 428 | c(1,:) = (y(1,:).^2+y(2,:).^2)./(1.0-y(3,:).^2) - a*sin(N*pi*((y(1,:).^2-y(2,:).^2)./(1.0-y(3,:).^2)+1.0)) - 1.0; 429 | clear Y H; 430 | end -------------------------------------------------------------------------------- /多目标灰狼优化算法/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018, Seyedali Mirjalili 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the distribution 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /多目标灰狼优化算法/results.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VG-TechCenter/Multi-objective-gray-wolf-optimization-algorithm/296c53589d53584812ee697bed681e0d05cdf624/多目标灰狼优化算法/results.mat -------------------------------------------------------------------------------- /多目标灰狼优化算法/xboundary.m: -------------------------------------------------------------------------------- 1 | % The Matlab source codes to generate the boudnaries of the test instances 2 | % for CEC 2009 Multiobjective Optimization Competition. 3 | % Please refer to the report for correct one if the source codes are not 4 | % consist with the report. 5 | % History: 6 | % v1 Sept.05 2008 7 | 8 | function range = xboundary(name,dim) 9 | 10 | range = ones(dim,2); 11 | 12 | switch name 13 | case {'UF1','UF2','UF5','UF6','UF7','CF2'} 14 | range(1,1) = 0; 15 | range(2:dim,1) = -1; 16 | case 'UF3' 17 | range(:,1) = 0; 18 | case {'UF4','CF3','CF4','CF5','CF6','CF7'} 19 | range(1,1) = 0; 20 | range(2:dim,1) = -2; 21 | range(2:dim,2) = 2; 22 | case {'UF8','UF9','UF10','CF9','CF10'} 23 | range(1:2,1) = 0; 24 | range(3:dim,1) = -2; 25 | range(3:dim,2) = 2; 26 | case 'CF1' 27 | range(:,1) = 0; 28 | case {'CF8'} 29 | range(1:2,1) = 0; 30 | range(3:dim,1) = -4; 31 | range(3:dim,2) = 4; 32 | end 33 | end --------------------------------------------------------------------------------