Skip to content

Commit

Permalink
Add docs using JuliaDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Jan 7, 2017
1 parent ef18aa0 commit 72e3a1b
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ after_success:
- julia -e 'cd(Pkg.dir("StochasticDualDynamicProgramming")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
# push coverage results to Codecov
- julia -e 'cd(Pkg.dir("StochasticDualDynamicProgramming")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
# build docs
- julia -e 'Pkg.add("Documenter")'
- julia -e 'cd(Pkg.dir("StochasticDualDynamicProgramming")); include(joinpath("docs", "make.jl"))'
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
site
9 changes: 9 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Documenter, StochasticDualDynamicProgramming

makedocs()

deploydocs(
deps = Deps.pip("mkdocs", "python-markdown-math"),
repo = "github.com/blegat/StochasticDualDynamicProgramming.jl.git",
julia = "release"
)
24 changes: 24 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
site_name: StochasticDualDynamicProgramming.jl
repo_url: https://github.com/blegat/StochasticDualDynamicProgramming.jl
site_description: Implementation of SDDP (Stochastic Dual Dynamic Programming) using the StructJuMP modeling interface
site_author: Benoît Legat

theme: readthedocs

extra_css:
- assets/Documenter.css

extra_javascript:
- https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
- assets/mathjaxhelper.js

markdown_extensions:
- extra
- tables
- fenced_code
- mdx_math

docs_dir: 'build'

pages:
- Home: index.md
17 changes: 17 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# StochasticDualDynamicProgramming.jl Documentation

```@contents
```

## Functions


```@docs
model2lattice(m::JuMP.Model, num_stages, solver, cutmanager::AbstractCutManager, cutmode::Symbol, newcut::Symbol)
SDDP(root::SDDPNode, num_stages; mccount::Int, verbose, pereiracoef, stopcrit::Function, pathsel::Symbol, ztol)
```

## Index

```@index
```
5 changes: 5 additions & 0 deletions src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@ function getSDDPNode(allnodes, m::Model, t, num_stages, solver, parent, cutmanag
get(nodes[t])
end

"""
model2lattice(m, num_stages, solver, cutmanager, cutmode, newcut)
Transforms a [StructJuMP](https://github.com/StructJuMP/StructJuMP.jl) model `m` into a lattice that can be used by the SDDP algorithm.
"""
function model2lattice(m::Model, num_stages, solver, cutmanager::AbstractCutManager, cutmode::Symbol=:MultiCut, newcut::Symbol=:AddImmediately)
nodes = Vector{Vector{SDDPNode}}(num_stages)
for i in 1:num_stages
Expand Down
5 changes: 5 additions & 0 deletions src/sddp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ function iteration{S}(root::SDDPNode{S}, totalmccount::Int, num_stages, verbose,
rootsol, stats, z_UB, σ
end

"""
SDDP(root, num_stages; mccount, verbose, pereiracoef, stopcrit, pathsel, ztol)
Runs the SDDP algorithms on the lattice given by `root`.
"""
function SDDP(root::SDDPNode, num_stages; mccount::Int=25, verbose=0, pereiracoef=2, stopcrit::Function=(x,y)->false, pathsel::Symbol=:Proba, ztol=1e-6)
if !(pathsel in [:Proba, :nPaths])
error("Invalid pathsel")
Expand Down

0 comments on commit 72e3a1b

Please sign in to comment.