Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[energies,article,accept,moreauthors,pdftex,10pt,a4paper]{mdpi}
- usepackage{booktabs}
- usepackage{array} newcommand{PreserveBackslash}[1]{lettemp=\#1let\=temp}
- newcolumntype{C}[1]{>{PreserveBackslashcentering}m{#1}}
- newcolumntype{R}[1]{>{PreserveBackslashraggedleft}m{#1}}
- newcolumntype{L}[1]{>{PreserveBackslashraggedright}m{#1}}
- usepackage{booktabs}
- usepackage{multirow}
- begin{document}
- begin{algorithm}[H]
- caption{EDE.}
- label{pseudoEDE}
- Parameters initialization ${Max.iter,CR, POP, and h}$;
- Population generation using Equation (ref{eq:7}) ;
- For {h = 1:H}
- {
- Compute mutant vector using Equation (ref{eq:8});
- For{iter= 1:Max.iter}
- { Compute first trial vector with CR 0.3;
- If {$rand() leq 0.3$}
- {$mu_{j}=upsilon_{j}$\
- else\
- {$mu_{j}=x_{j}$}
- }
- Compute second trial vector with CR 0.6;
- If {$rand() leq 0.6$}
- { $mu_{j}=upsilon_{j}$\
- else\
- { $mu_{j}=x_{j}$ }
- }
- Compute third trial vector with CR 0.9;
- If {$rand() leq 0.9$}
- {$mu_{j}=upsilon_{j}$\
- else\
- {$mu_{j}=x_{j}$}
- }
- Create $4^{th}$ and $5^{th}$ trial vector using Equations (ref{4_trial}) and (ref{5_trial});
- Findout trial vector which is best ;
- $X_{new} gets$ best of $ mu_{j}$ ;
- Compare trial vector with target vector;
- If {$f({X_{new}}) < f (X_{j})$}
- {$X_{j} = X_{new}$}
- }
- }
- end{algorithm}
- begin{algorithm}[H]
- caption{GWO.}
- label{pseudoGWO}
- Parameters initialization ${Maxiter, POP, D, alpha, beta, delta}$;
- Initial population of gray wolves generation $X{i} (i=1,2,...,n)$;
- $X(i,j)= rand (POP, D)$;
- While {iter $<$ Maxiter}
- {
- For{i=1:POP}
- {
- Compute fitness using Equation (ref{eq:17});
- If {fitness $ < alpha_{score} $ }
- {$alpha_{score}$=fitness;
- $alpha_{Pos}$= $X(i, :)$;}
- If {fitness $ > alpha_{score}$ and fitness$<beta_{score }$}
- {$beta_{score}$=fitness;
- $beta_{Pos}$= $X(i, :)$;}
- If {fitness $ > alpha_{score}$ and fitness$>beta_{score }$ and fitness$<delta_{score }$}
- {$delta_{score}$=fitness;
- $delta_{Pos}$= $X(i, :)$;}
- }
- For {i = 1:POP}
- {For {j = 1:D}
- { Create $r1$ and $r2$ randomly with rand command;
- Compute fitness coefficients A and C using Equations (ref{eq:ENP3}) and (ref{eq:ENP4});
- Update values of ${alpha, beta$, and $delta}$ using Equation (ref{H5})--(ref{H7});
- }
- }
- }
- end{algorithm}par
- vspace{12pt}
- end{document}
- usepackage{algorithm2e} % <============================================
- usepackage{pseudocode} % <=============================================
- Update values of $alpha$, $beta$, and $delta$ using Equation (ref{H5})--(ref{H7});
- documentclass[energies,article,accept,moreauthors,pdftex,10pt,a4paper]{mdpi}
- %usepackage{booktabs}
- %usepackage{array}
- usepackage{algorithm2e} % <============================================
- usepackage{pseudocode} % <=============================================
- usepackage{blindtext} % <======================= dummy text in document
- %newcommand{PreserveBackslash}[1]{lettemp=\#1let\=temp}
- %newcolumntype{C}[1]{>{PreserveBackslashcentering}m{#1}}
- %newcolumntype{R}[1]{>{PreserveBackslashraggedleft}m{#1}}
- %newcolumntype{L}[1]{>{PreserveBackslashraggedright}m{#1}}
- %
- %usepackage{multirow}
- Title{Title}
- newcommand{orcidauthorA}{0000-0000-000-000X}
- Author{Firstname Lastname $^{1,dagger,ddagger}$orcidA{}, Firstname Lastname $^{1,ddagger}$ and Firstname Lastname $^{2,}$*}
- % Authors, for metadata in PDF
- AuthorNames{Firstname Lastname, Firstname Lastname and Firstname Lastname}
- % Affiliations / Addresses (Add [1] after address if there is only one affiliation.)
- address{%
- $^{1}$ quad Affiliation 1; e-mail@e-mail.com\
- $^{2}$ quad Affiliation 2; e-mail@e-mail.com}
- pubvolume{xx}
- issuenum{1}
- articlenumber{5}
- pubyear{2019}
- copyrightyear{2019}
- history{Received: date; Accepted: date; Published: date}
- begin{document}
- blindtext
- begin{algorithm}%[H]
- caption{EDE.}
- label{pseudoEDE}
- Parameters initialization ${Max.iter,CR, POP, and h}$;
- Population generation using Equation (ref{eq:7}) ;
- For {h = 1:H}
- {
- Compute mutant vector using Equation (ref{eq:8});
- For{iter= 1:Max.iter}
- { Compute first trial vector with CR 0.3;
- If {$rand() leq 0.3$}
- {$mu_{j}=upsilon_{j}$\
- else\
- {$mu_{j}=x_{j}$}
- }
- Compute second trial vector with CR 0.6;
- If {$rand() leq 0.6$}
- { $mu_{j}=upsilon_{j}$\
- else\
- { $mu_{j}=x_{j}$ }
- }
- Compute third trial vector with CR 0.9;
- If {$rand() leq 0.9$}
- {$mu_{j}=upsilon_{j}$\
- else\
- {$mu_{j}=x_{j}$}
- }
- Create $4^{th}$ and $5^{th}$ trial vector using Equations (ref{4_trial}) and (ref{5_trial});
- Findout trial vector which is best ;
- $X_{new} gets$ best of $ mu_{j}$ ;
- Compare trial vector with target vector;
- If {$f({X_{new}}) < f (X_{j})$}
- {$X_{j} = X_{new}$}
- }
- }
- end{algorithm}
- blindtext
- begin{algorithm}%[H]
- caption{GWO.}
- label{pseudoGWO}
- Parameters initialization ${Maxiter, POP, D, alpha, beta, delta}$;
- Initial population of gray wolves generation $X{i} (i=1,2,...,n)$;
- $X(i,j)= rand (POP, D)$;
- While {iter $<$ Maxiter}
- {
- For{i=1:POP}
- {
- Compute fitness using Equation (ref{eq:17});
- If {fitness $ < alpha_{score} $ }
- {$alpha_{score}$=fitness;
- $alpha_{Pos}$= $X(i, :)$;}
- If {fitness $ > alpha_{score}$ and fitness$<beta_{score }$}
- {$beta_{score}$=fitness;
- $beta_{Pos}$= $X(i, :)$;}
- If {fitness $ > alpha_{score}$ and fitness$>beta_{score }$ and fitness$<delta_{score }$}
- {$delta_{score}$=fitness;
- $delta_{Pos}$= $X(i, :)$;}
- }
- For {i = 1:POP}
- {For {j = 1:D}
- { Create $r1$ and $r2$ randomly with rand command;
- Compute fitness coefficients A and C using Equations (ref{eq:ENP3}) and (ref{eq:ENP4});
- Update values of $alpha$, $beta$, and $delta$ using Equation (ref{H5})--(ref{H7});
- }
- }
- }
- end{algorithm}
- blindtext
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement