Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  help with objective function (operator not available for string +int)

    Posted 03/25/13 01:16 PM

    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 Yi+1[j] * Penalty. In the end the function would be something like:

    maximize sum (i in days, j in years) Y[i][j] * Price - Yi+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


  • 2.  Re: help with objective function (operator not available for string +int)

    Posted 03/25/13 05:59 PM

    Originally posted by: SystemAdmin


    Yes, that seems likely to be the error. OPL defines a function next() to allow you to get a successor to a set member. (Check the OPL language reference for its arguments and use.)

    There is a separate forum for OPL. In the future, I suggest posting OPL questions there for faster (and better) responses.

    Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: help with objective function (operator not available for string +int)

    Posted 03/25/13 09:14 PM

    Originally posted by: SystemAdmin


    Thank you. I will look up this function and ask aroun in the OLP forum. Thanks for the advice.

    Best regards,
    Marco Amorim
    #CPLEXOptimizers
    #DecisionOptimization