I'm solving an integer programming problem using Gurobi in python, in which the objective expression includes some conditional functions.
Explicitly, the problem is modeled as follow:
max [sum(f(x_i, a_i)) + sum(g(x_i - x_[i-1]))]
f(x, a) = 0 if x = a;
1 otherwise.
g(x) = x if x > 0;
0 otherwise.
x_i in {1, 3, 5, 7, 10}
x_i are decision variables.
a_i, b_i are given parameters. a_i, b_i in {1, 3, 5, 7, 10}
How to construct the objective function in Gurobi with python?
Is there any other tools that can handle this problem?
Thank you for your helping!