Cannot name JuMP variables after they are successfully read in

11 views Asked by At

I have read in vectors of tuples into variables with the below:

@variable(model, x[flowslist] >= 0.0)
@variable(model, y[edgelist] >= 0.0)
@variable(model, z[supplylist] >=0.0)

But then hit an error when I try to change the name of these variables:

name(x)

Error returned is as follows:

MethodError: no method matching name(::JuMP.Containers.DenseAxisArray{VariableRef, 1, Tuple{Vector{Tuple{String15, String15, String31}}}, Tuple{JuMP.Containers._AxisLookup{Dict{Tuple{String15, String15, String31}, Int64}}}})

MethodError. Any idea what caused this or how to fix it? I would normally assume that if the variables are read in then there is no problem as such.

0

There are 0 answers