Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Executing all decision variable values in an iterative model

    Posted 03/17/16 12:34 PM

    Originally posted by: story_


    Hello everyone,

    I am solving a model in CPLEX iteratively by changing one of the coefficients I have in my model. I have taken the example file in CPLEX install directory named "mulprod". In this example file, we are able to extract and save the objective function value. Can we do the same thing for the values our decision variables get in each iteration?

    Thanks in advance.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Executing all decision variable values in an iterative model

    Posted 03/21/16 02:29 AM

    To get the solution value of a variable just access the variable directly. Like so:

     dvar float+ x;
     minimize x;
     subject to { x >= 5; }
     main {
       thisOplModel.generate();
       if (cplex.solve()) {
         writeln("x = " + thisOplModel.x);   
       }
     }


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Executing all decision variable values in an iterative model

    Posted 03/24/16 12:30 PM

    Originally posted by: story_


    Thank you for the reply, works perfectly fine! :)


    #CPLEXOptimizers
    #DecisionOptimization