Skip to content

gurobipy addConstr() can't take more than two arguments

Hi Ove, hi all, There are 3 instances in mptool.py where gurobipy method addConstr() is used, and is seems that my gurobipy version (12.0.1) does not accept more than 2 arguments (see, e.g. line lp.addConstr(c, '=', m._bound, m.id)). From gurobipy documentation I figured that the constraint expression should be encapsulated as a grb.TempConstr object (i.e. lp.addConstr(grb.TempConstr(c, '=', m._bound), m.id)) - and it works. Perhaps worth having a look at?

Cheers, Pranas