Hi everybody.
I'm using gurobipy and I'm trying to create a reference to a list of variables so that I can easily fetch its values after an optimization.
I create the variables and references more or less like this:
m = Model("SOLVECONTINUOUS") z_plus = m.addVars(range(1000), lb = 0.0, obj = 1.0, vtype = GRB.CONTINUOUS, names = "z_plus")
and I was expecting to be able to fetch a value with an expression like this:
m.getVarByName("z[345]")
Reading the documentation you'd get that impression. http://www.gurobi.com/documentation/8.0/refman/py_model_addvars.html
But it turns out that the name was never assigned:
In: [x.VarName for x in m.getVars()]
Out: ['C0',
'C1',
'C2',
'C3',
'C4', ...
what am I doing wrong?