How to access the model colVal field under the new version of JuMP?
You can’t (it doesn’t exist anymore).
Internal details such as field names may change between versions.
The correct way to access the value of a variable is
Not good. I have a function that evaluates intermediate jump results. It does not know the variable names. How i cab get the current values of all the variables. Is there something line JuMP.allvalues(m)? How i can reproduce colVal? Thank you very much!
I have a function that evaluates intermediate jump results.
What do you mean by intermediate?
Is there something line JuMP.allvalues(m)? How i can reproduce colVal?
variables = JuMP.all_variables(model) colVal = JuMP.value.(variables)
JuMP.all_variables(m) works! Thank you very much! (it is JuMP.all_variables(m) not JuMP.add_variables(m))
Oops, muscle memory… I’ve updated the post.
colVal = JuMP.value.(variables) does not work before optimize!; call we get initial values in some way?
You’re looking for
This was overlooked in the documentation: https://github.com/JuliaOpt/JuMP.jl/issues/1871
works! Thank you very much!