@@ -88,9 +88,9 @@ function run_SDDP(model::SPModel,
8888
8989 while (iteration_count < param. maxItNumber) & (~ stopping_test)
9090 # Time execution of current pass:
91- if display > 0
92- tic ()
93- end
91+ if display > 0
92+ tic ()
93+ end
9494
9595 # Build given number of scenarios according to distribution
9696 # law specified in model.noises:
@@ -171,10 +171,7 @@ Float64 (estimation of the upper bound)
171171"""
172172function estimate_upper_bound (model, param, V, problems, n_simulation= 1000 )
173173
174- aleas = simulate_scenarios (model. noises ,
175- (model. stageNumber- 1 ,
176- n_simulation,
177- model. dimNoises))
174+ aleas = simulate_scenarios (model. noises, n_simulation)
178175
179176 costs, stockTrajectories, _ = forward_simulations (model,
180177 param,
@@ -332,10 +329,7 @@ function initialize_value_functions( model::SPModel,
332329 V = Array {PolyhedralFunction} (model. stageNumber)
333330
334331 # Build scenarios according to distribution laws:
335- aleas = simulate_scenarios (model. noises,
336- (model. stageNumber- 1 ,
337- param. forwardPassNumber,
338- model. dimNoises))
332+ aleas = simulate_scenarios (model. noises, param. forwardPassNumber)
339333
340334 V[end ] = V_final
341335
@@ -464,20 +458,20 @@ Parameters:
464458 Linear problems used to approximate the value functions
465459
466460- t (Int64)
467- Time
461+ Time
468462
469463- xt (Vector{Float64})
470- Position where to compute optimal control
464+ Position where to compute optimal control
471465
472466- xi (Vector{Float64})
473- Alea at time t
467+ Alea at time t
474468
475469Return:
476- Vector{Float64}: optimal control at time t
470+ Vector{Float64}: optimal control at time t
477471
478472"""
479473function get_control (model:: SPModel , param:: SDDPparameters , lpproblem:: Vector{JuMP.Model} , t, xt, xi)
480- return solve_one_step_one_alea (model, param, lpproblem[t], t, xt, xi)[2 ]. optimal_control
474+ return solve_one_step_one_alea (model, param, lpproblem[t], t, xt, xi)[2 ]. optimal_control
481475end
482476
483477
0 commit comments