Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

How to assign a specific value to the decision variable.

  • 1.  How to assign a specific value to the decision variable.

    Posted 11/20/17 11:57 PM

    Originally posted by: k_ka


    Hello everyone,

    Is it possible to assign a specific value to the decision variables?

     

    For example, 
    I want to assign the value of array a[1..5].

     

    int a[1..5] = [1, 3, 10, 24, 60];

    dvar int x; // 1 or 3 or 10 or 24 or 60


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: How to assign a specific value to the decision variable.

    Posted 11/21/17 02:07 AM

    Hi

     int a[1..5] = [1, 3, 10, 24, 60];

    dvar int x; // 1 or 3 or 10 or 24 or 60

    subject to
    {
    1==sum(i in 1..5) (x==a[i]);
    }

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: How to assign a specific value to the decision variable.

    Posted 11/21/17 09:03 PM

    Originally posted by: k_ka


    Thanks to you, the problem has been solved.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer