当前位置:   article > 正文

多目标优化算法测试基准函数(CEC2009)以及评价标准_测试函数uf10

测试函数uf10

前言

        IEEE进化计算会议(IEEE on Evolutionary Computation,IEEE CEC)从2005年开始,后面每年举办一次,其中定义了很多测试案例,被用来作为各种进化算法的测试基准函数,下面将介绍2009年的多目标测试函数(UF1-UF10,以及CF1-CF10)以及相关性能评价标准。

1. 多目标测试集定义

1.1. 双目标测试函数

  • UF1

\left\{ \begin{aligned} &f_{1}(x)=x_{1}+\frac{2}{|J_{1}|}\sum_{j\in J_{1}}[x_{j}-sin(6\pi x_{1}+\frac{j\pi}{n})]^{2} \\ &f_{2}(x)=1-\sqrt x_{1} + \frac{2}{|J_{2}|}\sum_{j\in J_{2}}[x_{j}-sin(6\pi x_{1}+\frac{j\pi}{n})]^{2} \\ &J_{1}=\left\{j|j \,is \,odd \,and \,2 \leq j \leq n \right\}\\ &J_{2}=\left\{j|j \,is \,even \,and \,2 \leq j \leq n \right\}\\ \end{aligned} \right.

  • UF2

\left\{ \begin{aligned} &f_{1}(x)=x_{1}+\frac{2}{|J_{1}|}\sum_{j\in J_{1}}y^{2}_{j}\\ &f_{2}(x)=1-\sqrt x_{1} + \frac{2}{|J_{2}|}\sum_{j\in J_{2}}y^{2}_{j} \\ &J_{1}=\left\{j|j \,is \,odd \,and \,2 \leq j \leq n \right\}\\ &J_{2}=\left\{j|j \,is \,even \,and \,2 \leq j \leq n \right\}\\ \end{aligned} \right.

y_j=\left\{ \begin{aligned} &x_{j}-[0.3x^{2}_{1}cos(24\pi x_{1}+\frac{4j\pi}{n})+0.6x_{1}]cos(6\pi x_{1}+\frac{j\pi}{n})) \, j \in J_{1}\\ &x_{j}-[0.3x^{2}_{1}cos(24\pi x_{1}+\frac{4j\pi}{n})+0.6x_{1}]sin(6\pi x_{1}+\frac{j\pi}{n})) \, j \in J_{2}\\ \end{aligned} \right.

  • UF3

\left\{ \begin{aligned} &f_{1}(x)=x_{1}+\frac{2}{|J_{1}|}(4\sum_{j\in J_{1}}y^{2}_{j}-2 \prod_{j\in J_{1}}cos(\frac{20y_{j} \pi}{\sqrt j})+2) \\ &f_{2}(x)=\sqrt x_{1}+\frac{2}{|J_{2}|}(4\sum_{j\in J_{1}}y^{2}_{j}-2 \prod_{j\in J_{2}}cos(\frac{20y_{j} \pi}{\sqrt j})+2) \\ &J_{1} \, and \, J_{2} \, are \, the \, same \, as \, those \,of \, UF1 \end{aligned} \right.

y_{j}=x_{j}-x^{0.5(1+\frac{3(j-2)}{n-2})}_{1},\,j=2,3,...,n

  • UF4

\left\{ \begin{aligned} &f_{1}(x)=x_{1}+\frac{2}{|J_{1}|}\sum_{j\in J_{1}}h(y_{j})) \\ &f_{2}(x)=1- x_{2} + \frac{2}{|J_{2}|}\sum_{j\in J_{2}}h(y_{j})\\ &J_{1} \, and \, J_{2} \,are \,the \,same \,as \,those \,of \,UF1 \end{aligned} \right.

y_{j}=x_{j}-sin(6\pi x_{1}+\frac{j\pi}{n}),\,j=2,3,...,n,\, h(t)=\frac{|t|}{1+e^{2|t|}}

  • UF5

\left\{ \begin{aligned} &f_{1}(x)=x_{1}+(\frac{1}{2N}+\in)|sin(2N\pi x_{1})|+\frac{2}{|J_{1}|}\sum_{j\in J_{1}}h(y_{j})) \\ &f_{2}(x)=1-x_{1}+(\frac{1}{2N}+\in)|sin(2N\pi x_{1})|+\frac{2}{|J_{1}|}\sum_{j\in J_{2}}h(y_{j})) \\ &y_{j}=x_{j}-sin(6\pi x_{1}+\frac{j\pi}{n}),\,j=2,3,...,n,\,\\ &h(t)=2t^2-cos(4\pi t)+1\\ &J_{1} \, and \, J_{2} \,are \,the \,same \,as \,those \,of \,UF1 ,\in>0 \end{aligned} \right.

  • UF6

\left\{ \begin{aligned} &f_{1}(x)=x_{1}+max\left\{0,2(\frac{1}{2N}+\in)sin(2N\pi x)\right\}+\frac{2}{|J_{1}|}(4\sum_{j\in J_{1}}y^{2}_{j}-2 \prod_{j\in J_{1}}cos(\frac{20y_{j} \pi}{\sqrt j})+2) \\ &f_{2}(x)=1-x_{1}+max\left\{0,2(\frac{1}{2N}+\in)sin(2N\pi x)\right\}+\frac{2}{|J_{1}|}(4\sum_{j\in J_{1}}y^{2}_{j}-2 \prod_{j\in J_{1}}cos(\frac{20y_{j} \pi}{\sqrt j})+2) \\ &y_{j}=x_{j}-sin(6\pi x_{1} + \frac{j\pi}{n}),j=2,3,...,n\\ &J_{1} \, and \, J_{2} \, are \, the \, same \, as \, those \,of \, UF1,\in>0 \end{aligned} \right.

  • UF7

\left\{ \begin{aligned} &f_{1}(x)=\sqrt[5]{x_{1}}+\frac{2}{|J_{1}|}\sum_{j\in J_{1}}y^{2}_{j}\\ &f_{2}(x)=1-\sqrt[5]{ x_{1}} + \frac{2}{|J_{2}|}\sum_{j\in J_{2}}y^{2}_{j} \\ &y_{j}=x_{j}-sin(6\pi x_{1} + \frac{j\pi}{n}),j=2,3,...,n\\ &J_{1} \, and \, J_{2} \, are \, the \, same \, as \, those \,of \, UF1,\in>0 \end{aligned} \right.

1.2. 三目标测试函数

  • UF8

\left\{ \begin{aligned} &f_{1}(x)=cos(0.5x_{1}\pi)cos(0.5x_{2}\pi)+\frac{2}{|J_{1}|}\sum_{j\in J_{1}}(x_{j}-2x_{2}sin(2\pi x_{1}+\frac{j\pi}{n})^{2}) \\ &f_{2}(x)=cos(0.5x_{1}\pi)cos(0.5x_{2}\pi)+\frac{2}{|J_{2}|}\sum_{j\in J_{2}}(x_{j}-2x_{2}sin(2\pi x_{1}+\frac{j\pi}{n})^{2}) \\ &f_{3}(x)=sin(0.5x_{1}\pi)+\frac{2}{|J_{3}|}\sum_{j\in J_{3}}(x_{j}-2x_{2}sin(2\pi x_{1}+\frac{j\pi}{n})^{2}) \\ &J_{1}=\left\{j|3\leq j \leq n,and \,j-1\,is \,a \,multiplication \,of \,3 \right\}\\ &J_{2}=\left\{j|3\leq j \leq n,and \,j-2\,is \,a \,multiplication \,of \,3 \right\}\\ &J_{2}=\left\{j|3\leq j \leq n,and \,j\,is \,a \,multiplication \,of \,3 \right\}\\ \end{aligned} \right.

  • UF9

\left\{ \begin{aligned} &f_{1}(x)=0.5[max\left\{0,(1+\in)(1-4(2x_{1}-1)^{2})\right\}+2x_{1}]x_{2}+\frac{2}{|J_{1}|}\sum_{j\in J_{1}}(x_{j}-2x_{2}sin(2\pi x_{1}+\frac{j\pi}{n})^{2}) \\ &f_{2}(x)=0.5[max\left\{0,(1+\in)(1-4(2x_{1}-1)^{2})\right\}+2x_{1}]x_{2}+\frac{2}{|J_{2}|}\sum_{j\in J_{2}}(x_{j}-2x_{2}sin(2\pi x_{1}+\frac{j\pi}{n})^{2}) \\ &f_{3}(x)=1-x_{2}+\frac{2}{|J_{3}|}\sum_{j\in J_{3}}(x_{j}-2x_{2}sin(2\pi x_{1}+\frac{j\pi}{n})^{2}) \\ &J_{1}=\left\{j|3\leq j \leq n,and \,j-1\,is \,a \,multiplication \,of \,3 \right\}\\ &J_{2}=\left\{j|3\leq j \leq n,and \,j-2\,is \,a \,multiplication \,of \,3 \right\}\\ &J_{2}=\left\{j|3\leq j \leq n,and \,j\,is \,a \,multiplication \,of \,3 \right\},\in=0.1\end{aligned} \right.

  • UF10

\left\{ \begin{aligned} &f_{1}(x)=cos(0.5x_{1}\pi)cos(0.5x_{2}\pi)+\frac{2}{|J_{1}|}\sum_{j\in J_{1}}[4y^{2}_{j}-cos(8\pi y_{j})+1]\\ &f_{2}(x)=cos(0.5x_{1}\pi)cos(0.5x_{2}\pi)+\frac{2}{|J_{2}|}\sum_{j\in J_{2}}[4y^{2}_{j}-cos(8\pi y_{j})+1]\\ &f_{3}(x)=sin(0.5x_{1}\pi)+\frac{2}{|J_{3}|}\sum_{j\in J_{3}}[4y^{2}_{j}-cos(8\pi y_{j})+1] \\ &J_{1}=\left\{j|3\leq j \leq n,and \,j-1\,is \,a \,multiplication \,of \,3 \right\}\\ &J_{2}=\left\{j|3\leq j \leq n,and \,j-2\,is \,a \,multiplication \,of \,3 \right\}\\ &J_{2}=\left\{j|3\leq j \leq n,and \,j\,is \,a \,multiplication \,of \,3 \right\}\\ \end{aligned} \right.


带约束的问题,即CF1-CF10,这里就不累述,感兴趣的, 可以下载附件研读。

2. 评价标准

        在评价算法的性能时,最常见的通过下面几个标准进行定义:

  • Generational Distance(GD)

        

  • Inverted Generational Distance(IGD)

  • Spacing (SP)  

3. 测试函数code

3.1.CEC2009

  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. function fobj = cec09(name)
  16. switch name
  17. case 'UF1'
  18. fobj = @UF1;
  19. case 'UF2'
  20. fobj = @UF2;
  21. case 'UF3'
  22. fobj = @UF3;
  23. case 'UF4'
  24. fobj = @UF4;
  25. case 'UF5'
  26. fobj = @UF5;
  27. case 'UF6'
  28. fobj = @UF6;
  29. case 'UF7'
  30. fobj = @UF7;
  31. case 'UF8'
  32. fobj = @UF8;
  33. case 'UF9'
  34. fobj = @UF9;
  35. case 'UF10'
  36. fobj = @UF10;
  37. case 'CF1'
  38. fobj = @CF1;
  39. case 'CF2'
  40. fobj = @CF2;
  41. case 'CF3'
  42. fobj = @CF3;
  43. case 'CF4'
  44. fobj = @CF4;
  45. case 'CF5'
  46. fobj = @CF5;
  47. case 'CF6'
  48. fobj = @CF6;
  49. case 'CF7'
  50. fobj = @CF7;
  51. case 'CF8'
  52. fobj = @CF8;
  53. case 'CF9'
  54. fobj = @CF9;
  55. case 'CF10'
  56. fobj = @CF10;
  57. otherwise
  58. fobj = @UF1;
  59. end
  60. end
  61. %% UF1
  62. % x and y are columnwise, the imput x must be inside the search space and
  63. % it could be a matrix
  64. function y = UF1(x)
  65. [dim, num] = size(x);
  66. tmp = zeros(dim,num);
  67. tmp(2:dim,:)= (x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]))).^2;
  68. tmp1 = sum(tmp(3:2:dim,:)); % odd index
  69. tmp2 = sum(tmp(2:2:dim,:)); % even index
  70. y(1,:) = x(1,:) + 2.0*tmp1/size(3:2:dim,2);
  71. y(2,:) = 1.0 - sqrt(x(1,:)) + 2.0*tmp2/size(2:2:dim,2);
  72. clear tmp;
  73. end
  74. %% UF2
  75. % x and y are columnwise, the imput x must be inside the search space and
  76. % it could be a matrix
  77. function y = UF2(x)
  78. [dim, num] = size(x);
  79. X1 = repmat(x(1,:),[dim-1,1]);
  80. A = 6*pi*X1 + pi/dim*repmat((2:dim)',[1,num]);
  81. tmp = zeros(dim,num);
  82. tmp(2:dim,:)= (x(2:dim,:) - 0.3*X1.*(X1.*cos(4.0*A)+2.0).*cos(A)).^2;
  83. tmp1 = sum(tmp(3:2:dim,:)); % odd index
  84. tmp(2:dim,:)= (x(2:dim,:) - 0.3*X1.*(X1.*cos(4.0*A)+2.0).*sin(A)).^2;
  85. tmp2 = sum(tmp(2:2:dim,:)); % even index
  86. y(1,:) = x(1,:) + 2.0*tmp1/size(3:2:dim,2);
  87. y(2,:) = 1.0 - sqrt(x(1,:)) + 2.0*tmp2/size(2:2:dim,2);
  88. clear X1 A tmp;
  89. end
  90. %% UF3
  91. % x and y are columnwise, the imput x must be inside the search space and
  92. % it could be a matrix
  93. function y = UF3(x)
  94. [dim, num] = size(x);
  95. Y = zeros(dim,num);
  96. 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));
  97. tmp1 = zeros(dim,num);
  98. tmp1(2:dim,:)= Y(2:dim,:).^2;
  99. tmp2 = zeros(dim,num);
  100. tmp2(2:dim,:)= cos(20.0*pi*Y(2:dim,:)./sqrt(repmat((2:dim)',[1,num])));
  101. tmp11 = 4.0*sum(tmp1(3:2:dim,:)) - 2.0*prod(tmp2(3:2:dim,:)) + 2.0; % odd index
  102. tmp21 = 4.0*sum(tmp1(2:2:dim,:)) - 2.0*prod(tmp2(2:2:dim,:)) + 2.0; % even index
  103. y(1,:) = x(1,:) + 2.0*tmp11/size(3:2:dim,2);
  104. y(2,:) = 1.0 - sqrt(x(1,:)) + 2.0*tmp21/size(2:2:dim,2);
  105. clear Y tmp1 tmp2;
  106. end
  107. %% UF4
  108. % x and y are columnwise, the imput x must be inside the search space and
  109. % it could be a matrix
  110. function y = UF4(x)
  111. [dim, num] = size(x);
  112. Y = zeros(dim,num);
  113. Y(2:dim,:) = x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]));
  114. H = zeros(dim,num);
  115. H(2:dim,:) = abs(Y(2:dim,:))./(1.0+exp(2.0*abs(Y(2:dim,:))));
  116. tmp1 = sum(H(3:2:dim,:)); % odd index
  117. tmp2 = sum(H(2:2:dim,:)); % even index
  118. y(1,:) = x(1,:) + 2.0*tmp1/size(3:2:dim,2);
  119. y(2,:) = 1.0 - x(1,:).^2 + 2.0*tmp2/size(2:2:dim,2);
  120. clear Y H;
  121. end
  122. %% UF5
  123. % x and y are columnwise, the imput x must be inside the search space and
  124. % it could be a matrix
  125. function y = UF5(x)
  126. N = 10.0;
  127. E = 0.1;
  128. [dim, num] = size(x);
  129. Y = zeros(dim,num);
  130. Y(2:dim,:) = x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]));
  131. H = zeros(dim,num);
  132. H(2:dim,:) = 2.0*Y(2:dim,:).^2 - cos(4.0*pi*Y(2:dim,:)) + 1.0;
  133. tmp1 = sum(H(3:2:dim,:)); % odd index
  134. tmp2 = sum(H(2:2:dim,:)); % even index
  135. tmp = (0.5/N+E)*abs(sin(2.0*N*pi*x(1,:)));
  136. y(1,:) = x(1,:) + tmp + 2.0*tmp1/size(3:2:dim,2);
  137. y(2,:) = 1.0 - x(1,:)+ tmp + 2.0*tmp2/size(2:2:dim,2);
  138. clear Y H;
  139. end
  140. %% UF6
  141. % x and y are columnwise, the imput x must be inside the search space and
  142. % it could be a matrix
  143. function y = UF6(x)
  144. N = 2.0;
  145. E = 0.1;
  146. [dim, num] = size(x);
  147. Y = zeros(dim,num);
  148. Y(2:dim,:) = x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]));
  149. tmp1 = zeros(dim,num);
  150. tmp1(2:dim,:)= Y(2:dim,:).^2;
  151. tmp2 = zeros(dim,num);
  152. tmp2(2:dim,:)= cos(20.0*pi*Y(2:dim,:)./sqrt(repmat((2:dim)',[1,num])));
  153. tmp11 = 4.0*sum(tmp1(3:2:dim,:)) - 2.0*prod(tmp2(3:2:dim,:)) + 2.0; % odd index
  154. tmp21 = 4.0*sum(tmp1(2:2:dim,:)) - 2.0*prod(tmp2(2:2:dim,:)) + 2.0; % even index
  155. tmp = max(0,(1.0/N+2.0*E)*sin(2.0*N*pi*x(1,:)));
  156. y(1,:) = x(1,:) + tmp + 2.0*tmp11/size(3:2:dim,2);
  157. y(2,:) = 1.0 - x(1,:) + tmp + 2.0*tmp21/size(2:2:dim,2);
  158. clear Y tmp1 tmp2;
  159. end
  160. %% UF7
  161. % x and y are columnwise, the imput x must be inside the search space and
  162. % it could be a matrix
  163. function y = UF7(x)
  164. [dim, num] = size(x);
  165. Y = zeros(dim,num);
  166. Y(2:dim,:) = (x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]))).^2;
  167. tmp1 = sum(Y(3:2:dim,:)); % odd index
  168. tmp2 = sum(Y(2:2:dim,:)); % even index
  169. tmp = (x(1,:)).^0.2;
  170. y(1,:) = tmp + 2.0*tmp1/size(3:2:dim,2);
  171. y(2,:) = 1.0 - tmp + 2.0*tmp2/size(2:2:dim,2);
  172. clear Y;
  173. end
  174. %% UF8
  175. % x and y are columnwise, the imput x must be inside the search space and
  176. % it could be a matrix
  177. function y = UF8(x)
  178. [dim, num] = size(x);
  179. Y = zeros(dim,num);
  180. 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;
  181. tmp1 = sum(Y(4:3:dim,:)); % j-1 = 3*k
  182. tmp2 = sum(Y(5:3:dim,:)); % j-2 = 3*k
  183. tmp3 = sum(Y(3:3:dim,:)); % j-0 = 3*k
  184. y(1,:) = cos(0.5*pi*x(1,:)).*cos(0.5*pi*x(2,:)) + 2.0*tmp1/size(4:3:dim,2);
  185. y(2,:) = cos(0.5*pi*x(1,:)).*sin(0.5*pi*x(2,:)) + 2.0*tmp2/size(5:3:dim,2);
  186. y(3,:) = sin(0.5*pi*x(1,:)) + 2.0*tmp3/size(3:3:dim,2);
  187. clear Y;
  188. end
  189. %% UF9
  190. % x and y are columnwise, the imput x must be inside the search space and
  191. % it could be a matrix
  192. function y = UF9(x)
  193. E = 0.1;
  194. [dim, num] = size(x);
  195. Y = zeros(dim,num);
  196. 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;
  197. tmp1 = sum(Y(4:3:dim,:)); % j-1 = 3*k
  198. tmp2 = sum(Y(5:3:dim,:)); % j-2 = 3*k
  199. tmp3 = sum(Y(3:3:dim,:)); % j-0 = 3*k
  200. tmp = max(0,(1.0+E)*(1-4.0*(2.0*x(1,:)-1).^2));
  201. y(1,:) = 0.5*(tmp+2*x(1,:)).*x(2,:) + 2.0*tmp1/size(4:3:dim,2);
  202. y(2,:) = 0.5*(tmp-2*x(1,:)+2.0).*x(2,:) + 2.0*tmp2/size(5:3:dim,2);
  203. y(3,:) = 1-x(2,:) + 2.0*tmp3/size(3:3:dim,2);
  204. clear Y;
  205. end
  206. %% UF10
  207. % x and y are columnwise, the imput x must be inside the search space and
  208. % it could be a matrix
  209. function y = UF10(x)
  210. [dim, num] = size(x);
  211. Y = zeros(dim,num);
  212. 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]));
  213. H = zeros(dim,num);
  214. H(3:dim,:) = 4.0*Y(3:dim,:).^2 - cos(8.0*pi*Y(3:dim,:)) + 1.0;
  215. tmp1 = sum(H(4:3:dim,:)); % j-1 = 3*k
  216. tmp2 = sum(H(5:3:dim,:)); % j-2 = 3*k
  217. tmp3 = sum(H(3:3:dim,:)); % j-0 = 3*k
  218. y(1,:) = cos(0.5*pi*x(1,:)).*cos(0.5*pi*x(2,:)) + 2.0*tmp1/size(4:3:dim,2);
  219. y(2,:) = cos(0.5*pi*x(1,:)).*sin(0.5*pi*x(2,:)) + 2.0*tmp2/size(5:3:dim,2);
  220. y(3,:) = sin(0.5*pi*x(1,:)) + 2.0*tmp3/size(3:3:dim,2);
  221. clear Y H;
  222. end
  223. %% CF1
  224. % x and y are columnwise, the imput x must be inside the search space and
  225. % it could be a matrix
  226. function [y,c] = CF1(x)
  227. a = 1.0;
  228. N = 10.0;
  229. [dim, num] = size(x);
  230. Y = zeros(dim,num);
  231. 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;
  232. tmp1 = sum(Y(3:2:dim,:));% odd index
  233. tmp2 = sum(Y(2:2:dim,:));% even index
  234. y(1,:) = x(1,:) + 2.0*tmp1/size(3:2:dim,2);
  235. y(2,:) = 1.0 - x(1,:) + 2.0*tmp2/size(2:2:dim,2);
  236. c(1,:) = y(1,:) + y(2,:) - a*abs(sin(N*pi*(y(1,:)-y(2,:)+1.0))) - 1.0;
  237. clear Y;
  238. end
  239. %% CF2
  240. % x and y are columnwise, the imput x must be inside the search space and
  241. % it could be a matrix
  242. function [y,c] = CF2(x)
  243. a = 1.0;
  244. N = 2.0;
  245. [dim, num] = size(x);
  246. tmp = zeros(dim,num);
  247. tmp(2:dim,:)= (x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]))).^2;
  248. tmp1 = sum(tmp(3:2:dim,:)); % odd index
  249. tmp(2:dim,:)= (x(2:dim,:) - cos(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]))).^2;
  250. tmp2 = sum(tmp(2:2:dim,:)); % even index
  251. y(1,:) = x(1,:) + 2.0*tmp1/size(3:2:dim,2);
  252. y(2,:) = 1.0 - sqrt(x(1,:)) + 2.0*tmp2/size(2:2:dim,2);
  253. t = y(2,:) + sqrt(y(1,:)) - a*sin(N*pi*(sqrt(y(1,:))-y(2,:)+1.0)) - 1.0;
  254. c(1,:) = sign(t).*abs(t)./(1.0+exp(4.0*abs(t)));
  255. clear tmp;
  256. end
  257. %% CF3
  258. % x and y are columnwise, the imput x must be inside the search space and
  259. % it could be a matrix
  260. function [y,c] = CF3(x)
  261. a = 1.0;
  262. N = 2.0;
  263. [dim, num] = size(x);
  264. Y = zeros(dim,num);
  265. Y(2:dim,:) = x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]));
  266. tmp1 = zeros(dim,num);
  267. tmp1(2:dim,:)= Y(2:dim,:).^2;
  268. tmp2 = zeros(dim,num);
  269. tmp2(2:dim,:)= cos(20.0*pi*Y(2:dim,:)./sqrt(repmat((2:dim)',[1,num])));
  270. tmp11 = 4.0*sum(tmp1(3:2:dim,:)) - 2.0*prod(tmp2(3:2:dim,:)) + 2.0; % odd index
  271. tmp21 = 4.0*sum(tmp1(2:2:dim,:)) - 2.0*prod(tmp2(2:2:dim,:)) + 2.0; % even index
  272. y(1,:) = x(1,:) + 2.0*tmp11/size(3:2:dim,2);
  273. y(2,:) = 1.0 - x(1,:).^2 + 2.0*tmp21/size(2:2:dim,2);
  274. c(1,:) = y(2,:) + y(1,:).^2 - a*sin(N*pi*(y(1,:).^2-y(2,:)+1.0)) - 1.0;
  275. clear Y tmp1 tmp2;
  276. end
  277. %% CF4
  278. % x and y are columnwise, the imput x must be inside the search space and
  279. % it could be a matrix
  280. function [y,c] = CF4(x)
  281. [dim, num] = size(x);
  282. tmp = zeros(dim,num);
  283. tmp(2:dim,:)= x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]));
  284. tmp1 = sum(tmp(3:2:dim,:).^2); % odd index
  285. tmp2 = sum(tmp(4:2:dim,:).^2); % even index
  286. index1 = tmp(2,:) < (1.5-0.75*sqrt(2.0));
  287. index2 = tmp(2,:)>= (1.5-0.75*sqrt(2.0));
  288. tmp(2,index1) = abs(tmp(2,index1));
  289. tmp(2,index2) = 0.125 + (tmp(2,index2)-1.0).^2;
  290. y(1,:) = x(1,:) + tmp1;
  291. y(2,:) = 1.0 - x(1,:) + tmp(2,:) + tmp2;
  292. t = x(2,:) - sin(6.0*pi*x(1,:)+2.0*pi/dim) - 0.5*x(1,:) + 0.25;
  293. c(1,:) = sign(t).*abs(t)./(1.0+exp(4.0*abs(t)));
  294. clear tmp index1 index2;
  295. end
  296. %% CF5
  297. % x and y are columnwise, the imput x must be inside the search space and
  298. % it could be a matrix
  299. function [y,c] = CF5(x)
  300. [dim, num] = size(x);
  301. tmp = zeros(dim,num);
  302. 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]));
  303. tmp1 = sum(2.0*tmp(3:2:dim,:).^2-cos(4.0*pi*tmp(3:2:dim,:))+1.0); % odd index
  304. 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]));
  305. tmp2 = sum(2.0*tmp(4:2:dim,:).^2-cos(4.0*pi*tmp(4:2:dim,:))+1.0); % even index
  306. index1 = tmp(2,:) < (1.5-0.75*sqrt(2.0));
  307. index2 = tmp(2,:)>= (1.5-0.75*sqrt(2.0));
  308. tmp(2,index1) = abs(tmp(2,index1));
  309. tmp(2,index2) = 0.125 + (tmp(2,index2)-1.0).^2;
  310. y(1,:) = x(1,:) + tmp1;
  311. y(2,:) = 1.0 - x(1,:) + tmp(2,:) + tmp2;
  312. c(1,:) = x(2,:) - 0.8*x(1,:).*sin(6.0*pi*x(1,:)+2.0*pi/dim) - 0.5*x(1,:) + 0.25;
  313. clear tmp;
  314. end
  315. %% CF6
  316. % x and y are columnwise, the imput x must be inside the search space and
  317. % it could be a matrix
  318. function [y,c] = CF6(x)
  319. [dim, num] = size(x);
  320. tmp = zeros(dim,num);
  321. 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]));
  322. tmp1 = sum(tmp(3:2:dim,:).^2); % odd index
  323. 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]));
  324. tmp2 = sum(tmp(2:2:dim,:).^2); % even index
  325. y(1,:) = x(1,:) + tmp1;
  326. y(2,:) = (1.0 - x(1,:)).^2 + tmp2;
  327. tmp = 0.5*(1-x(1,:))-(1-x(1,:)).^2;
  328. c(1,:) = x(2,:) - 0.8*x(1,:).*sin(6.0*pi*x(1,:)+2*pi/dim) - sign(tmp).*sqrt(abs(tmp));
  329. tmp = 0.25*sqrt(1-x(1,:))-0.5*(1-x(1,:));
  330. c(2,:) = x(4,:) - 0.8*x(1,:).*sin(6.0*pi*x(1,:)+4*pi/dim) - sign(tmp).*sqrt(abs(tmp));
  331. clear tmp;
  332. end
  333. %% CF7
  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] = CF7(x)
  337. [dim, num] = size(x);
  338. tmp = zeros(dim,num);
  339. tmp(2:dim,:)= x(2:dim,:) - cos(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]));
  340. tmp1 = sum(2.0*tmp(3:2:dim,:).^2-cos(4.0*pi*tmp(3:2:dim,:))+1.0); % odd index
  341. tmp(2:dim,:)= x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]));
  342. tmp2 = sum(2.0*tmp(6:2:dim,:).^2-cos(4.0*pi*tmp(6:2:dim,:))+1.0); % even index
  343. tmp(2,:) = tmp(2,:).^2;
  344. tmp(4,:) = tmp(4,:).^2;
  345. y(1,:) = x(1,:) + tmp1;
  346. y(2,:) = (1.0 - x(1,:)).^2 + tmp(2,:) + tmp(4,:) + tmp2;
  347. tmp = 0.5*(1-x(1,:))-(1-x(1,:)).^2;
  348. c(1,:) = x(2,:) - sin(6.0*pi*x(1,:)+2*pi/dim) - sign(tmp).*sqrt(abs(tmp));
  349. tmp = 0.25*sqrt(1-x(1,:))-0.5*(1-x(1,:));
  350. c(2,:) = x(4,:) - sin(6.0*pi*x(1,:)+4*pi/dim) - sign(tmp).*sqrt(abs(tmp));
  351. clear tmp;
  352. end
  353. %% CF8
  354. % x and y are columnwise, the imput x must be inside the search space and
  355. % it could be a matrix
  356. function [y,c] = CF8(x)
  357. N = 2.0;
  358. a = 4.0;
  359. [dim, num] = size(x);
  360. Y = zeros(dim,num);
  361. 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;
  362. tmp1 = sum(Y(4:3:dim,:)); % j-1 = 3*k
  363. tmp2 = sum(Y(5:3:dim,:)); % j-2 = 3*k
  364. tmp3 = sum(Y(3:3:dim,:)); % j-0 = 3*k
  365. y(1,:) = cos(0.5*pi*x(1,:)).*cos(0.5*pi*x(2,:)) + 2.0*tmp1/size(4:3:dim,2);
  366. y(2,:) = cos(0.5*pi*x(1,:)).*sin(0.5*pi*x(2,:)) + 2.0*tmp2/size(5:3:dim,2);
  367. y(3,:) = sin(0.5*pi*x(1,:)) + 2.0*tmp3/size(3:3:dim,2);
  368. 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;
  369. clear Y;
  370. end
  371. %% CF9
  372. % x and y are columnwise, the imput x must be inside the search space and
  373. % it could be a matrix
  374. function [y,c] = CF9(x)
  375. N = 2.0;
  376. a = 3.0;
  377. [dim, num] = size(x);
  378. Y = zeros(dim,num);
  379. 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;
  380. tmp1 = sum(Y(4:3:dim,:)); % j-1 = 3*k
  381. tmp2 = sum(Y(5:3:dim,:)); % j-2 = 3*k
  382. tmp3 = sum(Y(3:3:dim,:)); % j-0 = 3*k
  383. y(1,:) = cos(0.5*pi*x(1,:)).*cos(0.5*pi*x(2,:)) + 2.0*tmp1/size(4:3:dim,2);
  384. y(2,:) = cos(0.5*pi*x(1,:)).*sin(0.5*pi*x(2,:)) + 2.0*tmp2/size(5:3:dim,2);
  385. y(3,:) = sin(0.5*pi*x(1,:)) + 2.0*tmp3/size(3:3:dim,2);
  386. 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;
  387. clear Y;
  388. end
  389. %% CF10
  390. % x and y are columnwise, the imput x must be inside the search space and
  391. % it could be a matrix
  392. function [y,c] = CF10(x)
  393. a = 1.0;
  394. N = 2.0;
  395. [dim, num] = size(x);
  396. Y = zeros(dim,num);
  397. 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]));
  398. H = zeros(dim,num);
  399. H(3:dim,:) = 4.0*Y(3:dim,:).^2 - cos(8.0*pi*Y(3:dim,:)) + 1.0;
  400. tmp1 = sum(H(4:3:dim,:)); % j-1 = 3*k
  401. tmp2 = sum(H(5:3:dim,:)); % j-2 = 3*k
  402. tmp3 = sum(H(3:3:dim,:)); % j-0 = 3*k
  403. y(1,:) = cos(0.5*pi*x(1,:)).*cos(0.5*pi*x(2,:)) + 2.0*tmp1/size(4:3:dim,2);
  404. y(2,:) = cos(0.5*pi*x(1,:)).*sin(0.5*pi*x(2,:)) + 2.0*tmp2/size(5:3:dim,2);
  405. y(3,:) = sin(0.5*pi*x(1,:)) + 2.0*tmp3/size(3:3:dim,2);
  406. 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;
  407. clear Y H;
  408. end

3.2 CEC2009 真实Pareto

        在计算评价标准的时候,我们需要用到真实Pareto的解集,Pareto解集一般由以下三种方式获得:

  • 采用穷举法,穷尽最优点
  • 采用多种优化方法进行优化,综合选择最优的点作为Pareto解集
  • 对于一个问题有明确的Pareto解集

        本次的cec2009真实pareto数据集我已经替大家找到,有需要的可以附件直接下载。


总结

       在打UF问题的时候,本人已经尽力不打错,但是难免可能有些小错误,建议还是看一下附件问题描述。本文只是自己的见解以及笔记,有错误的地方,欢迎大家指出。

参考文献:Multi-objective grey wolf optimizer: A novel algorithm for multi-criterion optimization - ScienceDirect

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/700415
推荐阅读