Originally posted by: SystemAdmin
Hello,
I am not used with CPLEX thus in other softwares this problem never happened to me, let me see if you might know how i can do this:
I am using a objective function that uses a binary decision variable lets say Y[i][j]
My objective function (maximization) will calculate a price if there Y exists in [i][j], this is Y[i][j] * Price, but will discount a penalty if Y exists in
i+1[j], this is Y
i+1[j] * Penalty. In the end the function would be something like:
maximize sum (i in days, j in years) Y[i][j] * Price - Y
i+1[j] * Penalty
But this brings an error: operator not available for string +int
if I use Y[i][j] * Price - Y[i][j] * Penalty (no i+1) the optimization runs smoothly.
days is defined as a string, {string} Days =...; and is associated with a excel table something like this C2:E2 (monday, tuesday, sunday). Might this be the problem, to have the index as a string and therefore not possible to calculate the i+1?
How can I implement this?
Thank you for the help.
#CPLEXOptimizers#DecisionOptimization