Skip to content

New interface for SDDP #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Apr 18, 2017
Merged

New interface for SDDP #142

merged 34 commits into from
Apr 18, 2017

Conversation

frapac
Copy link
Member

@frapac frapac commented Apr 12, 2017

  • Add a new interface SDDPInterface to ease the resolution
  • Factorize cuts pruning in a dedicated package CutPruners.jl
  • Use stopping criteria implemented in StochasticDualDynamicProgramming.jl

**Warning: ** these two packages are currently unregistered in julia's METADATA

@@ -4,3 +4,5 @@ Distributions
ProgressMeter
Interpolations
Iterators
CutPruners
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to register the Packages or at least give instruction to install

(verbose > 0) && println("Initial value function loaded into memory.")
function solve_SDDP(model::SPModel, param::SDDPparameters, verbose=0::Int64;
stopcrit::AbstractStoppingCriterion=IterLimit(20),
prunalgo::AbstractCutPruningAlgo=CutPruners.AvgCutPruningAlgo(-1),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If CutPruningAlgo is an independent package we should keep a way of doing no cut pruning without calling this package.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't want to put CutPruners in the REQUIRE file ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we should keep CutPruners in REQUIRE, and register this package in METADATA.
In my previous answer, I rather mean that I have to change the default argument prunalgo in solve_SDDP so as to perform no cuts pruning by default.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am a new user I might find disturbing to find that I need to install a new package (CutPruners) even if I don't want to use it.

I have to find out if there is a way to check if a package is installed and load and use it in this case without having it in REQUIRE. Same thing apply to plot packages.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok after some reading (e.g. JuliaLang/julia#6195) the feature I want is not ready yet. Some workaround exists but are not really useful as of now if the other package in REQUIRE are in METADATA.jl

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use eval to check whether a module is installed react depending on this but this does not work anymore on Julia v0.6 since JuliaLang/julia#265 has been merged (see e.g. JuliaOpt/MathProgBase.jl#150).

println("SDDP CONVERGENCE")
@printf("- Exact lower bound: %.4e [Gap < %.2f%s]\n",
lwb, 100*(upb+tol-lwb)/lwb, '%')
@printf("- Estimation of upper-bound: %.4e\n", upb)
@printf("- Upper-bound's s.t.d: %.4e\n", σ)
@printf("- Confidence interval (%d%s): [%.4e , %.4e]",
100*(1- 2*(1-param.confidence_level)), '\%',upb-tol, upb+tol)
println("\n############################################################")
println("\n", "#"^60)
end
end


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Precise when the function is called, e.g. between two iterations of sddp

using MathProgBase, JuMP, Distributions
using MathProgBase, JuMP, Distributions, StochasticDualDynamicProgramming
using DocStringExtensions
using CutPruners
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If CutPruners is independant we should try to have a mechanism to be able to use the package without it

Copy link
Member

@blegat blegat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me :)

@frapac frapac merged commit e1ce8c0 into release-0.4 Apr 18, 2017
@frapac frapac deleted the sddpcleaning branch April 18, 2017 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants