Skip to content

Commit fb46bbd

Browse files
committed
[FIX] clean and comments before pull request
1 parent c334919 commit fb46bbd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

examples/stock-example.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ end
6161
######## Setting up the SPmodel
6262
s_bounds = [(0, 1)] # bounds on the state
6363
u_bounds = [(CONTROL_MIN, CONTROL_MAX)] # bounds on controls
64-
spmodel = LinearSPModel(N_STAGES,u_bounds,[S0],cost_t,dynamic,xi_laws, ConvexCombi(0,0))
64+
spmodel = LinearSPModel(N_STAGES,u_bounds,[S0],cost_t,dynamic,xi_laws, Expectation())
6565
set_state_bounds(spmodel, s_bounds) # adding the bounds to the model
6666
println("Model set up")
6767

src/forwardBackwardIterations.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ function compute_cuts_hd!(model::SPModel, param::SDDPparameters,
316316
# It is initialized at 0. If all problem are infeasible for
317317
# current timestep, then proba remains equal to 0 and not cut is added.
318318
proba = zeros(model.noises[t].supportSize)
319-
319+
320320
# We iterate other the possible realization of noise:
321321
for w in 1:model.noises[t].supportSize
322322

@@ -343,9 +343,10 @@ function compute_cuts_hd!(model::SPModel, param::SDDPparameters,
343343
if sum(proba) > 0
344344
# Scale probability (useful when some problems where infeasible):
345345
proba /= sum(proba)
346-
346+
347+
#Modify the probability vector to compute the value of the risk measure
347348
proba = change_proba_risk(proba,model.riskMeasure,sortperm(costs,rev = true))
348-
349+
349350
# Compute expectation of subgradient λ:
350351
subgradient = vec(sum(proba' .* subgradient_array, 2))
351352
# ... expectation of cost:

0 commit comments

Comments
 (0)