I am making an algorithm with a nested for loop, and there are multiple in the loop. They are presented on the same line, but I want them to start on a newline. Any ideas how I can do this?
This is my code:
\begin{algorithm}
\begin{algorithmic}[1]
\State {Input $\pi$, the random policy}
\State {Initialize V(s)=0 for all s $\in$ S}
\State {Repeat}
\State {$\Delta$ \gets 0}
\For{for each s $\in$ S }:
\For{for each direction $\in$ directions }:
\For{for slide in slides}:
\State{v \gets V(s)}
\State{V(s) \gets \sum_{a} $\pi${(s,a)}\sum_{s'}P_{ss'}^{a}[R_{ss'}^{a}+\gamma V(s')]}
\State{$\Delta$ \gets max($\Delta$,\mid v-V(s)\mid)}
\State{Until $\Delta$ < $\Theta$ ($\Theta$ = 0,01}
\State{Output V \approx V^{$\pi$}}
\EndProcedure
\end{algorithmic}
\caption{Policy evaluation}
\end{algorithm}