I have a minimize problem and its objective function need to get absolute of a linear equation. But when I run these code, it raise this error TypeError: bad operand type for abs(): 'LinearExpr'. How can I fix this?
I searched this error on Internet but I can't find any solutions
from docplex.mp.model import Model
model = Model()
x = model.integer_var_list(9,lb=0, name='x')
y = sum(var for var in x[0:9]) # ->output: x_0+x_1+x_2
obj = abs(y)
model.set_objective('min', obj)