Skip to content
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

Dev sdp search spaces #143

Merged
merged 19 commits into from
Apr 19, 2017
Merged

Dev sdp search spaces #143

merged 19 commits into from
Apr 19, 2017

Conversation

trigaut
Copy link
Member

@trigaut trigaut commented Apr 13, 2017

This branch introduces the possibility to compute a complex control search space knowing t,x and eventually w. Forward simulations are parallelized. Naming is more consistent with SDDP. SDP implementation is more modular and IMO cleaner. The next step is to delete StochDynProgModel to be fully consistent with SDDP. I will take care of issue #138 at the same time.

@trigaut trigaut requested review from leclere and frapac April 13, 2017 12:44
@frapac
Copy link
Member

frapac commented Apr 13, 2017

Good job!

Could you benchmark DP in master and in this branch, just to see by how much DP was improved?

src/objects.jl Outdated
@@ -113,6 +113,8 @@ type StochDynProgModel <: SPModel
constraints::Function
noises::Vector{NoiseLaw}

build_search_space::Union{Void, Function}
Copy link
Member

Choose a reason for hiding this comment

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

Instead of Union, the Julia's doc advices to use the Nullable type (as far as I understand, it is better for the compiler)

https://docs.julialang.org/en/release-0.4/manual/types/#nullable-types-representing-missing-values

src/sdpLoops.jl Outdated
the indexes of the variable

"""
function index_from_variable(variable, bounds::Array, variable_steps::Array)
Copy link
Member

Choose a reason for hiding this comment

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

What do you think of this signature instead

function index_from_variable{T}(variable::Vector{T}, bounds::Vector{T}, variable_steps::Vector{T})

src/sdpLoops.jl Outdated
the indexes of the variable

"""
function is_next_state_feasible(next_state, x_dim, x_bounds)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should add the types in the function's signature?

src/sdpLoops.jl Outdated
function sdp_dh_get_u(sampling_size, samples, probas, u_bounds,
x_bounds, x_steps, x_dim, product_controls,
dynamics, constraints, cost, Vitp, t, x, w,
build_Ux = nothing)
Copy link
Member

Choose a reason for hiding this comment

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

What if we factorize the arguments of this function in a dedicated type (as SDPLoop or whatever)?
I think that would DRY a bit the code, and makes the signature of this function and the following ones nicer.

@codecov-io
Copy link

codecov-io commented Apr 19, 2017

Codecov Report

❗ No coverage uploaded for pull request base (release-0.4@e1ce8c0). Click here to learn what that means.
The diff coverage is 79.38%.

Impacted file tree graph

@@              Coverage Diff               @@
##             release-0.4     #143   +/-   ##
==============================================
  Coverage               ?   87.87%           
==============================================
  Files                  ?       12           
  Lines                  ?      767           
  Branches               ?        0           
==============================================
  Hits                   ?      674           
  Misses                 ?       93           
  Partials               ?        0
Impacted Files Coverage Δ
src/objects.jl 95% <ø> (ø)
src/sdp.jl 71.85% <71.85%> (ø)
src/sdpLoops.jl 96.61% <96.61%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e1ce8c0...a1fd8e0. Read the comment docs.

Copy link
Collaborator

@leclere leclere left a comment

Choose a reason for hiding this comment

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

Ok pour moi.

src/sdp.jl Outdated
@@ -0,0 +1,460 @@
# Copyright 2015, Vincent Leclere, Francois Pacaud, Henri Gerard and
Copy link
Collaborator

Choose a reason for hiding this comment

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

Replace name by first letter and dot, like V. Leclere

src/sdpLoops.jl Outdated
discretization step for each component

# Returns
* `index::Tuple{Integeres}`:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Integers

@trigaut trigaut merged commit 093d1d0 into release-0.4 Apr 19, 2017
@trigaut trigaut deleted the dev_sdp_search_spaces branch April 19, 2017 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants