Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  linking IloX variables to X's (variable matrix)

    Posted 09/22/11 01:17 PM

    Originally posted by: JamieKang


    Hello,

    I have a MIP with about 200 variables, and I defined my variables x[i][j][k] (using Java). And I have a problem so I need to track down all the equations for errors.
    However, using model.export(), I get IloX notations, and it's hard to track them. I tried to match the variables, but it looks like the numbering order changes as I change my objective function.
    Is there any way to convert IloX variables to Xijk? Or is there any rules on how IloX numbers variables?

    Thanks for any tips in advance,

    Jamie
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: linking IloX variables to X's (variable matrix)

    Posted 09/22/11 03:19 PM

    Originally posted by: SystemAdmin


    CPLEX provides variables with IloXxxx type names when one has not been explicitly provided during the model creation.

    You can provide variable names using the following overloaded function for the IloCplex object during variable creation:
    public IloNumVar[] numVarArray(IloColumnArray cols,
    double[] lb,
    double[] ub,
    java.lang.String[] name)

    Alternatively, you could also set the variable names at a later stage by using the setName method for an IloNumVar object. This could look like the following:
    for(int i=0;i<i_range;i++)
    for(int j=0;j<j_range;j++)
    for(int k=0;k<k_range;k++)
    x[i][j][k].setName("x("i")("j")("k")");

    Hope this helps.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: linking IloX variables to X's (variable matrix)

    Posted 09/22/11 06:43 PM

    Originally posted by: JamieKang


    It worked out great! Thanks a lot!

    Jamie
    #CPLEXOptimizers
    #DecisionOptimization