瀏覽代碼

Improve pseudocode

Martin Thoma 9 年之前
父節點
當前提交
14e85b383e

二進制
source-code/Pseudocode/dynamic-programming/dynamic-programming.png


+ 2 - 1
source-code/Pseudocode/dynamic-programming/dynamic-programming.tex

@@ -23,7 +23,8 @@
         \Statex Actions $\mathcal{A} = \{1, \dots, n_a\},\qquad A: \mathcal{X} \Rightarrow \mathcal{A}$
         \Statex Actions $\mathcal{A} = \{1, \dots, n_a\},\qquad A: \mathcal{X} \Rightarrow \mathcal{A}$
         \Statex Cost function $g: \mathcal{X} \times \mathcal{A} \rightarrow \mathbb{R}$
         \Statex Cost function $g: \mathcal{X} \times \mathcal{A} \rightarrow \mathbb{R}$
         \Statex Horizon $N$
         \Statex Horizon $N$
-        \Procedure{DynamicProgramming}{$\mathcal{X}$, $A$, $g$, $N$}
+        \Statex Discounting factor $\alpha \in [0, 1]$
+        \Procedure{DynamicProgramming}{$\mathcal{X}$, $A$, $g$, $N$, $\alpha$}
             \State $J_N(x) \gets g_N(x) \quad \forall x \in \mathcal{X}$
             \State $J_N(x) \gets g_N(x) \quad \forall x \in \mathcal{X}$
             \For{$k = N - 1$ to $0$}
             \For{$k = N - 1$ to $0$}
                 \For{$x \in \mathcal{X}$}
                 \For{$x \in \mathcal{X}$}