Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Q2: Why setting Relative MIP gap tolerance doesn't work?

    Posted 03/07/11 11:59 PM

    Originally posted by: Ulysses.Sheng


    Hey, all,

    In my codes below, I set cplex.setParam(IloCplex::EpGap, 0.001);. But why my program just doesn't stop??
    Do I put this sentence in the wrong place or for this to work, there are some other conditions?
    Really appreciate if anyone could help me out!

    Ulysses
    int Solve (int y)
    {
    IloEnv env;

    try
    {
    part 1 !!!Variable definitions!!!!
    part 2 !!!constraints!!!
    part 3 !!!objectives!!!
    IloCplex cplex(model);

    if(!cplex.solve())
    {
    env.error()<<"Failed to optimize LP"<<endl;
    throw(-1);
    }

    cplex.setParam(IloCplex::EpGap, 0.001);
    }
    catch (IloException& e)
    {
    cerr << "Concert exception caught: " << e.getMessage() << endl;
    }

    catch (...)
    {
    cerr << "Unknown exception caught" << endl;
    }
    env.end();
    return 0;
    }
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Q2: Why setting Relative MIP gap tolerance doesn't work?

    Posted 03/08/11 12:07 AM

    Originally posted by: John Cui


    You should set parameter first, then call cplex.solve().

    cplex.setParam(IloCplex::EpGap, 0.001);
     
    if(!cplex.solve())
    {
    env.error()<<"Failed to optimize LP"<<endl;
    throw(-1);
    }
    


    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Q2: Why setting Relative MIP gap tolerance doesn't work?

    Posted 03/08/11 12:37 AM

    Originally posted by: Ulysses.Sheng


    thank you john! it works! and have a nice day:)
    #CPLEXOptimizers
    #DecisionOptimization