|
59 | 59 | ------------------------------------------------------------------- |
60 | 60 | iteration simulation bound time (s) solves pid |
61 | 61 | ------------------------------------------------------------------- |
62 | | - 1 2.390000e+02 6.216295e+01 9.639192e-02 183 1 |
63 | | - 33 9.531154e+02 2.351331e+02 1.133409e+00 8715 1 |
64 | | - 59 4.476384e+02 2.363016e+02 2.169243e+00 15513 1 |
65 | | - 74 9.550751e+02 2.364090e+02 3.248207e+00 21198 1 |
66 | | - 97 4.655029e+02 2.364295e+02 4.329453e+00 26115 1 |
67 | | - 100 1.164997e+02 2.364302e+02 4.455294e+00 26640 1 |
| 62 | + 1 2.390000e+02 6.216295e+01 9.605002e-02 183 1 |
| 63 | + 33 9.531154e+02 2.351331e+02 1.141613e+00 8715 1 |
| 64 | + 60 4.429060e+02 2.363260e+02 2.188160e+00 16008 1 |
| 65 | + 77 4.435024e+02 2.364181e+02 3.257002e+00 22551 1 |
| 66 | + 100 1.164997e+02 2.364302e+02 3.990374e+00 26640 1 |
68 | 67 | ------------------------------------------------------------------- |
69 | 68 | status : iteration_limit |
70 | | -total time (s) : 4.455294e+00 |
| 69 | +total time (s) : 3.990374e+00 |
71 | 70 | total solves : 26640 |
72 | 71 | best bound : 2.364302e+02 |
73 | 72 | simulation ci : 2.593751e+02 ± 5.185751e+01 |
74 | 73 | numeric issues : 0 |
75 | 74 | -------------------------------------------------------------------</code></pre><h2 id="Simulating-the-policy"><a class="docs-heading-anchor" href="#Simulating-the-policy">Simulating the policy</a><a id="Simulating-the-policy-1"></a><a class="docs-heading-anchor-permalink" href="#Simulating-the-policy" title="Permalink"></a></h2><p>After training, we can simulate the policy using <a href="../../apireference/#SDDP.simulate"><code>SDDP.simulate</code></a>.</p><pre><code class="language-julia hljs">sims = SDDP.simulate(model, 100, [:g_t]) |
76 | 75 | mu = round(mean([s[1][:g_t] for s in sims]); digits = 2) |
77 | 76 | println("On average, $(mu) units of thermal are used in the first stage.")</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">On average, 1.76 units of thermal are used in the first stage.</code></pre><h2 id="Extracting-the-water-values"><a class="docs-heading-anchor" href="#Extracting-the-water-values">Extracting the water values</a><a id="Extracting-the-water-values-1"></a><a class="docs-heading-anchor-permalink" href="#Extracting-the-water-values" title="Permalink"></a></h2><p>Finally, we can use <a href="../../apireference/#SDDP.ValueFunction"><code>SDDP.ValueFunction</code></a> and <a href="../../apireference/#SDDP.evaluate"><code>SDDP.evaluate</code></a> to obtain and evaluate the value function at different points in the state-space. Note that since we are minimizing, the price has a negative sign: each additional unit of water leads to a decrease in the expected long-run cost.</p><pre><code class="language-julia hljs">V = SDDP.ValueFunction(model[1]) |
78 | | -cost, price = SDDP.evaluate(V; x = 10)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">(233.55197669813393, Dict(:x => -0.6602685558602484))</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../FAST_quickstart/">« FAST: the quickstart problem</a><a class="docs-footer-nextpage" href="../StochDynamicProgramming.jl_multistock/">StochDynamicProgramming: the multistock problem »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.15.0 on <span class="colophon-date" title="Thursday 13 November 2025 21:42">Thursday 13 November 2025</span>. Using Julia version 1.12.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
| 77 | +cost, price = SDDP.evaluate(V; x = 10)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">(233.55197669813393, Dict(:x => -0.6602685558602484))</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../FAST_quickstart/">« FAST: the quickstart problem</a><a class="docs-footer-nextpage" href="../StochDynamicProgramming.jl_multistock/">StochDynamicProgramming: the multistock problem »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.15.0 on <span class="colophon-date" title="Thursday 13 November 2025 23:02">Thursday 13 November 2025</span>. Using Julia version 1.12.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
0 commit comments