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