Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.28 KB | None | 0 0
  1. documentclass[energies,article,accept,moreauthors,pdftex,10pt,a4paper]{mdpi}
  2. usepackage{booktabs}
  3. usepackage{array} newcommand{PreserveBackslash}[1]{lettemp=\#1let\=temp}
  4. newcolumntype{C}[1]{>{PreserveBackslashcentering}m{#1}}
  5. newcolumntype{R}[1]{>{PreserveBackslashraggedleft}m{#1}}
  6. newcolumntype{L}[1]{>{PreserveBackslashraggedright}m{#1}}
  7. usepackage{booktabs}
  8. usepackage{multirow}
  9. begin{document}
  10. begin{algorithm}[H]
  11. caption{EDE.}
  12. label{pseudoEDE}
  13.  
  14. Parameters initialization ${Max.iter,CR, POP, and h}$;
  15. Population generation using Equation (ref{eq:7}) ;
  16. For {h = 1:H}
  17. {
  18. Compute mutant vector using Equation (ref{eq:8});
  19. For{iter= 1:Max.iter}
  20. { Compute first trial vector with CR 0.3;
  21. If {$rand() leq 0.3$}
  22. {$mu_{j}=upsilon_{j}$\
  23. else\
  24. {$mu_{j}=x_{j}$}
  25. }
  26.  
  27.  
  28. Compute second trial vector with CR 0.6;
  29. If {$rand() leq 0.6$}
  30. { $mu_{j}=upsilon_{j}$\
  31. else\
  32. { $mu_{j}=x_{j}$ }
  33. }
  34.  
  35. Compute third trial vector with CR 0.9;
  36. If {$rand() leq 0.9$}
  37. {$mu_{j}=upsilon_{j}$\
  38. else\
  39. {$mu_{j}=x_{j}$}
  40. }
  41.  
  42. Create $4^{th}$ and $5^{th}$ trial vector using Equations (ref{4_trial}) and (ref{5_trial});
  43. Findout trial vector which is best ;
  44. $X_{new} gets$ best of $ mu_{j}$ ;
  45. Compare trial vector with target vector;
  46. If {$f({X_{new}}) < f (X_{j})$}
  47. {$X_{j} = X_{new}$}
  48. }
  49. }
  50. end{algorithm}
  51.  
  52. begin{algorithm}[H]
  53. caption{GWO.}
  54. label{pseudoGWO}
  55. Parameters initialization ${Maxiter, POP, D, alpha, beta, delta}$;
  56. Initial population of gray wolves generation $X{i} (i=1,2,...,n)$;
  57. $X(i,j)= rand (POP, D)$;
  58. While {iter $<$ Maxiter}
  59. {
  60. For{i=1:POP}
  61. {
  62. Compute fitness using Equation (ref{eq:17});
  63. If {fitness $ < alpha_{score} $ }
  64. {$alpha_{score}$=fitness;
  65. $alpha_{Pos}$= $X(i, :)$;}
  66. If {fitness $ > alpha_{score}$ and fitness$<beta_{score }$}
  67. {$beta_{score}$=fitness;
  68. $beta_{Pos}$= $X(i, :)$;}
  69. If {fitness $ > alpha_{score}$ and fitness$>beta_{score }$ and fitness$<delta_{score }$}
  70. {$delta_{score}$=fitness;
  71. $delta_{Pos}$= $X(i, :)$;}
  72. }
  73. For {i = 1:POP}
  74. {For {j = 1:D}
  75. { Create $r1$ and $r2$ randomly with rand command;
  76. Compute fitness coefficients A and C using Equations (ref{eq:ENP3}) and (ref{eq:ENP4});
  77. Update values of ${alpha, beta$, and $delta}$ using Equation (ref{H5})--(ref{H7});
  78. }
  79. }
  80. }
  81. end{algorithm}par
  82. vspace{12pt}
  83. end{document}
  84.  
  85. usepackage{algorithm2e} % <============================================
  86. usepackage{pseudocode} % <=============================================
  87.  
  88. Update values of $alpha$, $beta$, and $delta$ using Equation (ref{H5})--(ref{H7});
  89.  
  90. documentclass[energies,article,accept,moreauthors,pdftex,10pt,a4paper]{mdpi}
  91.  
  92. %usepackage{booktabs}
  93. %usepackage{array}
  94. usepackage{algorithm2e} % <============================================
  95. usepackage{pseudocode} % <=============================================
  96. usepackage{blindtext} % <======================= dummy text in document
  97. %newcommand{PreserveBackslash}[1]{lettemp=\#1let\=temp}
  98. %newcolumntype{C}[1]{>{PreserveBackslashcentering}m{#1}}
  99. %newcolumntype{R}[1]{>{PreserveBackslashraggedleft}m{#1}}
  100. %newcolumntype{L}[1]{>{PreserveBackslashraggedright}m{#1}}
  101. %
  102. %usepackage{multirow}
  103.  
  104. Title{Title}
  105. newcommand{orcidauthorA}{0000-0000-000-000X}
  106. Author{Firstname Lastname $^{1,dagger,ddagger}$orcidA{}, Firstname Lastname $^{1,ddagger}$ and Firstname Lastname $^{2,}$*}
  107.  
  108. % Authors, for metadata in PDF
  109. AuthorNames{Firstname Lastname, Firstname Lastname and Firstname Lastname}
  110.  
  111. % Affiliations / Addresses (Add [1] after address if there is only one affiliation.)
  112. address{%
  113. $^{1}$ quad Affiliation 1; e-mail@e-mail.com\
  114. $^{2}$ quad Affiliation 2; e-mail@e-mail.com}
  115.  
  116. pubvolume{xx}
  117. issuenum{1}
  118. articlenumber{5}
  119. pubyear{2019}
  120. copyrightyear{2019}
  121. history{Received: date; Accepted: date; Published: date}
  122.  
  123.  
  124.  
  125. begin{document}
  126. blindtext
  127. begin{algorithm}%[H]
  128. caption{EDE.}
  129. label{pseudoEDE}
  130.  
  131. Parameters initialization ${Max.iter,CR, POP, and h}$;
  132. Population generation using Equation (ref{eq:7}) ;
  133. For {h = 1:H}
  134. {
  135. Compute mutant vector using Equation (ref{eq:8});
  136. For{iter= 1:Max.iter}
  137. { Compute first trial vector with CR 0.3;
  138. If {$rand() leq 0.3$}
  139. {$mu_{j}=upsilon_{j}$\
  140. else\
  141. {$mu_{j}=x_{j}$}
  142. }
  143.  
  144.  
  145. Compute second trial vector with CR 0.6;
  146. If {$rand() leq 0.6$}
  147. { $mu_{j}=upsilon_{j}$\
  148. else\
  149. { $mu_{j}=x_{j}$ }
  150. }
  151.  
  152. Compute third trial vector with CR 0.9;
  153. If {$rand() leq 0.9$}
  154. {$mu_{j}=upsilon_{j}$\
  155. else\
  156. {$mu_{j}=x_{j}$}
  157. }
  158.  
  159. Create $4^{th}$ and $5^{th}$ trial vector using Equations (ref{4_trial}) and (ref{5_trial});
  160. Findout trial vector which is best ;
  161. $X_{new} gets$ best of $ mu_{j}$ ;
  162. Compare trial vector with target vector;
  163. If {$f({X_{new}}) < f (X_{j})$}
  164. {$X_{j} = X_{new}$}
  165. }
  166. }
  167. end{algorithm}
  168. blindtext
  169. begin{algorithm}%[H]
  170. caption{GWO.}
  171. label{pseudoGWO}
  172. Parameters initialization ${Maxiter, POP, D, alpha, beta, delta}$;
  173. Initial population of gray wolves generation $X{i} (i=1,2,...,n)$;
  174. $X(i,j)= rand (POP, D)$;
  175. While {iter $<$ Maxiter}
  176. {
  177. For{i=1:POP}
  178. {
  179. Compute fitness using Equation (ref{eq:17});
  180. If {fitness $ < alpha_{score} $ }
  181. {$alpha_{score}$=fitness;
  182. $alpha_{Pos}$= $X(i, :)$;}
  183. If {fitness $ > alpha_{score}$ and fitness$<beta_{score }$}
  184. {$beta_{score}$=fitness;
  185. $beta_{Pos}$= $X(i, :)$;}
  186. If {fitness $ > alpha_{score}$ and fitness$>beta_{score }$ and fitness$<delta_{score }$}
  187. {$delta_{score}$=fitness;
  188. $delta_{Pos}$= $X(i, :)$;}
  189. }
  190. For {i = 1:POP}
  191. {For {j = 1:D}
  192. { Create $r1$ and $r2$ randomly with rand command;
  193. Compute fitness coefficients A and C using Equations (ref{eq:ENP3}) and (ref{eq:ENP4});
  194. Update values of $alpha$, $beta$, and $delta$ using Equation (ref{H5})--(ref{H7});
  195. }
  196. }
  197. }
  198. end{algorithm}
  199. blindtext
  200. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement