Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Function to select highest of two values

    Posted 07/25/17 12:49 PM

    Originally posted by: dcraven


    I apologize if this has already been answered elsewhere, I've been unable to find the information I need.

    I am using CPLEX Optimization Studio Version: 12.7.1.0, and am using CP in my model.

    I have one constraint that is:

    (sum (k in k) sum (p in p) max (SU[p][k]-A1[p][k] || 0)) <= ((1-omega) * sum (k in k) sum (p in p) SU [p][k]);
    

    With the max function, my goal is that it gives either SU-A1, or, in the case SU-A1 is negative, it gives 0. It does this for each k/p combination, and then adds them all up. 

    My max function returns an error that says syntax error, unexpected ')', expecting in. If I understand the max function correctly, this is because it only finds the maximum within an array, and not the maximum of two values? Is there a formulation that can give me what I need?

    Thank you for your assistance.


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: Function to select highest of two values



  • 3.  Re: Function to select highest of two values

    Posted 07/25/17 04:53 PM

    Originally posted by: dcraven


    Thank you! I hadn't been able to find that function on my own.


    #DecisionOptimization
    #OPLusingCPOptimizer