Originally posted by: felycite28
Hello everybody ,
ı have small question . I want to set time limit for my flow control script but I could not know where to insert it . Here is my code:
main
{
var source=newIloOplModelSource("xxx.mod");
var def=newOplModelDefinition (source);
var j;
for (j=1;j<=5;j++)
{
var name="instance.dat";
var data=new IloOplDataSource(name);
var opl=newIloOplModel(def,cplex);
opl.addDataSource(data);
opl:generate();
if (cplex:solve())
{
//do that
}
I want to set time limit for each iteration of for loop. Let's say the limit is 1 hour after one hour the model should start to solve second file ( j=2 ) after one hour third file (j=3) etc .
I have seen some examples from the previous posts , I tried them but somehow it did not work in a correct way , so I could not know where and how to insert time limit into the code?
Can you help me please ?
Regards
#DecisionOptimization#OPLusingCPLEXOptimizer