JuMP Opt field names

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 JuMP.value(x).

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?

See Variables · JuMP

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 JuMP.start_value(x) and JuMP.set_start_value(x, value).

This was overlooked in the documentation: start_value and set_start_value are not listed in the documentation · Issue #1871 · jump-dev/JuMP.jl · GitHub

works! Thank you very much!