Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Oct 25, 2024
1 parent c131148 commit 0cd9a0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
10 changes: 2 additions & 8 deletions src/user_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions test/visualization/value_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0cd9a0b

Please sign in to comment.