Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

tilim abort calculation

  • 1.  tilim abort calculation

    Posted Wed March 16, 2011 06:08 PM

    Originally posted by: SystemAdmin


    Hello,
    I'm solving multiple .dat files with flow control at OPL Studio.

    When setting a timlimit, cplex always stops the opimization (when there is no optimal solution) instead of going to the next opl.

    The error message in the scripting log is: "// Script execution failed with status -1"

    main{
    for (var p in thisOplModel.numberdat) {
                             if(p==1) {datname="sth.dat";}
                             if(p==2) {datname="sthelse.dat";}
                  
                            data1 = new IloOplDataSource(datname)
                            opl1.addDataSource(data1);
                            opl1.generate();
                            cplex.solve();
    }
    }
    


    also further calculation is aborted.

    Is there a way to tell the solver to go to the next step?

    thank you a lot for help
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: tilim abort calculation

    Posted Thu March 17, 2011 06:40 AM
    Hi,

    instead of

    cplex.solve();
    


    you should write

    if (cplex.solve())
    {
    }
    else
    {
    }
    


    in order to deal with the case where cplex had not enough time to find a solution

    Alex
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: tilim abort calculation

    Posted Thu March 17, 2011 09:39 AM

    Originally posted by: SystemAdmin


    Many thanks!

    it's important to end the current opl if it was not solved in the timelimit. That was my mistake.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer