Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  display details variable in CPLEX

    Posted 03/21/16 03:06 PM

    Originally posted by: NguyenHuuTRi


    Hi,

    Is there anyway to extract or display a detail variables in the constraint in CPLEX ?

    let's say xi<=1 with i from 1=100, I would like to print the details for such constraint as in the example below?

     

    TKB_58_1_1 + TKB_58_1_2 + TKB_58_1_3 + TKB_58_1_4 + TKB_58_1_5 +

       TKB_58_1_6 + TKB_58_1_7 + TKB_58_1_8 + TKB_58_1_9 + TKB_58_1_10 +

       TKB_58_1_102 + TKB_58_1_103 + TKB_58_1_104 + TKB_58_1_121 <= 1 ;


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: display details variable in CPLEX

    Posted 03/21/16 03:40 PM

    Originally posted by: Stanko_86


    Try something like:

    range iRange = 1...1000;
    dvar int x[iRange];
    
    execute
    {
            var outputStr = "";
            for(i in iRange)
            {
                    if(x[i] <= 1)
                    {
                            outputStr += x[i]; 
                    }
                    if(i != 1000)
                    {
                            outputStr += "+";
                    }
                    else
                    {
                            outputStr += "<= 1;";
                    }
            }
            writeln(outputStr);
    }
    

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer