2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-26 06:48:04 +02:00

Update pseudocode to include cost function as parameter

This commit is contained in:
Martin Thoma 2016-07-13 20:10:55 +02:00
parent 23462814aa
commit 940436c883
4 changed files with 17 additions and 6 deletions

View file

@ -7,7 +7,12 @@
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
\usepackage{amssymb,amsmath,amsfonts} % nice math rendering
\usepackage{braket} % needed for \Set
\usepackage[noend]{algorithm,algpseudocode}
\usepackage{caption}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\DeclareCaptionFormat{myformat}{#3}
\captionsetup[algorithm]{format=myformat}
\begin{document}
\begin{preview}
@ -16,7 +21,8 @@
\Require
\Statex Sates $\mathcal{X} = \{1, \dots, n_x\}$
\Statex Actions $\mathcal{A} = \{1, \dots, n_a\},\qquad A: \mathcal{X} \Rightarrow \mathcal{A}$
\Procedure{PolicyIteration}{$\mathcal{X}$, $A$}
\Statex Cost function $g: \mathcal{X} \times \mathcal{A} \rightarrow \mathbb{R}$
\Procedure{PolicyIteration}{$\mathcal{X}$, $A$, $g$}
\State Initialize $\pi$ arbitrarily
\While{$\pi$ is not converged}
\State $J \gets$ solve system of linear equations $I - \alpha \cdot F(\pi) \cdot J = g(\pi)$