Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  problem using getvalue method

    Posted 02/09/13 12:04 PM

    Originally posted by: SystemAdmin


    I am using java cplex API and after the problem is solved I used getVaules() method to get variable values. The variables are defined to be integer and the lower bound is 0, but getValues methods returned some negative fractional number. the example code:

    //before solving the problem:

    IloIntVar E[];
    E = cplex.intVarArray(Edge_Info.size(), 0, 1, EdgeLabels);
    ......
    try{
    ......
    IloCplex cplex = new IloCplex();
    //after solved the problem:

    if(cplex.solve){
    .......
    double Sol_Edges[] = cplex.getValues(E);
    .......
    }

    Inside Sol_Edges[], I see some negative fractional numbers, even though the variable E is defined as integer and non-negative.

    Thanks for any helps!
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: problem using getvalue method

    Posted 02/09/13 04:38 PM

    Originally posted by: SystemAdmin


    If the negative fractional values are small in absolute value (e.g., -0.000001 or some such), that's just rounding error. Call the result zero.

    Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization