From 0cd9a0bfe581bf754961ff828063c79c8e5cec0d Mon Sep 17 00:00:00 2001 From: odow Date: Fri, 25 Oct 2024 16:08:30 +1300 Subject: [PATCH] Update --- src/user_interface.jl | 10 ++-------- test/visualization/value_functions.jl | 5 ++--- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/user_interface.jl b/src/user_interface.jl index 5bfb77d90..645c7e0e6 100644 --- a/src/user_interface.jl +++ b/src/user_interface.jl @@ -478,14 +478,8 @@ function MarkovianGraph(transition_matrices::Vector{Matrix{Float64}}) for markov_state in 1:size(transition, 2) for last_markov_state in 1:size(transition, 1) probability = transition[last_markov_state, markov_state] - push!( - edges, - ( - (stage - 1, last_markov_state) => - (stage, markov_state), - probability, - ), - ) + edge = (stage - 1, last_markov_state) => (stage, markov_state) + push!(edges, (edge, probability)) end end end diff --git a/test/visualization/value_functions.jl b/test/visualization/value_functions.jl index 30eb6b153..45144a717 100644 --- a/test/visualization/value_functions.jl +++ b/test/visualization/value_functions.jl @@ -135,11 +135,10 @@ function test_ValueFunction_belief_state() @test_throws AssertionError SDDP.evaluate(V11, Dict(:x => 1.0)) b = Dict((1, 1) => 0.8, (1, 2) => 0.2) (y, duals) = SDDP.evaluate(V11, Dict(:x => 1.0); belief_state = b) - @test duals[:x] ≈ y ≈ 1.68 - + @test duals[:x] ≈ y ≈ 1.2 V12 = SDDP.ValueFunction(model[(1, 2)]) (y, duals) = SDDP.evaluate(V12, Dict(:x => 1.0); belief_state = b) - @test duals[:x] ≈ y ≈ 1.68 + @test duals[:x] ≈ y ≈ 1.2 return end