I'm running Gurobi 7.0.1 on Python and can't get multiobjective optimisation working. Has anyone else had the same problem and knows a way around it? Maybe there's an easy way of defining multiple objectives w/o using the `model.setObjectiveN()` function.
import gurobipy as GRB
model = GRB.Model("MultObj")
set_params(model)
x = model.addVars(x_dict.keys(),
lb=0.0, ub=1.0, vtype="C", name="x")
y = model.addVars(y_dict.keys(),
vtype="B", name="y")
z = model.addVars(z_dict.keys(),
vtype="B", name="z")
obj1 = x.prod(x_dict) + y.prod(y_dict)
model.setObjectiveN(obj1, 1, 2)
model.setObjectiveN(z.sum(), 2, 2)
Where `set_params()` just sets some parameters for the optimisation (from tuning) and the `*_dicts` are just `{(index): obj_coeff}`.
The full error is regarding the `model.setObjectiveN()` function:
File "model.pxi", line 281, in gurobipy.Model.__getattr__
(../../src/python/gurobipy.c:49637)
File "model.pxi", line 1418, in gurobipy.Model.getAttr
(../../src/python/gurobipy.c:62715)
File "model.pxi", line 3724, in gurobipy.Model.__getattrinfo
(../../src/python/gurobipy.c:94154)
AttributeError: 'gurobipy.Model' object has no 'setObjectiveN'
Cheers!