Skip to content

Commit 06b31b2

Browse files
authored
Merge pull request #103 from JuliaOpt/dev-nightly
V0.1.3
2 parents 9d144b0 + e0e58fe commit 06b31b2

27 files changed

+1471
-1422
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ os:
33
- linux
44
julia:
55
- release
6-
- nightly
76
- 0.4
87
notifications:
98
email: false

README.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
# StochDynamicProgramming
22

33

4-
54
**WARNING:** *This package is currently in development. Any help or feedback is appreciated.*
65

76

8-
[![Build Status](https://travis-ci.org/leclere/StochDynamicProgramming.jl.svg?branch=master)](https://travis-ci.org/leclere/StochDynamicProgramming.jl)
9-
[![codecov.io](https://codecov.io/github/leclere/StochDynamicProgramming.jl/coverage.svg?branch=master)](https://codecov.io/github/leclere/StochDynamicProgramming.jl?branch=master)
7+
**Latest release:** 0.1.3
8+
9+
10+
[![Build Status](https://travis-ci.org/JuliaOpt/StochDynamicProgramming.jl.svg?branch=master)](https://travis-ci.org/JuliaOpt/StochDynamicProgramming.jl)
11+
[![codecov.io](https://codecov.io/github/JuliaOpt/StochDynamicProgramming.jl/coverage.svg?branch=master)](https://codecov.io/github/JuliaOpt/StochDynamicProgramming.jl?branch=master)
1012

1113

1214
This is a Julia package for optimizing controlled stochastic dynamic system (in discrete time). It offers three methods of resolution :
1315

14-
- Extensive formulation
15-
- Stochastic Dynamic Programming.
16-
- *Stochastic Dual Dynamic Programming* (SDDP) algorithm.
16+
- *Extensive formulation*.
17+
- *Stochastic Dynamic Programming*.
18+
- *Stochastic Dual Dynamic Programming* (SDDP) algorithm.
1719

1820
It is built upon [JuMP](https://github.com/JuliaOpt/JuMP.jl)
1921

@@ -22,12 +24,15 @@ It is built upon [JuMP](https://github.com/JuliaOpt/JuMP.jl)
2224
- Stage-wise independent discrete noise
2325
- Linear dynamics
2426
- Linear or convex piecewise linear cost
25-
Extension to non-linear formulation are under development.
27+
28+
Extension to non-linear formulation are under development.
29+
Extension to more complex alea dependance are under developpment.
2630

2731
## Why Extensive formulation ?
2832

29-
An extensive formulation approach consists in representing the problem in a linear
30-
problem solved by an external linear solver. Complexity is exponential in number of stages.
33+
An extensive formulation approach consists in representing the stochastic problem as a deterministic
34+
one with more variable and call a standard deterministic solver. Mainly usable in a linear
35+
setting. Computational complexity is exponential in the number of stages.
3136

3237
## Why Stochastic Dynamic Programming ?
3338

@@ -39,23 +44,26 @@ in the dimension of the state space.
3944

4045
SDDP is a dynamic programming algorithm relying on cutting planes. The algorithm require convexity
4146
of the value function but does not discretize the state space. The complexity is linear in the
42-
number of stage, and can accomodate higher dimension state than standard dynamic programming.
47+
number of stage, and can accomodate higher dimension state than standard dynamic programming.
4348
The algorithm return exact lower bound and estimated upper bound as well as approximate optimal
4449
control strategies.
4550

4651

4752

4853
## Installation
54+
Installing StochDynamicProgramming is an easy process. Open Julia and enter
4955

50-
```bash
51-
Pkg.clone("https://github.com/leclere/StochDynamicProgramming.jl.git")
56+
```julia
57+
julia> Pkg.update()
58+
julia> Pkg.add("StochDynamicProgramming")
5259

5360
```
5461

62+
5563
## Usage
5664

5765
IJulia Notebooks will be provided to explain how this package work.
58-
A first example on a two dams valley [here.] (https://github.com/leclere/StochDP-notebooks/blob/master/notebooks/damsvalley.ipynb)
66+
A first example on a two dams valley [here.] (http://nbviewer.jupyter.org/github/leclere/StochDP-notebooks/blob/master/notebooks/damsvalley.ipynb)
5967

6068

6169
## Documentation
@@ -74,3 +82,7 @@ cd doc
7482
make html
7583

7684
```
85+
86+
## License
87+
88+
Released under Mozilla Public License (see LICENSE.md for further details).

doc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Contents:
5050
install
5151
quickstart
5252
tutorial
53+
install_windows
5354

5455
.. _MathProgBase: http://mathprogbasejl.readthedocs.org/en/latest/
5556
.. _here: http://www2.isye.gatech.edu/people/faculty/Alex_Shapiro/ONS-FR.pdf

doc/install.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ To install StochDynamicProgramming::
1212

1313
julia> Pkg.add("StochDynamicProgramming")
1414

15+
1516
Once the package is installed, you can import it in the REPL::
1617

1718
julia> using StochDynamicProgramming

doc/install_windows.rst

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
.. _install_windows:
2+
3+
===========================================
4+
Install StochDynamicProgramming on Windows
5+
===========================================
6+
7+
8+
Installing Julia
9+
~~~~~~~~~~~~~~~~
10+
11+
StochDynamicProgramming is a Julia package so if you want to use it, you
12+
need first to install Julia depending on whether your computer is 32-bit
13+
or 64-bit. To determine that, follow the steps
14+
`here <http://windows.microsoft.com/fr-fr/windows7/find-out-32-or-64-bit>`__.
15+
16+
Once it is done, you can follow this
17+
`link <http://julialang.org/downloads/>`__ to install Julia (command
18+
line version) appropriate to your computer.
19+
20+
Installing the package in Julia
21+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22+
23+
Open the Julia terminal using the desktop icon or looking for it in the
24+
search bar of Windows. Then copy-past or enter the following line::
25+
26+
julia> Pkg.add("StochDynamicProgramming.jl")
27+
28+
Once it is done, you can use the package. To see where the files are located,
29+
you can enter the command::
30+
31+
julia> pwd()
32+
33+
in the command line of Julia.
34+
35+
Compiling the doc
36+
=================
37+
38+
To compile the doc, you will need a C compiler to execute a makefile,
39+
Python and Sphinx installed.
40+
41+
Installing Python and Sphinx
42+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43+
44+
Follow this
45+
`link <http://www.sphinx-doc.org/en/stable/install.html#windows-install-python-and-sphinx>`__
46+
to install Python and choose a version x86 if you want a 32-bits version
47+
and choose x86-64 if you want a 64 bits version. Be careful to add the
48+
PATH variable as it is explained.
49+
50+
Installing MinGW
51+
~~~~~~~~~~~~~~~~
52+
53+
Just follow the steps explained
54+
`here <http://www.mingw.org/wiki/Getting_Started>`__.
55+
56+
Compiling the doc
57+
~~~~~~~~~~~~~~~~~
58+
59+
Once you get Python, Sphinx and MinGW, open a command line. Go to
60+
StochDynamicProgramming folder. Enter::
61+
62+
cd doc
63+
64+
and then::
65+
66+
make html
67+
68+
Have a nice use
69+
===============
70+
71+
| Now everything is installed, you can enjoy the use of the package. If
72+
you want some example, we invite you to try our Julia Notebooks available
73+
`here <https://github.com/leclere/StochDP-notebooks/blob/master/notebooks/damsvalley.ipynb>`__.
74+
 
75+
| Don't hesitate to contact us if you encounter any problem to let us improve the
76+
document for further users !!

doc/tutorial.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Get Bellman value at a given point
1515
To estimate the Bellman value at a given position :code:`xt` with a :code:`PolyhedralFunction` :code:`Vt` ::
1616

1717
vx = get_bellman_value(model, param, t, Vt, xt)
18-
18+
1919
This is a lower bound of the true value.
2020

2121
Get optimal control at a given point
@@ -57,7 +57,7 @@ SDDP hotstart
5757

5858
If cuts are already available, we can hotstart SDDP while overloading the function :code:`solve_SDDP`::
5959

60-
V, pbs = solve_SDDP(model, params, 0, V)
60+
V, pbs = solve_SDDP(model, params, V, 0)
6161

6262

6363
Cuts pruning

examples/benchmark.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,19 +197,17 @@ function benchmark_sddp()
197197
# Launch benchmark
198198
println("Launch SDDP ...")
199199
tic()
200-
V, pbs = solve_SDDP(model, params, 0)
200+
V, pbs = @time solve_SDDP(model, params, 0)
201201
texec = toq()
202202
println("Time to solve SDDP: ", texec, "s")
203203

204204
# Test results upon 100 assessment scenarios:
205205
n_assessments = 100
206206
aleas = simulate_scenarios(model.noises,
207-
(model.stageNumber,
208-
n_assessments,
209-
model.dimNoises))
207+
n_assessments)
210208

211209
tic()
212-
costs_sddp, stocks = forward_simulations(model, params, V, pbs, aleas)
210+
costs_sddp, stocks = forward_simulations(model, params, pbs, aleas)
213211
texec = toq()
214212
println("Time to perform simulation: ", texec, "s")
215213

examples/dam.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ function solve_dams(display=0)
164164
V, pbs = solve_SDDP(model, params, display)
165165
aleas = simulate_scenarios(model.noises, params.forwardPassNumber)
166166

167-
costs, stocks = forward_simulations(model, params, V, pbs, aleas)
168-
167+
costs, stocks = forward_simulations(model, params, pbs, aleas)
169168
println("SDDP cost: ", costs)
170169
return stocks
171170
end

0 commit comments

Comments
 (0)