<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\small
\begin{algorithmic}[1]
\label{alg_opr_rstate}
  \Procedure{OnRunState()}{}

  \State $V$ $\gets$ updatePositions() \Comment{Step 1}

  \If{{\tt (max\_time &gt; 0)} and {\tt (time\_elapsed &gt; max\_time)}}  \Comment{Step 2}
        \State postBreachedTimeFlags() \Comment{Step 3}
        \State all\_stop $\gets$ true 
  \ElsIf{{\tt (max\_depth &gt; 0)} and {\tt (depth &gt; max\_depth)}}  \Comment{Step 4}
        \State postBreachedDepthFlags() \Comment{Step 5}
        \State all\_stop $\gets$ true 
  \ElsIf{{\tt (min\_altitude &gt; 0)} and {\tt (altitude &lt; min\_altitude)}}  \Comment{Step 6}
        \State postBreachedAltitudeFlags() \Comment{Step 7}
        \State all\_stop $\gets$ true 
  \ElsIf{{\tt halt\_poly.isConvex()} and {\tt (}$x_{os},y_{os} \not\in $ {\tt halt\_poly})}  \Comment{Step 8}
        \State postBreachedPolyFlags() \Comment{Step 9}
        \State all\_stop $\gets$ true 
  \EndIf

  \If{{\tt (all\_stop = true)}} \Comment{Step 10}
        \State postInactiveFlags() 
        \State {\bf return} 0
  \EndIf

  \If{{\tt save\_poly.isConvex()} and {\tt (}$x_{os},y_{os} \in $ {\tt save\_poly})}  \Comment{Step 11}
        \State postRunFlags() \Comment{Step 12}
        \State {\bf return} 0
  \EndIf

  \If{{\tt first\_save\_iteration}}  \Comment{Step 13}
        \State postSaveFlags()
  \EndIf

  \State $ipf$ $\gets$ buildIvPFunction($x_{os},y_{os},\theta_{os},${\tt save\_poly})   \Comment{Step 14}
  \State postRunFlags() \Comment{Step 15}
  \State postActiveFlags() \Comment{Step 15}
  \State {\bf return} $ipf$
  \EndProcedure
\end{algorithmic}
\normalsize





</pre></body></html>