Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  decision variables as a condition in "if" statement

    Posted 03/18/12 12:47 PM

    Originally posted by: HuiD


    Hi, I'm trying to write one of the constraints, one decision variable decide another decision variable.

    dvar boolean x[u in RV][v in RV][t in dem];
    dvar int z[u in RV][t in dem] in 1..N;
     
    subject to {
            forall(t in dem, u in RV) {
                    forall(v in OL[u]) {
                            if(x[u][v][t] == 1)
                                    z[t][u] == z[t][v] + 1;
                    }
            }
    }
    


    there will be an error "decision variable ’x' is node allowed."

    How can I write these constraints properly? The variable z cannot be compute by the input matrix, but decide by the decision variable x.

    Thanks
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: decision variables as a condition in "if" statement

    Posted 03/19/12 06:49 AM

    Originally posted by: SystemAdmin


    Hi,

    you should use conditinal constraints, i.e. something like
    //... as in your formulation
       (x[u][v][t] == 1) =>(z[t][u] == z[t][v] + 1);
    


    Best regards
    Norbert
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: decision variables as a condition in "if" statement

    Posted 03/19/12 11:33 AM

    Originally posted by: HuiD


    Thanks, Norbert, your code is right.

    I cannot find the conditional constraints writing like this in the OPL manual, is there other references?

    Hui
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: decision variables as a condition in "if" statement

    Posted 03/19/12 11:43 AM

    Originally posted by: SystemAdmin


    Sorry, gave you the wrong keyword. It should have been "logical constraints".

    Please have a look at:

    IDE and OPL > Optimization Programming Language (OPL) >
    Language User’s Manual >
    The application areas >
    Tutorial: Using CPLEX logical constraints

    Regards
    Norbert
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: decision variables as a condition in "if" statement

    Posted 03/19/12 11:47 AM

    Originally posted by: HuiD


    Oh, I can find it now, thanks!

    Hui
    #DecisionOptimization
    #OPLusingCPLEXOptimizer