JuMP Opt field names

jump
#1

How to access the model colVal field under the new version of JuMP?

#2

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).

#3

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!

#4

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 http://www.juliaopt.org/JuMP.jl/latest/variables

variables = JuMP.all_variables(model)
colVal = JuMP.value.(variables)
#5

JuMP.all_variables(m) works! Thank you very much! (it is JuMP.all_variables(m) not JuMP.add_variables(m))

#6

Oops, muscle memory… I’ve updated the post.

#7

colVal = JuMP.value.(variables) does not work before optimize!; call we get initial values in some way?

#8

You’re looking for JuMP.start_value(x) and JuMP.set_start_value(x, value).

This was overlooked in the documentation: https://github.com/JuliaOpt/JuMP.jl/issues/1871

#9

works! Thank you very much!