Skip to content
Advertisement

Gurobi MVar: Accessing Attributes always throws a GurobiError

I am trying to use Gurobi’s MVar class.

import gurobipy as gp

m = gp.Model()
v = m.addMVar((10,))
v.lb  # raises GurobiError, index out of range...

Advertisement

Answer

Call

m.update()

before accessing lb.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement