Value-Iteration.tex 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. \documentclass{article}
  2. \usepackage[pdftex,active,tightpage]{preview}
  3. \setlength\PreviewBorder{2mm}
  4. \usepackage[utf8]{inputenc} % this is needed for umlauts
  5. \usepackage[ngerman]{babel} % this is needed for umlauts
  6. \usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
  7. \usepackage{amssymb,amsmath,amsfonts} % nice math rendering
  8. \usepackage{braket} % needed for \Set
  9. \usepackage[noend]{algorithm,algpseudocode}
  10. \begin{document}
  11. \begin{preview}
  12. \begin{algorithm}[H]
  13. \begin{algorithmic}
  14. \Require
  15. \Statex Sates $\mathcal{X} = \{1, \dots, n_x\}$
  16. \Statex Actions $\mathcal{A} = \{1, \dots, n_a\},\qquad A: \mathcal{X} \Rightarrow \mathcal{A}$
  17. % TODO: g? \alpha?
  18. % Q?
  19. % f_ij(a)
  20. \Procedure{ValueIteration}{$\mathcal{X}$, $A$}
  21. \State Initialize $J, J': \mathcal{X} \rightarrow \mathbb{R}_0^+$ arbitrarily
  22. \While{$J$ is not converged}
  23. \State $J' \gets J$
  24. \For{$x \in \mathcal{X}$}
  25. \For{$a \in A(x)$}
  26. \State $Q(x, a) \gets g(x, a) + \alpha \sum_{j=1}^{n_x} f_{xj}(a) \cdot J'(j)$
  27. \EndFor
  28. \EndFor
  29. \For{$x \in \mathcal{X}$}
  30. \State $J(x) \gets \min_a \{Q(x, a)\}$
  31. \EndFor
  32. \EndWhile
  33. \EndProcedure
  34. \end{algorithmic}
  35. \caption{Calculate value function}
  36. \label{alg:calculateLegendreSymbol}
  37. \end{algorithm}
  38. \end{preview}
  39. \end{document}