CPLEX changing the time limit

120 views Asked by At

I am using and running directly from the IBM ILOG CPLEX Optimization Studio to solve an optimization problem. Since the problem and the instance is so big, CPLEX takes a very long time, so I want to limit the runtime to 2 hours. In parameters, the global time limit is set to 1.0E75, how to change it to set for 2 hours (7200s)?

Thanks in advance!

1

There are 1 answers

0
Alex Fleischer On

You can set time limit in the model :

execute
{
  cplex.tilim=20;
}


int nbKids=300;
float costBus40=500;
float costBus30=400;
     
dvar int+ nbBus40;
dvar int+ nbBus30;
     
minimize
     costBus40*nbBus40  +nbBus30*costBus30;
     
subject to
{
   40*nbBus40+nbBus30*30>=nbKids;
}

execute
{
    writeln("time limit = ",cplex.tilim);
}