Skip to content

Commit

Permalink
Fix non-constant state dimension in MSPFormat reader (#695)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Oct 28, 2023
1 parent db77365 commit 26717bf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/MSPFormat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,17 @@ function read_from_file(
ω_objective[x] = objective
end
end
for str_name in state_variables
sym_name = Symbol(str_name)
if !haskey(JuMP.object_dictionary(sp), sym_name)
sp[sym_name] = JuMP.@variable(
sp,
variable_type = SDDP.State,
initial_value = 0.0,
base_name = "$sym_name",
)
end
end
for constraint in problem["constraints"]
lhs, lhs_data = _build_lhs(stage, sp, constraint["lhs"])
if lhs === nothing
Expand Down

0 comments on commit 26717bf

Please sign in to comment.