Decision Optimization

Decision Optimization

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


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

Problem in getting the solution value in Main block

  • 1.  Problem in getting the solution value in Main block

    Posted 12/01/15 01:44 PM

    Originally posted by: Mintch Zulitch


    HI,

    I'm trying to run the following piece of code, but I can't get the solution values for the decision variables:

     

    dvar float+ x1;
     dvar float+ x2;
     

     
     maximize x1 + x2;
     
     subject to {
     
     -5*x1 + 4*x2 <=0;
     
     5*x1 + 2*x2 <= 15;

      
     }
     

     
     main{
    thisOplModel.generate;

      
     if(cplex.solve()){
     
      writeln("x1: ", thisOplModel.x1);
       writeln("x2: ", thisOplModel.x2);
     }

     }

     

     

     

    I run the file but, "scripting log" gives this:

     

    x1: [a IloNumVar]
    x2: [a IloNumVar]


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Problem in getting the solution value in Main block

    Posted 12/01/15 02:32 PM

    Hi,

    can you try to turn

    thisOplModel.generate;

    into

    thisOplModel.generate();

    ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer