最近在完成大论文写作,其中涉及到Aurora插入伪代码工作
链接:Aurora网盘
提取码:1qwt
LaTex发行版地址:TexLive、MikTex
Aurora 伪代码
\begin{algorithm}[H]
\caption{Whale Optimization Algorithm}
\label{your label}
\begin{algorithmic}[1]
\Require
initialize the whale population $(x_{1},x_{2},...,x_{N})$,calculate the fitness of each person;
\Ensure
the best solution
\While{(t$<$maximum number of iterations)}
\For{each person}
\State Update a,A,C,l,and p
\If { (p$<$0.5)}
\If{($\left | A \right | < 1$)}
\State Update the position by the
\ElsIf{($\left | A \right | >= 1$)}
\State Update the position by the
\EndIf
\ElsIf{(p$>=$0.5)}
\State Update the position by the
\EndIf
\EndFor
\State Calculate the fitness of each person
\State Update $X^{*}$ if there is a better solution
\State $t=t+1$
\EndWhile
\State return $X^{*}$
\end{algorithmic}
\end{algorithm}
这里是鲸鱼优化算法的伪代码,和文献中的稍有些不同,效果图如下。
使用三线表完成伪代码
开始想用三线表完成伪代码,但在编写过程发现无法解决缩进问题所以就放弃了。