0

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!

Alex Motley
  • 430
  • 6
  • 12

1 Answers1

0

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);
}
Alex Fleischer
  • 9,276
  • 2
  • 12
  • 15