Skip to content

Commit de90a10

Browse files
committed
[FIX] Hotfix breaking tests + benchmark
1 parent 90d4742 commit de90a10

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

examples/benchmark.jl

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -214,16 +214,7 @@ function benchmark_sddp()
214214
texec = toq()
215215
println("Time to perform simulation: ", texec, "s")
216216

217-
# Get costs with deterministic solution:
218-
println("Compute anticipative solution ...")
219-
costs_det = zeros(n_assessments)
220-
for n in 1:n_assessments
221-
costs_det[n] = solve_determinist_problem(model, aleas[:, n, :])
222-
end
223-
224-
println("SDDP cost: \t", mean(costs_sddp))
225-
println("Deterministic cost: \t", mean(costs_det))
226-
println("Gap: \t", mean(costs_det)/mean(costs_sddp))
217+
println("SDDP cost: \t", mean(costs_sddp))
227218
return stocks, V
228219
end
229220

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ facts("SDDP algorithm: 1D case") do
139139
sddp_costs, stocks = forward_simulations(model, params, V, pbs, noise_scenarios)
140140

141141
# Compare sddp cost with those given by extensive formulation:
142-
ef_cost = StochDynamicProgramming.extensive_formulation(model,params)
142+
ef_cost = StochDynamicProgramming.extensive_formulation(model,params)[1]
143143
@fact typeof(ef_cost) --> Float64
144144

145145
@fact mean(sddp_costs) --> roughly(ef_cost)
@@ -253,7 +253,7 @@ facts("SDDP algorithm: 2D case") do
253253
sddp_costs, stocks = forward_simulations(model, params, V, pbs, noise_scenarios)
254254

255255
# Compare sddp cost with those given by extensive formulation:
256-
ef_cost = StochDynamicProgramming.extensive_formulation(model,params)
256+
ef_cost = StochDynamicProgramming.extensive_formulation(model,params)[1]
257257
@fact typeof(ef_cost) --> Float64
258258

259259
@fact mean(sddp_costs) --> roughly(ef_cost)

0 commit comments

Comments
 (0)