I want to reedit the algorithm in the paper. But the statement can not stay in the right place when I have a long state in algorithmicx.
I want it aligned as the paper does. Is there any simple solution?
My code is
\documentclass{IEEEtran}
\usepackage{algorithm}
\usepackage{algpseudocode}
\begin{document}
\begin{algorithm}
\caption{Funcation scaleUpResources()}
\begin{algorithmic}[1]
\State Select a kind of $newVm$ satisfying the $r_{new}\left(t_{i}\right)+t s_{i} / P_{new}+delay<d_{i}$;
\State Sort $H_a$ in a decreasing order by the remaining MIPS;
\For {$h_k$ in $H_a$}
\If {$h_k$ can accommodate $newVm$}
\State create $newVm$ on $h_k$;
\State return $newVm$
\EndIf
\EndFor
\For {$h_s$ in $H_s$}
\State{
Migrate the VM with minimal MIPS to other hosts with the fault-tolerant requirements: 1. The primary and the backup of one task can not allocate on the same host 2. $t_i^P$ and $t_j^P$ can not on the same host if $t_i^B$ and $t_j^B$ overlap.
}
\If{$h_s$ can accommodate $newVm$}
\State Create $newVm$ on $h_s$;
\State return $newVm$
\EndIf
\EndFor
\State Turn on a host on $h_new$ in $H_s$;
\If{the MIPS of $h_{new}$ satisfies $newVm$}
\State Create $newVm$ on $h_new$
\State return $newVm$
\Else
\State return $NULL$
\EndIf
\end{algorithmic}
\end{algorithm}
\end{document}
The view in my LaTeX:
The view in the paper:


