Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Using Conditional expression c ? e1 : e2 ;

  • 1.  Using Conditional expression c ? e1 : e2 ;

    Posted Sun June 17, 2012 09:45 AM

    Originally posted by: Avri


    Hi,
    I am trying to use the following expression:

    dvar int rdt in lots ;
    dexpr int wt in lots = (startOf(task[t]) - rd[t] < QT) ? 1 : 10;**

    in the obtained solution the value of w[t] is always 1, that is (startOf(task[t]) - rd[t] < QT) is always true regardless of the values startOf(task[t]) and rd[t] are getting.
    What am I doying wrong ?
    Thanks,
    Avri
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: Using Conditional expression c ? e1 : e2 ;

    Posted Sun June 17, 2012 01:22 PM

    Originally posted by: Avri


    Adding additional clauses did the trick...
    Sorry,
    Avri
    #DecisionOptimization
    #OPLusingCPOptimizer